From 3b9a71422e45209ef57c563e418f877bf54358be Mon Sep 17 00:00:00 2001 From: Eileen Yoon Date: Mon, 1 Jan 2024 08:37:52 +0900 Subject: [PATCH] avd: Make experiment display an option Signed-off-by: Eileen Yoon --- proxyclient/experiments/avd.py | 5 +++-- proxyclient/m1n1/fw/avd/decoder.py | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/proxyclient/experiments/avd.py b/proxyclient/experiments/avd.py index 3c84d4d12..e10487326 100755 --- a/proxyclient/experiments/avd.py +++ b/proxyclient/experiments/avd.py @@ -28,6 +28,7 @@ parser.add_argument('-a', '--all', action='store_true', help="run all frames") parser.add_argument('-x', '--stfu', action='store_true') parser.add_argument('-p', '--poll', action='store_true', help="poll iommu space") + parser.add_argument('-d', '--display', action='store_true', help="display frames") parser.add_argument('--save-raw', type=str, default="", help="file name to save raw yuv") parser.add_argument('--save-images', type=str, default="", help="dirname to save images") args = parser.parse_args() @@ -72,8 +73,8 @@ if (i == 0): avd.ioalloc_at(0x0, dec.allocator_top(), stream=0, val=0) if (args.poll): - avd.iomon.add(0x0, dec.allocator_top()) - frame = avd.decoder.decode(dec.ctx, unit, inst) + avd.iomon.add(0x0, 0x100000) + frame = avd.decoder.decode(dec.ctx, unit, inst, args.display) if (frame != None): if (args.save_raw): rawvideo += frame.y_data + frame.uv_data diff --git a/proxyclient/m1n1/fw/avd/decoder.py b/proxyclient/m1n1/fw/avd/decoder.py index 4cf38b7c1..4a05396bc 100644 --- a/proxyclient/m1n1/fw/avd/decoder.py +++ b/proxyclient/m1n1/fw/avd/decoder.py @@ -99,7 +99,7 @@ def display(self, frame): def select_disp_frame(self, ctx, sl): return self.frames[0] - def decode(self, ctx, sl, inst_stream): + def decode(self, ctx, sl, inst_stream, display): if not inst_stream: return self.set_payload(ctx, sl) self.setup_dma(ctx, sl) @@ -108,15 +108,17 @@ def decode(self, ctx, sl, inst_stream): self.set_insn(v) self.get_disp_frame(ctx, sl) assert(self.avd.avd_r32(0x1104060) == 0x2842108) - if (hasattr(ctx, "fmt")): - frame = self.get_nv12_disp_frame2(ctx, sl) - else: - frame = self.get_nv12_disp_frame(ctx, sl) - self.frames.append(frame) - frame = self.select_disp_frame(ctx, sl) - if (frame != None): - self.display(frame) - return frame + if (display): + if (hasattr(ctx, "fmt")): + frame = self.get_nv12_disp_frame2(ctx, sl) + else: + frame = self.get_nv12_disp_frame(ctx, sl) + self.frames.append(frame) + frame = self.select_disp_frame(ctx, sl) + if (frame != None): + self.display(frame) + return frame + return None class AVDH265Dec(AVDDec): def __init__(self, avd):