From 26fcdf5859dd1f2a63470eef70fa89e3b4522b90 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Tue, 24 Nov 2026 18:13:07 +1100 Subject: [PATCH] media: apple: avd: repair the VP9 host fixture The extracted VP9 test no longer compiles after the shared scratch format check and context fields were added. Give the fixture the two scratch fields and model the shared format check at the host-test boundary. The format validator has coverage in avd-fmt-test.c. The original fixture fails to compile and this change passes the standalone suite with ASan and UBSan on the same integration base. Signed-off-by: Ryan Murray --- drivers/media/platform/apple/avd/tests/vp9-test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/apple/avd/tests/vp9-test.py b/drivers/media/platform/apple/avd/tests/vp9-test.py index 0ea406aae1777..81fd4e7481416 100644 --- a/drivers/media/platform/apple/avd/tests/vp9-test.py +++ b/drivers/media/platform/apple/avd/tests/vp9-test.py @@ -32,7 +32,7 @@ 'struct vb2_buffer { struct { size_t length; } planes[1]; dma_addr_t dma; void *cpu; size_t payload; u64 timestamp; };') pre = pre.replace('struct avd_comp comp; unsigned int bank;', 'struct avd_comp comp; unsigned int bank; struct { unsigned int width,height,bit_depth; } vp9;') pre = pre.replace('struct vb2_v4l2_buffer *dst; } bufs;', 'struct vb2_v4l2_buffer *src,*dst; } bufs;') -pre = pre.replace('unsigned int fifo_idx, pp_total;', 'unsigned int fifo_idx, pp_total, max_frames; int ctrl_hdl;') +pre = pre.replace('unsigned int fifo_idx, pp_total;', 'unsigned int fifo_idx, pp_total, max_frames; int ctrl_hdl; bool scratch_sized; enum avd_image_fmt scratch_fmt;') pre = pre.replace('static int avd_buf_alloc(struct avd_dev *d, struct avd_buf *b, size_t n)', '#ifdef AVD_TEST_VP_READY\nstatic struct avd_ctx *allocating_ctx;\nstatic int fail_alloc_after;\nstatic bool avd_vp9_ready(struct avd_ctx *);\n#endif\nstatic int avd_buf_alloc(struct avd_dev *d, struct avd_buf *b, size_t n)') pre = pre.replace('{ (void)d; free(b->cpu); b->cpu = calloc(1,n);', @@ -107,6 +107,11 @@ run->coded_in=current_src->vb2_buf.dma;run->comp_out=current_dst->vb2_buf.dma; run->y_out=run->comp_out+0x100000;run->uv_out=run->comp_out+0x300000; } +/* avd-fmt-test.c independently exercises the run image format check. */ +static int avd_check_run_image_fmt(struct avd_ctx *ctx, int fmt) +{ + (void)ctx;(void)fmt;return 0; +} static void avd_run_postamble(struct avd_ctx *ctx,struct avd_run *run) { (void)ctx;(void)run; } static int avd_init_job(struct avd_ctx *ctx,int codec,size_t segments) { free(ctx->job.segments);ctx->job.codec=codec;ctx->job.num=0;