Re: [PATCH 2/2] media: iris: Add support for QC08C format for encoder

Markus Elfring
2025-09-24T12:40:58Z

…
> +++ b/drivers/media/platform/qcom/iris/iris_buffer.c
> @@ -171,9 +171,14 @@ static u32 iris_yuv_buffer_size_nv12(struct iris_inst *inst)
> static u32 iris_yuv_buffer_size_qc08c(struct iris_inst *inst)
> {
> u32 y_plane, uv_plane, y_stride, uv_stride;
> - struct v4l2_format *f = inst->fmt_dst;
> u32 uv_meta_stride, uv_meta_plane;
> u32 y_meta_stride, y_meta_plane;
> + struct v4l2_format *f = NULL;
> +
> + if (inst->domain == DECODER)
> + f = inst->fmt_dst;
> + else
> + f = inst->fmt_src;
…

How do you think about to use a source code variant like the following?

struct v4l2_format *f = (inst->domain == DECODER) ? inst->fmt_dst : inst->fmt_src;

Regards,
Markus