Re: [PATCH v7 09/12] media: rkvdec: Add get_image_fmt ops

Nicolas Dufresne
2025-04-08T17:13:09Z

(just trimmed a bit)

Le mardi 08 avril 2025 à 16:32 +0200, Hans Verkuil a écrit :
> So can we agree on the following (I think):
>
> 1) rkvdec_try_ctrl no longer checks the image_fmt. Effectively this means that there
>    is no longer any need to change rkvdec_try_ctrl in this patch.

Correct.

>
> 2) in rkvdec_s_ctrl we do the image_fmt check: if it changes, but vb2_is_busy is true,
>    then return -EBUSY, otherwise call rkvdec_reset_decoded_fmt(). This code is specific
>    for V4L2_CID_STATELESS_H264_SPS, so just make sure it is under an if/switch for that
>    control ID.

Correct. In practice, the IOCTL implementation function will be renamed
to what Jonas proposed (translated to s_ctrl instead of try), with some
name like s_sps_ctrl() (can't remember exactly). This is because
upcoming HEVC will endup sharing this code. Its going to be 1 control
per codec that supports 10bit.

>
> 3) I'll see if I can make a patch to clarify in the control documentation that setting
>    it can change the format.

Thanks.

>
> 4) I'll make a patch for the cedrus driver as well to align with the approach in rkvdec.

Thank you ! Glad we got to the bottom of it. As for rkvdec TODO, I will
prepare an upstaging patch series, and fix anything needed.

Nicolas