Re: [PATCH 4/8] media: iris: stop encoding PIPE value into fw_caps
From: Dmitry Baryshkov
Date: Wed Oct 08 2025 - 15:11:14 EST
On Wed, Oct 08, 2025 at 10:03:49AM +0200, Konrad Dybcio wrote:
> On 10/8/25 6:33 AM, Dmitry Baryshkov wrote:
> > The value of the PIPE property depends on the number of pipes available
> > on the platform and is frequently the only difference between several
> > fw_caps. In order to reduce duplciation, use num_vpp_pipe from the
> > iris_platform_data rather than hardcoding the value into the fw_cap.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/media/platform/qcom/iris/iris_ctrls.c | 6 +++++-
> > drivers/media/platform/qcom/iris/iris_platform_gen2.c | 4 ++--
> > drivers/media/platform/qcom/iris/iris_platform_qcs8300.h | 4 ++--
> > drivers/media/platform/qcom/iris/iris_platform_sm8250.c | 4 ++--
> > 4 files changed, 11 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/platform/qcom/iris/iris_ctrls.c
> > index 0e9adb3982a49cfd7cbe5110cfd5f573f0f7bb38..8db3fa222bdb92a7ffff3dfe62d33f16c0550757 100644
> > --- a/drivers/media/platform/qcom/iris/iris_ctrls.c
> > +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c
> > @@ -318,7 +318,11 @@ void iris_session_init_caps(struct iris_core *core)
> > continue;
> >
> > core->inst_fw_caps_dec[cap_id].idx = i;
> > - core->inst_fw_caps_dec[cap_id].value = caps[i].value;
> > + if (cap_id == PIPE)
> > + core->inst_fw_caps_dec[cap_id].value =
> > + core->iris_platform_data->num_vpp_pipe;
> > + else
> > + core->inst_fw_caps_dec[cap_id].value = caps[i].value;
>
> I really hope this if-else won't grow in the future
It really means that PIPE and several other caps should be converted to
explicit code sequences. I think, only V4L2 controls should be a part of
the caps array. Everything else should eventually migrate out. But it's
not a subject of this patch.
> Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>
>
> Konrad
--
With best wishes
Dmitry