Skip to content

Commit

Permalink
avd: Make experiment display an option
Browse files Browse the repository at this point in the history
Signed-off-by: Eileen Yoon <[email protected]>
  • Loading branch information
eiln authored and marcan committed Jan 11, 2024
1 parent 16a6b41 commit 3b9a714
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
5 changes: 3 additions & 2 deletions proxyclient/experiments/avd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions proxyclient/m1n1/fw/avd/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit 3b9a714

Please sign in to comment.