Re: [v9] media: mediatek: vcodec: support stateless AV1 decoder

From: Hans Verkuil
Date: Wed Apr 12 2023 - 08:39:33 EST


On 12/04/2023 14:22, Hans Verkuil wrote:
> On 12/04/2023 05:30, Xiaoyong Lu wrote:
>> Add mediatek av1 decoder linux driver which use the stateless API in
>> MT8195.
>>
>> Signed-off-by: Xiaoyong Lu<xiaoyong.lu@xxxxxxxxxxxx>
>> Tested-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
>> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@xxxxxxxxxxxxx>
>> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
>> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
>
> Hmm, I get this compile error:
>
> drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c: In function ‘vdec_av1_slice_setup_uh’:
> drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c:48:58: error: ‘V4L2_AV1_FRAME_FLAG_UNIFORM_TILE_SPACING’ undeclared (first use in this function); did you mean
> ‘V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING’?
> 48 | #define FH_FLAG(x, name) (!!((x)->flags & V4L2_AV1_FRAME_FLAG_##name))
> | ^~~~~~~~~~~~~~~~~~~~
> drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c:1322:41: note: in expansion of macro ‘FH_FLAG’
> 1322 | uh->uniform_tile_spacing_flag = FH_FLAG(ctrl_fh, UNIFORM_TILE_SPACING);
> | ^~~~~~~
> drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c:48:58: note: each undeclared identifier is reported only once for each function it appears in
> 48 | #define FH_FLAG(x, name) (!!((x)->flags & V4L2_AV1_FRAME_FLAG_##name))
> | ^~~~~~~~~~~~~~~~~~~~
> drivers/media/platform/mediatek/vcodec/vdec/vdec_av1_req_lat_if.c:1322:41: note: in expansion of macro ‘FH_FLAG’
> 1322 | uh->uniform_tile_spacing_flag = FH_FLAG(ctrl_fh, UNIFORM_TILE_SPACING);
> | ^~~~~~~
>
> This flag was renamed from V4L2_AV1_FRAME_FLAG_UNIFORM_TILE_SPACING to
> V4L2_AV1_TILE_INFO_FLAG_UNIFORM_TILE_SPACING in v5 of the AV1 uAPI.
>
> So this suggests to me that you are testing with an old version of the AV1
> uAPI. The correct one is v7:
>
> https://patchwork.linuxtv.org/project/linux-media/patch/20230306161850.492072-1-daniel.almeida@xxxxxxxxxxxxx/
>
> You have to compile and test with that v7 patch since that's the version we
> want to merge.

smatch also gave this error:

vdec_av1_req_lat_if.c:2121 vdec_av1_slice_lat_decode() error: we previously assumed 'pfc' could be null (see line 2056)

Regards,

Hans