[PATCH 4/8] media: iris: stop encoding PIPE value into fw_caps

Dmitry Baryshkov
2025-10-08T04:33:22Z

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@oss.qualcomm.com>
---
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;
}

caps = core->iris_platform_data->inst_fw_caps_enc;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index b444e816355624bca8248cce9da7adcd7caf6c5b..7ad03a800356ae9fb73bdbd6d09928d0b500cb3c 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -161,9 +161,9 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = {
{
.cap_id = PIPE,
.min = PIPE_1,
- .max = PIPE_4,
+ /* .max is set via platform data */
.step_or_mask = 1,
- .value = PIPE_4,
+ /* .value is set via platform data */
.hfi_id = HFI_PROP_PIPE,
.set = iris_set_pipe,
},
diff --git a/drivers/media/platform/qcom/iris/iris_platform_qcs8300.h b/drivers/media/platform/qcom/iris/iris_platform_qcs8300.h
index 87517361a1cf4b6fe53b8a1483188670df52c7e7..612526a938eed0554fc0da99e12c26d22e04bb6e 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_qcs8300.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_qcs8300.h
@@ -147,9 +147,9 @@ static const struct platform_inst_fw_cap inst_fw_cap_qcs8300_dec[] = {
{
.cap_id = PIPE,
.min = PIPE_1,
- .max = PIPE_2,
+ /* .max is set via platform data */
.step_or_mask = 1,
- .value = PIPE_2,
+ /* .value is set via platform data */
.hfi_id = HFI_PROP_PIPE,
.set = iris_set_pipe,
},
diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c b/drivers/media/platform/qcom/iris/iris_platform_sm8250.c
index 66a5bdd24d8a0e98b0554a019438bf4caa1dc43c..2b3b8bd00a6096acaae928318d9231847ec89855 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.c
@@ -21,9 +21,9 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8250_dec[] = {
{
.cap_id = PIPE,
.min = PIPE_1,
- .max = PIPE_4,
+ /* .max is set via platform data */
.step_or_mask = 1,
- .value = PIPE_4,
+ /* .value is set via platform data */
.hfi_id = HFI_PROPERTY_PARAM_WORK_ROUTE,
.set = iris_set_pipe,
},

--
2.47.3