* [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:02 ` Dmitry Baryshkov
` (2 more replies)
2026-03-13 13:19 ` [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
` (5 subsequent siblings)
6 siblings, 3 replies; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia, Krzysztof Kozlowski
Kaanapali SOC brings in the new generation of video IP i.e iris4. When
compared to previous generation, iris3x, it has,
- separate power domains for stream and pixel processing hardware blocks
(bse and vpp).
- additional power domain for apv codec.
- power domains for individual pipes (VPPx).
- different clocks and reset lines.
This patch depends on
https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
.../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
2 files changed, 272 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.yaml b/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..1f35472a2caea7acd2ef20b5cbdafadba882bd3a
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.yaml
@@ -0,0 +1,254 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/qcom,kaanapali-iris.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Kaanapali Iris video encoder and decoder
+
+maintainers:
+ - Vikash Garodia <vikash.garodia@oss.qualcomm.com>
+ - Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
+
+description:
+ The iris video processing unit is a video encode and decode accelerator
+ present on Qualcomm Kaanapali SoC.
+
+properties:
+ compatible:
+ const: qcom,kaanapali-iris
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 10
+
+ clock-names:
+ items:
+ - const: iface
+ - const: core
+ - const: vcodec0_core
+ - const: iface1
+ - const: core_freerun
+ - const: vcodec0_core_freerun
+ - const: vcodec_bse
+ - const: vcodec_vpp0
+ - const: vcodec_vpp1
+ - const: vcodec_apv
+
+ dma-coherent: true
+
+ firmware-name:
+ maxItems: 1
+
+ interconnects:
+ maxItems: 2
+
+ interconnect-names:
+ items:
+ - const: cpu-cfg
+ - const: video-mem
+
+ interrupts:
+ maxItems: 1
+
+ iommu-map:
+ $ref: /schemas/types.yaml#/definitions/uint32-matrix
+ items:
+ - description: bitstream stream from vcodec
+ items:
+ - description: Function ID
+ - description: Phandle to IOMMU
+ - description: IOMMU stream ID base
+ - description: IOMMU stream ID mask
+ - description: Number of stream IDs
+ - description: non-pixel stream from vcodec
+ - description: non-pixel stream from tensilica
+ - description: pixel stream from vcodec
+ - description: secure bitstream stream from vcodec
+ - description: secure non-pixel stream from vcodec
+ - description: secure non-pixel stream from tensilica
+ - description: secure pixel stream from vcodec
+ # firmware might be handled by the TZ / hyp
+ - description: firmware stream from tensilica
+ minItems: 8
+
+ memory-region:
+ maxItems: 1
+
+ operating-points-v2: true
+ opp-table:
+ type: object
+
+ power-domains:
+ maxItems: 7
+
+ power-domain-names:
+ items:
+ - const: venus
+ - const: vcodec0
+ - const: mxc
+ - const: mmcx
+ - const: vpp0
+ - const: vpp1
+ - const: apv
+
+ resets:
+ maxItems: 4
+
+ reset-names:
+ items:
+ - const: bus0
+ - const: bus1
+ - const: core
+ - const: vcodec0_core
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - dma-coherent
+ - interconnects
+ - interconnect-names
+ - interrupts
+ - iommu-map
+ - memory-region
+ - power-domains
+ - power-domain-names
+ - resets
+ - reset-names
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/media/qcom,kaanapali-iris.h>
+ #include <dt-bindings/power/qcom,rpmhpd.h>
+
+ video-codec@2000000 {
+ compatible = "qcom,kaanapali-iris";
+ reg = <0x02000000 0xf0000>;
+
+ clocks = <&gcc_video_axi0_clk>,
+ <&video_cc_mvs0c_clk>,
+ <&video_cc_mvs0_clk>,
+ <&gcc_video_axi1_clk>,
+ <&video_cc_mvs0c_freerun_clk>,
+ <&video_cc_mvs0_freerun_clk>,
+ <&video_cc_mvs0b_clk>,
+ <&video_cc_mvs0_vpp0_clk>,
+ <&video_cc_mvs0_vpp1_clk>,
+ <&video_cc_mvs0a_clk>;
+ clock-names = "iface",
+ "core",
+ "vcodec0_core",
+ "iface1",
+ "core_freerun",
+ "vcodec0_core_freerun",
+ "vcodec_bse",
+ "vcodec_vpp0",
+ "vcodec_vpp1",
+ "vcodec_apv";
+
+ dma-coherent;
+
+ interconnects = <&gem_noc_master_appss_proc &config_noc_slave_venus_cfg>,
+ <&mmss_noc_master_video_mvp &mc_virt_slave_ebi1>;
+ interconnect-names = "cpu-cfg",
+ "video-mem";
+
+ interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+
+ iommu-map = <IRIS_BITSTREAM &apps_smmu 0x1944 0x0 0x1>,
+ <IRIS_NON_PIXEL &apps_smmu 0x1940 0x0 0x1>,
+ <IRIS_NON_PIXEL &apps_smmu 0x1a20 0x0 0x1>,
+ <IRIS_PIXEL &apps_smmu 0x1943 0x0 0x1>,
+ <IRIS_SECURE_BITSTREAM &apps_smmu 0x1946 0x0 0x1>,
+ <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1941 0x0 0x1>,
+ <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1a21 0x0 0x1>,
+ <IRIS_SECURE_PIXEL &apps_smmu 0x1945 0x0 0x1>,
+ <IRIS_FIRMWARE &apps_smmu 0x1a22 0x0 0x1>;
+
+ memory-region = <&video_mem>;
+
+ operating-points-v2 = <&iris_opp_table>;
+
+ power-domains = <&video_cc_mvs0c_gdsc>,
+ <&video_cc_mvs0_gdsc>,
+ <&rpmhpd RPMHPD_MXC>,
+ <&rpmhpd RPMHPD_MMCX>,
+ <&video_cc_mvs0_vpp0_gdsc>,
+ <&video_cc_mvs0_vpp1_gdsc>,
+ <&video_cc_mvs0a_gdsc>;
+ power-domain-names = "venus",
+ "vcodec0",
+ "mxc",
+ "mmcx",
+ "vpp0",
+ "vpp1",
+ "apv";
+
+ resets = <&gcc_video_axi0_clk_ares>,
+ <&gcc_video_axi1_clk_ares>,
+ <&video_cc_mvs0c_freerun_clk_ares>,
+ <&video_cc_mvs0_freerun_clk_ares>;
+ reset-names = "bus0",
+ "bus1",
+ "core",
+ "vcodec0_core";
+
+ iris_opp_table: opp-table {
+ compatible = "operating-points-v2";
+
+ opp-240000000 {
+ opp-hz = /bits/ 64 <240000000 240000000 240000000 360000000>;
+ required-opps = <&rpmhpd_opp_low_svs_d1>,
+ <&rpmhpd_opp_low_svs_d1>;
+ };
+
+ opp-338000000 {
+ opp-hz = /bits/ 64 <338000000 338000000 338000000 507000000>;
+ required-opps = <&rpmhpd_opp_low_svs>,
+ <&rpmhpd_opp_low_svs>;
+ };
+
+ opp-420000000 {
+ opp-hz = /bits/ 64 <420000000 420000000 420000000 630000000>;
+ required-opps = <&rpmhpd_opp_svs>,
+ <&rpmhpd_opp_svs>;
+ };
+
+ opp-444000000 {
+ opp-hz = /bits/ 64 <444000000 444000000 444000000 666000000>;
+ required-opps = <&rpmhpd_opp_svs_l1>,
+ <&rpmhpd_opp_svs_l1>;
+ };
+
+ opp-533000000 {
+ opp-hz = /bits/ 64 <533000000 533000000 533000000 800000000>;
+ required-opps = <&rpmhpd_opp_nom>,
+ <&rpmhpd_opp_nom>;
+ };
+
+ opp-630000000 {
+ opp-hz = /bits/ 64 <630000000 630000000 630000000 1104000000>;
+ required-opps = <&rpmhpd_opp_turbo>,
+ <&rpmhpd_opp_turbo>;
+ };
+
+ opp-800000000 {
+ opp-hz = /bits/ 64 <800000000 630000000 630000000 1260000000>;
+ required-opps = <&rpmhpd_opp_turbo_l0>,
+ <&rpmhpd_opp_turbo_l0>;
+ };
+
+ opp-1000000000 {
+ opp-hz = /bits/ 64 <1000000000 630000000 850000000 1260000000>;
+ required-opps = <&rpmhpd_opp_turbo_l1>,
+ <&rpmhpd_opp_turbo_l1>;
+ };
+ };
+ };
diff --git a/include/dt-bindings/media/qcom,kaanapali-iris.h b/include/dt-bindings/media/qcom,kaanapali-iris.h
new file mode 100644
index 0000000000000000000000000000000000000000..757313799293d59b2122dd8d05b654f7a3a9876a
--- /dev/null
+++ b/include/dt-bindings/media/qcom,kaanapali-iris.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef _DT_BINDINGS_MEDIA_QCOM_KAANAPALI_IRIS_H_
+#define _DT_BINDINGS_MEDIA_QCOM_KAANAPALI_IRIS_H_
+
+/* Function identifiers for iommu-map to attach for the context bank devices */
+#define IRIS_BITSTREAM 0
+#define IRIS_NON_PIXEL 1
+#define IRIS_PIXEL 2
+#define IRIS_SECURE_BITSTREAM 3
+#define IRIS_SECURE_NON_PIXEL 4
+#define IRIS_SECURE_PIXEL 5
+#define IRIS_FIRMWARE 6
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 13:19 ` [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
@ 2026-03-13 15:02 ` Dmitry Baryshkov
2026-03-13 15:16 ` Vikash Garodia
2026-03-13 15:34 ` Rob Herring (Arm)
2026-03-13 15:43 ` Krzysztof Kozlowski
2 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:02 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue,
Krzysztof Kozlowski
On Fri, Mar 13, 2026 at 06:49:35PM +0530, Vikash Garodia wrote:
> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
> compared to previous generation, iris3x, it has,
> - separate power domains for stream and pixel processing hardware blocks
> (bse and vpp).
> - additional power domain for apv codec.
> - power domains for individual pipes (VPPx).
> - different clocks and reset lines.
>
> This patch depends on
> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>
> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> .../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
> include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
> 2 files changed, 272 insertions(+)
> +
> + video-codec@2000000 {
> + compatible = "qcom,kaanapali-iris";
> + reg = <0x02000000 0xf0000>;
> +
> + clocks = <&gcc_video_axi0_clk>,
> + <&video_cc_mvs0c_clk>,
> + <&video_cc_mvs0_clk>,
> + <&gcc_video_axi1_clk>,
> + <&video_cc_mvs0c_freerun_clk>,
> + <&video_cc_mvs0_freerun_clk>,
> + <&video_cc_mvs0b_clk>,
> + <&video_cc_mvs0_vpp0_clk>,
> + <&video_cc_mvs0_vpp1_clk>,
> + <&video_cc_mvs0a_clk>;
> + clock-names = "iface",
> + "core",
> + "vcodec0_core",
> + "iface1",
> + "core_freerun",
> + "vcodec0_core_freerun",
> + "vcodec_bse",
> + "vcodec_vpp0",
> + "vcodec_vpp1",
> + "vcodec_apv";
> +
> + dma-coherent;
> +
> + interconnects = <&gem_noc_master_appss_proc &config_noc_slave_venus_cfg>,
> + <&mmss_noc_master_video_mvp &mc_virt_slave_ebi1>;
> + interconnect-names = "cpu-cfg",
> + "video-mem";
> +
> + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
> +
> + iommu-map = <IRIS_BITSTREAM &apps_smmu 0x1944 0x0 0x1>,
> + <IRIS_NON_PIXEL &apps_smmu 0x1940 0x0 0x1>,
> + <IRIS_NON_PIXEL &apps_smmu 0x1a20 0x0 0x1>,
It think we still haven't settled on letting iommu-map to have several
entries for a single function.
> + <IRIS_PIXEL &apps_smmu 0x1943 0x0 0x1>,
> + <IRIS_SECURE_BITSTREAM &apps_smmu 0x1946 0x0 0x1>,
> + <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1941 0x0 0x1>,
> + <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1a21 0x0 0x1>,
> + <IRIS_SECURE_PIXEL &apps_smmu 0x1945 0x0 0x1>,
> + <IRIS_FIRMWARE &apps_smmu 0x1a22 0x0 0x1>;
> +
> + memory-region = <&video_mem>;
> +
> + operating-points-v2 = <&iris_opp_table>;
> +
> + power-domains = <&video_cc_mvs0c_gdsc>,
> + <&video_cc_mvs0_gdsc>,
> + <&rpmhpd RPMHPD_MXC>,
> + <&rpmhpd RPMHPD_MMCX>,
> + <&video_cc_mvs0_vpp0_gdsc>,
> + <&video_cc_mvs0_vpp1_gdsc>,
> + <&video_cc_mvs0a_gdsc>;
> + power-domain-names = "venus",
> + "vcodec0",
> + "mxc",
> + "mmcx",
> + "vpp0",
> + "vpp1",
> + "apv";
> +
> + resets = <&gcc_video_axi0_clk_ares>,
> + <&gcc_video_axi1_clk_ares>,
> + <&video_cc_mvs0c_freerun_clk_ares>,
> + <&video_cc_mvs0_freerun_clk_ares>;
> + reset-names = "bus0",
> + "bus1",
> + "core",
> + "vcodec0_core";
> +
> + iris_opp_table: opp-table {
> + compatible = "operating-points-v2";
> +
> + opp-240000000 {
> + opp-hz = /bits/ 64 <240000000 240000000 240000000 360000000>;
> + required-opps = <&rpmhpd_opp_low_svs_d1>,
> + <&rpmhpd_opp_low_svs_d1>;
It's a DT and not the schema question, but please cross-check the OPP
points here. If I understand Taniya correctly, we should be using
corners from the PLL type rather than from the video_cc clock plan (they
differ for some reason). Downstream videocc driver also should have
correct rail corners for the PLLs.
> + };
> +
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 15:02 ` Dmitry Baryshkov
@ 2026-03-13 15:16 ` Vikash Garodia
2026-03-13 15:40 ` Dmitry Baryshkov
0 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 15:16 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue,
Krzysztof Kozlowski
On 3/13/2026 8:32 PM, Dmitry Baryshkov wrote:
> On Fri, Mar 13, 2026 at 06:49:35PM +0530, Vikash Garodia wrote:
>> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
>> compared to previous generation, iris3x, it has,
>> - separate power domains for stream and pixel processing hardware blocks
>> (bse and vpp).
>> - additional power domain for apv codec.
>> - power domains for individual pipes (VPPx).
>> - different clocks and reset lines.
>>
>> This patch depends on
>> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>>
>> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>> ---
>> .../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
>> include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
>> 2 files changed, 272 insertions(+)
>
>> +
>> + video-codec@2000000 {
>> + compatible = "qcom,kaanapali-iris";
>> + reg = <0x02000000 0xf0000>;
>> +
>> + clocks = <&gcc_video_axi0_clk>,
>> + <&video_cc_mvs0c_clk>,
>> + <&video_cc_mvs0_clk>,
>> + <&gcc_video_axi1_clk>,
>> + <&video_cc_mvs0c_freerun_clk>,
>> + <&video_cc_mvs0_freerun_clk>,
>> + <&video_cc_mvs0b_clk>,
>> + <&video_cc_mvs0_vpp0_clk>,
>> + <&video_cc_mvs0_vpp1_clk>,
>> + <&video_cc_mvs0a_clk>;
>> + clock-names = "iface",
>> + "core",
>> + "vcodec0_core",
>> + "iface1",
>> + "core_freerun",
>> + "vcodec0_core_freerun",
>> + "vcodec_bse",
>> + "vcodec_vpp0",
>> + "vcodec_vpp1",
>> + "vcodec_apv";
>> +
>> + dma-coherent;
>> +
>> + interconnects = <&gem_noc_master_appss_proc &config_noc_slave_venus_cfg>,
>> + <&mmss_noc_master_video_mvp &mc_virt_slave_ebi1>;
>> + interconnect-names = "cpu-cfg",
>> + "video-mem";
>> +
>> + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
>> +
>> + iommu-map = <IRIS_BITSTREAM &apps_smmu 0x1944 0x0 0x1>,
>> + <IRIS_NON_PIXEL &apps_smmu 0x1940 0x0 0x1>,
>> + <IRIS_NON_PIXEL &apps_smmu 0x1a20 0x0 0x1>,
>
> It think we still haven't settled on letting iommu-map to have several
> entries for a single function.
I have described the hardware aspects in the discussion [1], if there is
any alternate way to handle this, we can discuss in the same discussion.
[1]
https://lore.kernel.org/all/21fda4d2-72e1-4e5b-aee0-a799886f53b7@oss.qualcomm.com/
>
>> + <IRIS_PIXEL &apps_smmu 0x1943 0x0 0x1>,
>> + <IRIS_SECURE_BITSTREAM &apps_smmu 0x1946 0x0 0x1>,
>> + <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1941 0x0 0x1>,
>> + <IRIS_SECURE_NON_PIXEL &apps_smmu 0x1a21 0x0 0x1>,
>> + <IRIS_SECURE_PIXEL &apps_smmu 0x1945 0x0 0x1>,
>> + <IRIS_FIRMWARE &apps_smmu 0x1a22 0x0 0x1>;
>> +
>> + memory-region = <&video_mem>;
>> +
>> + operating-points-v2 = <&iris_opp_table>;
>> +
>> + power-domains = <&video_cc_mvs0c_gdsc>,
>> + <&video_cc_mvs0_gdsc>,
>> + <&rpmhpd RPMHPD_MXC>,
>> + <&rpmhpd RPMHPD_MMCX>,
>> + <&video_cc_mvs0_vpp0_gdsc>,
>> + <&video_cc_mvs0_vpp1_gdsc>,
>> + <&video_cc_mvs0a_gdsc>;
>> + power-domain-names = "venus",
>> + "vcodec0",
>> + "mxc",
>> + "mmcx",
>> + "vpp0",
>> + "vpp1",
>> + "apv";
>> +
>> + resets = <&gcc_video_axi0_clk_ares>,
>> + <&gcc_video_axi1_clk_ares>,
>> + <&video_cc_mvs0c_freerun_clk_ares>,
>> + <&video_cc_mvs0_freerun_clk_ares>;
>> + reset-names = "bus0",
>> + "bus1",
>> + "core",
>> + "vcodec0_core";
>> +
>> + iris_opp_table: opp-table {
>> + compatible = "operating-points-v2";
>> +
>> + opp-240000000 {
>> + opp-hz = /bits/ 64 <240000000 240000000 240000000 360000000>;
>> + required-opps = <&rpmhpd_opp_low_svs_d1>,
>> + <&rpmhpd_opp_low_svs_d1>;
>
> It's a DT and not the schema question, but please cross-check the OPP
> points here. If I understand Taniya correctly, we should be using
> corners from the PLL type rather than from the video_cc clock plan (they
> differ for some reason). Downstream videocc driver also should have
> correct rail corners for the PLLs.
>
>> + };
>> +
>
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 15:16 ` Vikash Garodia
@ 2026-03-13 15:40 ` Dmitry Baryshkov
2026-03-25 15:10 ` Vikash Garodia
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:40 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue,
Krzysztof Kozlowski
On Fri, Mar 13, 2026 at 08:46:52PM +0530, Vikash Garodia wrote:
>
> On 3/13/2026 8:32 PM, Dmitry Baryshkov wrote:
> > On Fri, Mar 13, 2026 at 06:49:35PM +0530, Vikash Garodia wrote:
> > > Kaanapali SOC brings in the new generation of video IP i.e iris4. When
> > > compared to previous generation, iris3x, it has,
> > > - separate power domains for stream and pixel processing hardware blocks
> > > (bse and vpp).
> > > - additional power domain for apv codec.
> > > - power domains for individual pipes (VPPx).
> > > - different clocks and reset lines.
> > >
> > > This patch depends on
> > > https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
> > >
> > > Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> > > Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> > > ---
> > > .../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
> > > include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
> > > 2 files changed, 272 insertions(+)
> >
> > > +
> > > + video-codec@2000000 {
> > > + compatible = "qcom,kaanapali-iris";
> > > + reg = <0x02000000 0xf0000>;
> > > +
> > > + clocks = <&gcc_video_axi0_clk>,
> > > + <&video_cc_mvs0c_clk>,
> > > + <&video_cc_mvs0_clk>,
> > > + <&gcc_video_axi1_clk>,
> > > + <&video_cc_mvs0c_freerun_clk>,
> > > + <&video_cc_mvs0_freerun_clk>,
> > > + <&video_cc_mvs0b_clk>,
> > > + <&video_cc_mvs0_vpp0_clk>,
> > > + <&video_cc_mvs0_vpp1_clk>,
> > > + <&video_cc_mvs0a_clk>;
> > > + clock-names = "iface",
> > > + "core",
> > > + "vcodec0_core",
> > > + "iface1",
> > > + "core_freerun",
> > > + "vcodec0_core_freerun",
> > > + "vcodec_bse",
> > > + "vcodec_vpp0",
> > > + "vcodec_vpp1",
> > > + "vcodec_apv";
> > > +
> > > + dma-coherent;
> > > +
> > > + interconnects = <&gem_noc_master_appss_proc &config_noc_slave_venus_cfg>,
> > > + <&mmss_noc_master_video_mvp &mc_virt_slave_ebi1>;
> > > + interconnect-names = "cpu-cfg",
> > > + "video-mem";
> > > +
> > > + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
> > > +
> > > + iommu-map = <IRIS_BITSTREAM &apps_smmu 0x1944 0x0 0x1>,
> > > + <IRIS_NON_PIXEL &apps_smmu 0x1940 0x0 0x1>,
> > > + <IRIS_NON_PIXEL &apps_smmu 0x1a20 0x0 0x1>,
> >
> > It think we still haven't settled on letting iommu-map to have several
> > entries for a single function.
>
> I have described the hardware aspects in the discussion [1], if there is any
> alternate way to handle this, we can discuss in the same discussion.
Yes. But how do you plan to merge this? You've split away the patches,
they don't seem to be listed as dependencies, etc.
>
> [1] https://lore.kernel.org/all/21fda4d2-72e1-4e5b-aee0-a799886f53b7@oss.qualcomm.com/
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 15:40 ` Dmitry Baryshkov
@ 2026-03-25 15:10 ` Vikash Garodia
0 siblings, 0 replies; 24+ messages in thread
From: Vikash Garodia @ 2026-03-25 15:10 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue,
Krzysztof Kozlowski
On 3/13/2026 9:10 PM, Dmitry Baryshkov wrote:
> On Fri, Mar 13, 2026 at 08:46:52PM +0530, Vikash Garodia wrote:
>>
>> On 3/13/2026 8:32 PM, Dmitry Baryshkov wrote:
>>> On Fri, Mar 13, 2026 at 06:49:35PM +0530, Vikash Garodia wrote:
>>>> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
>>>> compared to previous generation, iris3x, it has,
>>>> - separate power domains for stream and pixel processing hardware blocks
>>>> (bse and vpp).
>>>> - additional power domain for apv codec.
>>>> - power domains for individual pipes (VPPx).
>>>> - different clocks and reset lines.
>>>>
>>>> This patch depends on
>>>> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>>>>
>>>> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>>> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>>>> ---
>>>> .../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
>>>> include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
>>>> 2 files changed, 272 insertions(+)
>>>
>>>> +
>>>> + video-codec@2000000 {
>>>> + compatible = "qcom,kaanapali-iris";
>>>> + reg = <0x02000000 0xf0000>;
>>>> +
>>>> + clocks = <&gcc_video_axi0_clk>,
>>>> + <&video_cc_mvs0c_clk>,
>>>> + <&video_cc_mvs0_clk>,
>>>> + <&gcc_video_axi1_clk>,
>>>> + <&video_cc_mvs0c_freerun_clk>,
>>>> + <&video_cc_mvs0_freerun_clk>,
>>>> + <&video_cc_mvs0b_clk>,
>>>> + <&video_cc_mvs0_vpp0_clk>,
>>>> + <&video_cc_mvs0_vpp1_clk>,
>>>> + <&video_cc_mvs0a_clk>;
>>>> + clock-names = "iface",
>>>> + "core",
>>>> + "vcodec0_core",
>>>> + "iface1",
>>>> + "core_freerun",
>>>> + "vcodec0_core_freerun",
>>>> + "vcodec_bse",
>>>> + "vcodec_vpp0",
>>>> + "vcodec_vpp1",
>>>> + "vcodec_apv";
>>>> +
>>>> + dma-coherent;
>>>> +
>>>> + interconnects = <&gem_noc_master_appss_proc &config_noc_slave_venus_cfg>,
>>>> + <&mmss_noc_master_video_mvp &mc_virt_slave_ebi1>;
>>>> + interconnect-names = "cpu-cfg",
>>>> + "video-mem";
>>>> +
>>>> + interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
>>>> +
>>>> + iommu-map = <IRIS_BITSTREAM &apps_smmu 0x1944 0x0 0x1>,
>>>> + <IRIS_NON_PIXEL &apps_smmu 0x1940 0x0 0x1>,
>>>> + <IRIS_NON_PIXEL &apps_smmu 0x1a20 0x0 0x1>,
>>>
>>> It think we still haven't settled on letting iommu-map to have several
>>> entries for a single function.
>>
>> I have described the hardware aspects in the discussion [1], if there is any
>> alternate way to handle this, we can discuss in the same discussion.
>
> Yes. But how do you plan to merge this? You've split away the patches,
> they don't seem to be listed as dependencies, etc.
>
1:1 mapping of function ID with stream ID is closing on the reviews. I
will have to update this patch to represent it in 1:1 mapping.
Once done, this patch can be merged with the dependency marked in this
patch i.e
https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>>
>> [1] https://lore.kernel.org/all/21fda4d2-72e1-4e5b-aee0-a799886f53b7@oss.qualcomm.com/
>
Regards,
Vikash
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 13:19 ` [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
2026-03-13 15:02 ` Dmitry Baryshkov
@ 2026-03-13 15:34 ` Rob Herring (Arm)
2026-03-13 15:43 ` Krzysztof Kozlowski
2 siblings, 0 replies; 24+ messages in thread
From: Rob Herring (Arm) @ 2026-03-13 15:34 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Krzysztof Kozlowski, linux-arm-msm,
linux-kernel, Will Deacon, Stefan Schmidt, iommu,
Bryan O'Donoghue, Hans Verkuil, Mauro Carvalho Chehab,
Krzysztof Kozlowski, Bryan O'Donoghue, Hans Verkuil,
Vishnu Reddy, Joerg Roedel, Saravana Kannan, Krzysztof Kozlowski,
linux-media, Dmitry Baryshkov, Conor Dooley, Robin Murphy,
Abhinav Kumar, devicetree
On Fri, 13 Mar 2026 18:49:35 +0530, Vikash Garodia wrote:
> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
> compared to previous generation, iris3x, it has,
> - separate power domains for stream and pixel processing hardware blocks
> (bse and vpp).
> - additional power domain for apv codec.
> - power domains for individual pipes (VPPx).
> - different clocks and reset lines.
>
> This patch depends on
> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>
> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> .../bindings/media/qcom,kaanapali-iris.yaml | 254 +++++++++++++++++++++
> include/dt-bindings/media/qcom,kaanapali-iris.h | 18 ++
> 2 files changed, 272 insertions(+)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdm845.example.dtb: pcie@1c00000 (qcom,pcie-sdm845): iommu-map:0: [0, 4294967295, 7184, 1, 256, 4294967295, 7185, 1, 512, 4294967295, 7186, 1, 768, 4294967295, 7187, 1, 1024, 4294967295, 7188, 1, 1280, 4294967295, 7189, 1, 1536, 4294967295, 7190, 1, 1792, 4294967295, 7191, 1, 2048, 4294967295, 7192, 1, 2304, 4294967295, 7193, 1, 2560, 4294967295, 7194, 1, 2816, 4294967295, 7195, 1, 3072, 4294967295, 7196, 1, 3328, 4294967295, 7197, 1, 3584, 4294967295, 7198, 1, 3840, 4294967295, 7199, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdm845.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdm845.example.dtb: pcie@1c00000 (qcom,pcie-sdm845): Unevaluated properties are not allowed ('#address-cells', '#interrupt-cells', '#size-cells', 'bus-range', 'device_type', 'interrupt-map', 'interrupt-map-mask', 'iommu-map', 'linux,pci-domain', 'num-lanes', 'pcie@0', 'perst-gpios', 'phy-names', 'phys', 'power-domains', 'ranges', 'vddpe-3v3-supply', 'wake-gpios' were unexpected)
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdm845.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdm845.example.dtb: pcie@1c00000 (qcom,pcie-sdm845): iommu-map:0: [0, 4294967295, 7184, 1, 256, 4294967295, 7185, 1, 512, 4294967295, 7186, 1, 768, 4294967295, 7187, 1, 1024, 4294967295, 7188, 1, 1280, 4294967295, 7189, 1, 1536, 4294967295, 7190, 1, 1792, 4294967295, 7191, 1, 2048, 4294967295, 7192, 1, 2304, 4294967295, 7193, 1, 2560, 4294967295, 7194, 1, 2816, 4294967295, 7195, 1, 3072, 4294967295, 7196, 1, 3328, 4294967295, 7197, 1, 3584, 4294967295, 7198, 1, 3840, 4294967295, 7199, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:0: [0, 4294967295, 512, 1, 256] is too long
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:1:0: 4294967295 is greater than the maximum of 65535
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:1: [4294967295, 513, 1, 512, 4294967295] is too long
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:2:3: 4294967295 is greater than the maximum of 65536
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:2: [514, 1, 768, 4294967295, 515] is too long
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:3: [1, 1024, 4294967295, 516, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): Unevaluated properties are not allowed ('#address-cells', '#interrupt-cells', '#size-cells', 'bus-range', 'device_type', 'interrupt-map', 'interrupt-map-mask', 'iommu-map', 'linux,pci-domain', 'num-lanes', 'pcie@0', 'perst-gpios', 'phy-names', 'phys', 'power-domains', 'ranges', 'wake-gpios' were unexpected)
from schema $id: http://devicetree.org/schemas/pci/qcom,pcie-sdx55.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:0: [0, 4294967295, 512, 1, 256] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:1:0: 4294967295 is greater than the maximum of 65535
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:1: [4294967295, 513, 1, 512, 4294967295] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:2:3: 4294967295 is greater than the maximum of 65536
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:2: [514, 1, 768, 4294967295, 515] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/pci/qcom,pcie-sdx55.example.dtb: pcie@1c00000 (qcom,pcie-sdx55): iommu-map:3: [1, 1024, 4294967295, 516, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:0: [0, 4294967295, 6468, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:1: [1, 4294967295, 6464, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:2: [1, 4294967295, 6688, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:3: [2, 4294967295, 6467, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:4: [3, 4294967295, 6470, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:5: [4, 4294967295, 6465, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:6: [4, 4294967295, 6689, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:7: [5, 4294967295, 6469, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/media/qcom,kaanapali-iris.example.dtb: video-codec@2000000 (qcom,kaanapali-iris): iommu-map:8: [6, 4294967295, 6690, 0, 1] is too long
from schema $id: http://devicetree.org/schemas/pci/pci-iommu.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/20260313-kaanapali-iris-v3-1-9c0d1a67af4b@oss.qualcomm.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 13:19 ` [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
2026-03-13 15:02 ` Dmitry Baryshkov
2026-03-13 15:34 ` Rob Herring (Arm)
@ 2026-03-13 15:43 ` Krzysztof Kozlowski
2026-03-25 15:10 ` Vikash Garodia
2 siblings, 1 reply; 24+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-13 15:43 UTC (permalink / raw)
To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Dmitry Baryshkov, Conor Dooley,
Saravana Kannan, Joerg Roedel, Will Deacon, Robin Murphy,
Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski, Vishnu Reddy,
Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue
On 13/03/2026 14:19, Vikash Garodia wrote:
> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
> compared to previous generation, iris3x, it has,
> - separate power domains for stream and pixel processing hardware blocks
> (bse and vpp).
> - additional power domain for apv codec.
> - power domains for individual pipes (VPPx).
> - different clocks and reset lines.
>
> This patch depends on
> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>
> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
If you actually implement my feedback, then you don't need to keep that
tag. The tag was given because you were pushing your solution regardless
of received review.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding
2026-03-13 15:43 ` Krzysztof Kozlowski
@ 2026-03-25 15:10 ` Vikash Garodia
0 siblings, 0 replies; 24+ messages in thread
From: Vikash Garodia @ 2026-03-25 15:10 UTC (permalink / raw)
To: Krzysztof Kozlowski, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Dmitry Baryshkov, Conor Dooley,
Saravana Kannan, Joerg Roedel, Will Deacon, Robin Murphy,
Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski, Vishnu Reddy,
Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue
On 3/13/2026 9:13 PM, Krzysztof Kozlowski wrote:
> On 13/03/2026 14:19, Vikash Garodia wrote:
>> Kaanapali SOC brings in the new generation of video IP i.e iris4. When
>> compared to previous generation, iris3x, it has,
>> - separate power domains for stream and pixel processing hardware blocks
>> (bse and vpp).
>> - additional power domain for apv codec.
>> - power domains for individual pipes (VPPx).
>> - different clocks and reset lines.
>>
>> This patch depends on
>> https://github.com/devicetree-org/dt-schema/pull/184/changes/d341298d62805bc972dfba691da6b3b62aa3ff15
>>
>> Nacked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>
> If you actually implement my feedback, then you don't need to keep that
> tag. The tag was given because you were pushing your solution regardless
> of received review.
>
Noted.
Regards,
Vikash
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
2026-03-13 13:19 ` [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:38 ` Dmitry Baryshkov
` (2 more replies)
2026-03-13 13:19 ` [PATCH v3 3/7] media: iris: add iris vpu bus support and register it with iommu_buses Vikash Garodia
` (4 subsequent siblings)
6 siblings, 3 replies; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
Currently the driver switches the vcodec GDSC to hardware (HW) mode
before firmware load and boot sequence. GDSC can be powered off, keeping
in hw mode, thereby the vcodec registers programmed in TrustZone (TZ)
carry default (reset) values.
Move the transition to HW mode after firmware load and boot sequence.
The bug was exposed with driver configuring different stream ids to
different devices via iommu-map. With registers carrying reset values,
VPU would not generate desired stream-id, thereby leading to SMMU fault.
For vpu4, when GDSC is switched to HW mode, there is a need to perform
the reset operation. Without reset, there are occassional issues of
register corruption observed. Hence the vpu GDSC switch also involves
the reset.
Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with necessary hooks")
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_core.c | 4 ++++
drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 ++++
drivers/media/platform/qcom/iris/iris_vpu2.c | 1 +
drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 +++-----
drivers/media/platform/qcom/iris/iris_vpu4x.c | 24 ++++++++++++----------
drivers/media/platform/qcom/iris/iris_vpu_common.c | 16 +++++++++------
drivers/media/platform/qcom/iris/iris_vpu_common.h | 3 +++
7 files changed, 38 insertions(+), 23 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_core.c b/drivers/media/platform/qcom/iris/iris_core.c
index 8406c48d635b6eba0879396ce9f9ae2292743f09..dbaac01eb15a0e622e85635fddd29c1f7fc18662 100644
--- a/drivers/media/platform/qcom/iris/iris_core.c
+++ b/drivers/media/platform/qcom/iris/iris_core.c
@@ -75,6 +75,10 @@ int iris_core_init(struct iris_core *core)
if (ret)
goto error_unload_fw;
+ ret = iris_vpu_switch_to_hwmode(core);
+ if (ret)
+ goto error_unload_fw;
+
ret = iris_hfi_core_init(core);
if (ret)
goto error_unload_fw;
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.c b/drivers/media/platform/qcom/iris/iris_hfi_common.c
index 92112eb16c11048e28230a2926dfb46e3163aada..621c66593d88d47ef3438c98a07cb29421c4e375 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_common.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c
@@ -159,6 +159,10 @@ int iris_hfi_pm_resume(struct iris_core *core)
if (ret)
goto err_suspend_hw;
+ ret = iris_vpu_switch_to_hwmode(core);
+ if (ret)
+ goto err_suspend_hw;
+
ret = ops->sys_interframe_powercollapse(core);
if (ret)
goto err_suspend_hw;
diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/platform/qcom/iris/iris_vpu2.c
index 9c103a2e4e4eafee101a8a9b168fdc8ca76e277d..01ef40f3895743b3784464e2d5ba2de1aeca5a4a 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu2.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu2.c
@@ -44,4 +44,5 @@ const struct vpu_ops iris_vpu2_ops = {
.power_off_controller = iris_vpu_power_off_controller,
.power_on_controller = iris_vpu_power_on_controller,
.calc_freq = iris_vpu2_calc_freq,
+ .set_hwmode = iris_vpu_set_hwmode,
};
diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/platform/qcom/iris/iris_vpu3x.c
index fe4423b951b1e9e31d06dffc69d18071cc985731..3dad47be78b58f6cd5ed6f333b3376571a04dbf0 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu3x.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c
@@ -234,14 +234,8 @@ static int iris_vpu35_power_on_hw(struct iris_core *core)
if (ret)
goto err_disable_hw_free_clk;
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN], true);
- if (ret)
- goto err_disable_hw_clk;
-
return 0;
-err_disable_hw_clk:
- iris_disable_unprepare_clock(core, IRIS_HW_CLK);
err_disable_hw_free_clk:
iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK);
err_disable_axi_clk:
@@ -266,6 +260,7 @@ const struct vpu_ops iris_vpu3_ops = {
.power_off_controller = iris_vpu_power_off_controller,
.power_on_controller = iris_vpu_power_on_controller,
.calc_freq = iris_vpu3x_vpu4x_calculate_frequency,
+ .set_hwmode = iris_vpu_set_hwmode,
};
const struct vpu_ops iris_vpu33_ops = {
@@ -274,6 +269,7 @@ const struct vpu_ops iris_vpu33_ops = {
.power_off_controller = iris_vpu33_power_off_controller,
.power_on_controller = iris_vpu_power_on_controller,
.calc_freq = iris_vpu3x_vpu4x_calculate_frequency,
+ .set_hwmode = iris_vpu_set_hwmode,
};
const struct vpu_ops iris_vpu35_ops = {
@@ -283,4 +279,5 @@ const struct vpu_ops iris_vpu35_ops = {
.power_on_controller = iris_vpu35_vpu4x_power_on_controller,
.program_bootup_registers = iris_vpu35_vpu4x_program_bootup_registers,
.calc_freq = iris_vpu3x_vpu4x_calculate_frequency,
+ .set_hwmode = iris_vpu_set_hwmode,
};
diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/platform/qcom/iris/iris_vpu4x.c
index a8db02ce5c5ec583c4027166b34ce51d3d683b4e..02e100a4045fced33d7a3545b632cc5f0955233f 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu4x.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c
@@ -252,21 +252,10 @@ static int iris_vpu4x_power_on_hardware(struct iris_core *core)
ret = iris_vpu4x_power_on_apv(core);
if (ret)
goto disable_hw_clocks;
-
- iris_vpu4x_ahb_sync_reset_apv(core);
}
- iris_vpu4x_ahb_sync_reset_hardware(core);
-
- ret = iris_vpu4x_genpd_set_hwmode(core, true, efuse_value);
- if (ret)
- goto disable_apv_power_domain;
-
return 0;
-disable_apv_power_domain:
- if (!(efuse_value & DISABLE_VIDEO_APV_BIT))
- iris_vpu4x_power_off_apv(core);
disable_hw_clocks:
iris_vpu4x_disable_hardware_clocks(core, efuse_value);
disable_vpp1_power_domain:
@@ -359,6 +348,18 @@ static void iris_vpu4x_power_off_hardware(struct iris_core *core)
iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]);
}
+static int iris_vpu4x_set_hwmode(struct iris_core *core)
+{
+ u32 efuse_value = readl(core->reg_base + WRAPPER_EFUSE_MONITOR);
+
+ if (!(efuse_value & DISABLE_VIDEO_APV_BIT))
+ iris_vpu4x_ahb_sync_reset_apv(core);
+
+ iris_vpu4x_ahb_sync_reset_hardware(core);
+
+ return iris_vpu4x_genpd_set_hwmode(core, true, efuse_value);
+}
+
const struct vpu_ops iris_vpu4x_ops = {
.power_off_hw = iris_vpu4x_power_off_hardware,
.power_on_hw = iris_vpu4x_power_on_hardware,
@@ -366,4 +367,5 @@ const struct vpu_ops iris_vpu4x_ops = {
.power_on_controller = iris_vpu35_vpu4x_power_on_controller,
.program_bootup_registers = iris_vpu35_vpu4x_program_bootup_registers,
.calc_freq = iris_vpu3x_vpu4x_calculate_frequency,
+ .set_hwmode = iris_vpu4x_set_hwmode,
};
diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/media/platform/qcom/iris/iris_vpu_common.c
index 548e5f1727fdb7543f76a1871f17257fa2360733..69e6126dc4d95ed9e5fccf596205e84ec0bfc82d 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu_common.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c
@@ -292,14 +292,8 @@ int iris_vpu_power_on_hw(struct iris_core *core)
if (ret && ret != -ENOENT)
goto err_disable_hw_clock;
- ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN], true);
- if (ret)
- goto err_disable_hw_ahb_clock;
-
return 0;
-err_disable_hw_ahb_clock:
- iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK);
err_disable_hw_clock:
iris_disable_unprepare_clock(core, IRIS_HW_CLK);
err_disable_power:
@@ -308,6 +302,16 @@ int iris_vpu_power_on_hw(struct iris_core *core)
return ret;
}
+int iris_vpu_set_hwmode(struct iris_core *core)
+{
+ return dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN], true);
+}
+
+int iris_vpu_switch_to_hwmode(struct iris_core *core)
+{
+ return core->iris_platform_data->vpu_ops->set_hwmode(core);
+}
+
int iris_vpu35_vpu4x_power_off_controller(struct iris_core *core)
{
u32 clk_rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size;
diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/media/platform/qcom/iris/iris_vpu_common.h
index f6dffc613b822341fb21e12de6b1395202f62cde..dee3b1349c5e869619c7f7c294dd711f9ff72b92 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu_common.h
+++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h
@@ -21,6 +21,7 @@ struct vpu_ops {
int (*power_on_controller)(struct iris_core *core);
void (*program_bootup_registers)(struct iris_core *core);
u64 (*calc_freq)(struct iris_inst *inst, size_t data_size);
+ int (*set_hwmode)(struct iris_core *core);
};
int iris_vpu_boot_firmware(struct iris_core *core);
@@ -30,6 +31,8 @@ int iris_vpu_watchdog(struct iris_core *core, u32 intr_status);
int iris_vpu_prepare_pc(struct iris_core *core);
int iris_vpu_power_on_controller(struct iris_core *core);
int iris_vpu_power_on_hw(struct iris_core *core);
+int iris_vpu_set_hwmode(struct iris_core *core);
+int iris_vpu_switch_to_hwmode(struct iris_core *core);
int iris_vpu_power_on(struct iris_core *core);
int iris_vpu_power_off_controller(struct iris_core *core);
void iris_vpu_power_off_hw(struct iris_core *core);
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot
2026-03-13 13:19 ` [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
@ 2026-03-13 15:38 ` Dmitry Baryshkov
2026-03-24 5:15 ` Dikshita Agarwal
2026-03-25 15:14 ` Vikash Garodia
2 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:38 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue
On Fri, Mar 13, 2026 at 06:49:36PM +0530, Vikash Garodia wrote:
> Currently the driver switches the vcodec GDSC to hardware (HW) mode
> before firmware load and boot sequence. GDSC can be powered off, keeping
> in hw mode, thereby the vcodec registers programmed in TrustZone (TZ)
> carry default (reset) values.
> Move the transition to HW mode after firmware load and boot sequence.
>
> The bug was exposed with driver configuring different stream ids to
> different devices via iommu-map. With registers carrying reset values,
> VPU would not generate desired stream-id, thereby leading to SMMU fault.
>
> For vpu4, when GDSC is switched to HW mode, there is a need to perform
> the reset operation. Without reset, there are occassional issues of
> register corruption observed. Hence the vpu GDSC switch also involves
> the reset.
>
> Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with necessary hooks")
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_core.c | 4 ++++
> drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 ++++
> drivers/media/platform/qcom/iris/iris_vpu2.c | 1 +
> drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 +++-----
> drivers/media/platform/qcom/iris/iris_vpu4x.c | 24 ++++++++++++----------
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 16 +++++++++------
> drivers/media/platform/qcom/iris/iris_vpu_common.h | 3 +++
> 7 files changed, 38 insertions(+), 23 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot
2026-03-13 13:19 ` [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
2026-03-13 15:38 ` Dmitry Baryshkov
@ 2026-03-24 5:15 ` Dikshita Agarwal
2026-03-25 15:14 ` Vikash Garodia
2 siblings, 0 replies; 24+ messages in thread
From: Dikshita Agarwal @ 2026-03-24 5:15 UTC (permalink / raw)
To: Vikash Garodia, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue
On 3/13/2026 6:49 PM, Vikash Garodia wrote:
> Currently the driver switches the vcodec GDSC to hardware (HW) mode
> before firmware load and boot sequence. GDSC can be powered off, keeping
> in hw mode, thereby the vcodec registers programmed in TrustZone (TZ)
> carry default (reset) values.
> Move the transition to HW mode after firmware load and boot sequence.
>
> The bug was exposed with driver configuring different stream ids to
> different devices via iommu-map. With registers carrying reset values,
> VPU would not generate desired stream-id, thereby leading to SMMU fault.
>
> For vpu4, when GDSC is switched to HW mode, there is a need to perform
> the reset operation. Without reset, there are occassional issues of
> register corruption observed. Hence the vpu GDSC switch also involves
> the reset.
>
> Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with necessary hooks")
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_core.c | 4 ++++
> drivers/media/platform/qcom/iris/iris_hfi_common.c | 4 ++++
> drivers/media/platform/qcom/iris/iris_vpu2.c | 1 +
> drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 +++-----
> drivers/media/platform/qcom/iris/iris_vpu4x.c | 24 ++++++++++++----------
> drivers/media/platform/qcom/iris/iris_vpu_common.c | 16 +++++++++------
> drivers/media/platform/qcom/iris/iris_vpu_common.h | 3 +++
> 7 files changed, 38 insertions(+), 23 deletions(-)
>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Thanks,
Dikshita
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot
2026-03-13 13:19 ` [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
2026-03-13 15:38 ` Dmitry Baryshkov
2026-03-24 5:15 ` Dikshita Agarwal
@ 2026-03-25 15:14 ` Vikash Garodia
2026-03-25 15:16 ` Bryan O'Donoghue
2 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-25 15:14 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue
On 3/13/2026 6:49 PM, Vikash Garodia wrote:
> Currently the driver switches the vcodec GDSC to hardware (HW) mode
> before firmware load and boot sequence. GDSC can be powered off, keeping
> in hw mode, thereby the vcodec registers programmed in TrustZone (TZ)
> carry default (reset) values.
> Move the transition to HW mode after firmware load and boot sequence.
>
> The bug was exposed with driver configuring different stream ids to
> different devices via iommu-map. With registers carrying reset values,
> VPU would not generate desired stream-id, thereby leading to SMMU fault.
>
> For vpu4, when GDSC is switched to HW mode, there is a need to perform
> the reset operation. Without reset, there are occassional issues of
> register corruption observed. Hence the vpu GDSC switch also involves
> the reset.
>
> Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with necessary hooks")
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
Hi Bryan,
Please pull this fix patch, let me know if you need me to resend this
separately.
Regards,
Vikash
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot
2026-03-25 15:14 ` Vikash Garodia
@ 2026-03-25 15:16 ` Bryan O'Donoghue
0 siblings, 0 replies; 24+ messages in thread
From: Bryan O'Donoghue @ 2026-03-25 15:16 UTC (permalink / raw)
To: Vikash Garodia, Dikshita Agarwal, Abhinav Kumar,
Bryan O'Donoghue, Mauro Carvalho Chehab, Rob Herring,
Krzysztof Kozlowski, Dmitry Baryshkov, Conor Dooley,
Saravana Kannan, Joerg Roedel, Will Deacon, Robin Murphy,
Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski, Vishnu Reddy,
Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu
On 25/03/2026 15:14, Vikash Garodia wrote:
>
> On 3/13/2026 6:49 PM, Vikash Garodia wrote:
>> Currently the driver switches the vcodec GDSC to hardware (HW) mode
>> before firmware load and boot sequence. GDSC can be powered off, keeping
>> in hw mode, thereby the vcodec registers programmed in TrustZone (TZ)
>> carry default (reset) values.
>> Move the transition to HW mode after firmware load and boot sequence.
>>
>> The bug was exposed with driver configuring different stream ids to
>> different devices via iommu-map. With registers carrying reset values,
>> VPU would not generate desired stream-id, thereby leading to SMMU fault.
>>
>> For vpu4, when GDSC is switched to HW mode, there is a need to perform
>> the reset operation. Without reset, there are occassional issues of
>> register corruption observed. Hence the vpu GDSC switch also involves
>> the reset.
>>
>> Fixes: dde659d37036 ("media: iris: Introduce vpu ops for vpu4 with
>> necessary hooks")
>> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>> ---
>
> Hi Bryan,
>
> Please pull this fix patch, let me know if you need me to resend this
> separately.
>
> Regards,
> Vikash
np
---
bod
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 3/7] media: iris: add iris vpu bus support and register it with iommu_buses
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
2026-03-13 13:19 ` [PATCH v3 1/7] media: dt-bindings: qcom-kaanapali-iris: Add kaanapali video codec binding Vikash Garodia
2026-03-13 13:19 ` [PATCH v3 2/7] media: iris: switch to hardware mode after firmware boot Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:35 ` Dmitry Baryshkov
2026-03-13 13:19 ` [PATCH v3 4/7] media: iris: add context bank devices using iommu-map Vikash Garodia
` (3 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
Add iris vpu bus support and hooks the new bus into the iommu_buses
list. Iris devices need their own bus so that they can run their own
dma_configure() logic.
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/iommu/iommu.c | 4 +++
drivers/media/platform/qcom/iris/Makefile | 4 +++
.../platform/qcom/iris/iris_platform_common.h | 6 ++++
drivers/media/platform/qcom/iris/iris_vpu_bus.c | 32 ++++++++++++++++++++++
include/linux/iris_vpu_bus.h | 13 +++++++++
5 files changed, 59 insertions(+)
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 35db5178095404fec87cd0f18e44ea97cf354e78..fd5fb7c10da22ab548d359ca1f44504acc3d646c 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -13,6 +13,7 @@
#include <linux/bug.h>
#include <linux/types.h>
#include <linux/init.h>
+#include <linux/iris_vpu_bus.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/errno.h>
@@ -178,6 +179,9 @@ static const struct bus_type * const iommu_buses[] = {
#ifdef CONFIG_CDX_BUS
&cdx_bus_type,
#endif
+#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS)
+ &iris_vpu_bus_type,
+#endif
};
/*
diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile
index 2abbd3aeb4af07e52bf372a4b2f352463529c92c..6f4052b98491aeddc299669334d4c93e9a3420e4 100644
--- a/drivers/media/platform/qcom/iris/Makefile
+++ b/drivers/media/platform/qcom/iris/Makefile
@@ -31,3 +31,7 @@ qcom-iris-objs += iris_platform_gen1.o
endif
obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o
+
+ifdef CONFIG_VIDEO_QCOM_IRIS
+obj-y += iris_vpu_bus.o
+endif
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 5a489917580eb10022fdcb52f7321a915e8b239d..2273243d1a80446233dd82dcd77444aa043ad064 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -204,6 +204,12 @@ struct icc_vote_data {
u32 fps;
};
+struct iris_context_bank {
+ char *name;
+ u32 f_id;
+ u32 region_mask;
+};
+
enum platform_pm_domain_type {
IRIS_CTRL_POWER_DOMAIN,
IRIS_HW_POWER_DOMAIN,
diff --git a/drivers/media/platform/qcom/iris/iris_vpu_bus.c b/drivers/media/platform/qcom/iris/iris_vpu_bus.c
new file mode 100644
index 0000000000000000000000000000000000000000..9e9fdeb6e405aab26ecf5e57ca91fca6b8eda2c5
--- /dev/null
+++ b/drivers/media/platform/qcom/iris/iris_vpu_bus.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include <linux/device.h>
+#include <linux/of_device.h>
+
+#include "iris_platform_common.h"
+
+static int iris_vpu_bus_dma_configure(struct device *dev)
+{
+ struct iris_context_bank *cb = dev_get_drvdata(dev);
+
+ if (!cb)
+ return -ENODEV;
+
+ return of_dma_configure_id(dev, dev->parent->of_node, true, &cb->f_id);
+}
+
+const struct bus_type iris_vpu_bus_type = {
+ .name = "iris-bus",
+ .dma_configure = iris_vpu_bus_dma_configure,
+};
+EXPORT_SYMBOL_GPL(iris_vpu_bus_type);
+
+static int __init iris_vpu_bus_init(void)
+{
+ return bus_register(&iris_vpu_bus_type);
+}
+
+postcore_initcall(iris_vpu_bus_init);
diff --git a/include/linux/iris_vpu_bus.h b/include/linux/iris_vpu_bus.h
new file mode 100644
index 0000000000000000000000000000000000000000..422898cdf2f62eb7f4583d970a01c8776dd12164
--- /dev/null
+++ b/include/linux/iris_vpu_bus.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ *
+ * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef __IRIS_VPU_BUS_H__
+#define __IRIS_VPU_BUS_H__
+
+#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS)
+extern const struct bus_type iris_vpu_bus_type;
+#endif
+
+#endif /* __IRIS_VPU_BUS_H__ */
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 3/7] media: iris: add iris vpu bus support and register it with iommu_buses
2026-03-13 13:19 ` [PATCH v3 3/7] media: iris: add iris vpu bus support and register it with iommu_buses Vikash Garodia
@ 2026-03-13 15:35 ` Dmitry Baryshkov
0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:35 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue
On Fri, Mar 13, 2026 at 06:49:37PM +0530, Vikash Garodia wrote:
> Add iris vpu bus support and hooks the new bus into the iommu_buses
> list. Iris devices need their own bus so that they can run their own
> dma_configure() logic.
>
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> drivers/iommu/iommu.c | 4 +++
> drivers/media/platform/qcom/iris/Makefile | 4 +++
> .../platform/qcom/iris/iris_platform_common.h | 6 ++++
> drivers/media/platform/qcom/iris/iris_vpu_bus.c | 32 ++++++++++++++++++++++
> include/linux/iris_vpu_bus.h | 13 +++++++++
> 5 files changed, 59 insertions(+)
>
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 35db5178095404fec87cd0f18e44ea97cf354e78..fd5fb7c10da22ab548d359ca1f44504acc3d646c 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -13,6 +13,7 @@
> #include <linux/bug.h>
> #include <linux/types.h>
> #include <linux/init.h>
> +#include <linux/iris_vpu_bus.h>
> #include <linux/export.h>
> #include <linux/slab.h>
> #include <linux/errno.h>
> @@ -178,6 +179,9 @@ static const struct bus_type * const iommu_buses[] = {
> #ifdef CONFIG_CDX_BUS
> &cdx_bus_type,
> #endif
> +#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS)
> + &iris_vpu_bus_type,
> +#endif
> };
>
> /*
> diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/platform/qcom/iris/Makefile
> index 2abbd3aeb4af07e52bf372a4b2f352463529c92c..6f4052b98491aeddc299669334d4c93e9a3420e4 100644
> --- a/drivers/media/platform/qcom/iris/Makefile
> +++ b/drivers/media/platform/qcom/iris/Makefile
> @@ -31,3 +31,7 @@ qcom-iris-objs += iris_platform_gen1.o
> endif
>
> obj-$(CONFIG_VIDEO_QCOM_IRIS) += qcom-iris.o
> +
> +ifdef CONFIG_VIDEO_QCOM_IRIS
> +obj-y += iris_vpu_bus.o
> +endif
> diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
> index 5a489917580eb10022fdcb52f7321a915e8b239d..2273243d1a80446233dd82dcd77444aa043ad064 100644
> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h
> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
> @@ -204,6 +204,12 @@ struct icc_vote_data {
> u32 fps;
> };
>
> +struct iris_context_bank {
> + char *name;
const
> + u32 f_id;
> + u32 region_mask;
Unused here
> +};
> +
> enum platform_pm_domain_type {
> IRIS_CTRL_POWER_DOMAIN,
> IRIS_HW_POWER_DOMAIN,
> diff --git a/drivers/media/platform/qcom/iris/iris_vpu_bus.c b/drivers/media/platform/qcom/iris/iris_vpu_bus.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..9e9fdeb6e405aab26ecf5e57ca91fca6b8eda2c5
> --- /dev/null
> +++ b/drivers/media/platform/qcom/iris/iris_vpu_bus.c
> @@ -0,0 +1,32 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#include <linux/device.h>
> +#include <linux/of_device.h>
> +
> +#include "iris_platform_common.h"
> +
> +static int iris_vpu_bus_dma_configure(struct device *dev)
> +{
> + struct iris_context_bank *cb = dev_get_drvdata(dev);
> +
> + if (!cb)
> + return -ENODEV;
> +
> + return of_dma_configure_id(dev, dev->parent->of_node, true, &cb->f_id);
> +}
There is nothing Iris-specific here. Can we please turn this into a
generic code (ideally also shared with host1x)?
> +
> +const struct bus_type iris_vpu_bus_type = {
> + .name = "iris-bus",
> + .dma_configure = iris_vpu_bus_dma_configure,
> +};
> +EXPORT_SYMBOL_GPL(iris_vpu_bus_type);
> +
> +static int __init iris_vpu_bus_init(void)
> +{
> + return bus_register(&iris_vpu_bus_type);
> +}
> +
> +postcore_initcall(iris_vpu_bus_init);
> diff --git a/include/linux/iris_vpu_bus.h b/include/linux/iris_vpu_bus.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..422898cdf2f62eb7f4583d970a01c8776dd12164
> --- /dev/null
> +++ b/include/linux/iris_vpu_bus.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0-only
> + *
> + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#ifndef __IRIS_VPU_BUS_H__
> +#define __IRIS_VPU_BUS_H__
> +
> +#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS)
> +extern const struct bus_type iris_vpu_bus_type;
> +#endif
> +
> +#endif /* __IRIS_VPU_BUS_H__ */
>
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 4/7] media: iris: add context bank devices using iommu-map
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
` (2 preceding siblings ...)
2026-03-13 13:19 ` [PATCH v3 3/7] media: iris: add iris vpu bus support and register it with iommu_buses Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:33 ` Dmitry Baryshkov
2026-03-13 13:19 ` [PATCH v3 5/7] media: iris: add helper to select context bank device Vikash Garodia
` (2 subsequent siblings)
6 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
Introduce different context banks(CB) and the associated buffer region.
Different stream IDs from VPU would be associated to one of these CB.
Multiple CBs are needed to increase the IOVA for the video usecases like
higher concurrent sessions.
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_core.h | 2 +
.../platform/qcom/iris/iris_platform_common.h | 14 +++++
drivers/media/platform/qcom/iris/iris_probe.c | 66 ++++++++++++++++++++--
drivers/media/platform/qcom/iris/iris_resources.c | 46 +++++++++++++++
drivers/media/platform/qcom/iris/iris_resources.h | 1 +
5 files changed, 125 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
index fb194c967ad4f9b5e00cd74f0d41e0b827ef14db..62364bd6909e9a03d223bac86962dc9094a40243 100644
--- a/drivers/media/platform/qcom/iris/iris_core.h
+++ b/drivers/media/platform/qcom/iris/iris_core.h
@@ -34,6 +34,7 @@ enum domain_type {
* struct iris_core - holds core parameters valid for all instances
*
* @dev: reference to device structure
+ * @cb_devs: array of context bank devices (eg: bitstream, non-pixel, pixel, etc)
* @reg_base: IO memory base address
* @irq: iris irq
* @v4l2_dev: a holder for v4l2 device structure
@@ -77,6 +78,7 @@ enum domain_type {
struct iris_core {
struct device *dev;
+ struct device *cb_devs[IRIS_MAX_REGION];
void __iomem *reg_base;
int irq;
struct v4l2_device v4l2_dev;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 2273243d1a80446233dd82dcd77444aa043ad064..df63a06b8401cd367c69ab8909af227f04bf69bf 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -204,6 +204,18 @@ struct icc_vote_data {
u32 fps;
};
+enum iris_buffer_region {
+ IRIS_UNKNOWN_REGION,
+ IRIS_BITSTREAM_REGION,
+ IRIS_NON_PIXEL_REGION,
+ IRIS_PIXEL_REGION,
+ IRIS_SECURE_BITSTREAM_REGION,
+ IRIS_SECURE_NON_PIXEL_REGION,
+ IRIS_SECURE_PIXEL_REGION,
+ IRIS_FIRMWARE_REGION,
+ IRIS_MAX_REGION,
+};
+
struct iris_context_bank {
char *name;
u32 f_id;
@@ -252,6 +264,8 @@ struct iris_platform_data {
u32 inst_fw_caps_enc_size;
const struct tz_cp_config *tz_cp_config_data;
u32 tz_cp_config_data_size;
+ const struct iris_context_bank *cb_data;
+ const u32 cb_data_size;
u32 core_arch;
u32 hw_response_timeout;
struct ubwc_config_data *ubwc_config;
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index ddaacda523ecb9990af0dd0640196223fbcc2cab..439e6e0fe8adf8287f81d26257ef2a7e9f21e53d 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -123,6 +123,55 @@ static int iris_init_resets(struct iris_core *core)
core->iris_platform_data->controller_rst_tbl_size);
}
+static void iris_destroy_child_device(struct iris_core *core, const struct iris_context_bank *cb)
+{
+ u32 index, region_mask = cb->region_mask;
+ struct device *dev = NULL;
+
+ while (region_mask) {
+ index = __ffs(region_mask);
+ dev = core->cb_devs[index];
+ core->cb_devs[index] = NULL;
+ region_mask &= ~BIT(index);
+ }
+
+ if (dev)
+ device_unregister(dev);
+}
+
+static void iris_deinit_context_bank_devices(struct iris_core *core)
+{
+ const struct iris_context_bank *cb;
+ int i;
+
+ for (i = 0; i < core->iris_platform_data->cb_data_size; i++) {
+ cb = &core->iris_platform_data->cb_data[i];
+ iris_destroy_child_device(core, cb);
+ }
+}
+
+static int iris_init_context_bank_devices(struct iris_core *core)
+{
+ const struct iris_context_bank *cb;
+ int ret, i;
+
+ for (i = 0; i < core->iris_platform_data->cb_data_size; i++) {
+ cb = &core->iris_platform_data->cb_data[i];
+
+ ret = iris_create_child_device_and_map(core, cb);
+ if (ret)
+ goto err_deinit_cb;
+ }
+
+ return 0;
+
+err_deinit_cb:
+ while (i-- > 0)
+ iris_destroy_child_device(core, &core->iris_platform_data->cb_data[i]);
+
+ return ret;
+}
+
static int iris_init_resources(struct iris_core *core)
{
int ret;
@@ -193,6 +242,7 @@ static void iris_remove(struct platform_device *pdev)
return;
iris_core_deinit(core);
+ iris_deinit_context_bank_devices(core);
video_unregister_device(core->vdev_dec);
video_unregister_device(core->vdev_enc);
@@ -275,12 +325,18 @@ static int iris_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, core);
- dma_mask = core->iris_platform_data->dma_mask;
-
- ret = dma_set_mask_and_coherent(dev, dma_mask);
+ ret = iris_init_context_bank_devices(core);
if (ret)
goto err_vdev_unreg_enc;
+ dma_mask = core->iris_platform_data->dma_mask;
+
+ if (device_iommu_mapped(core->dev)) {
+ ret = dma_set_mask_and_coherent(core->dev, dma_mask);
+ if (ret)
+ goto err_deinit_cb;
+ }
+
dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32));
@@ -288,10 +344,12 @@ static int iris_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(core->dev);
ret = devm_pm_runtime_enable(core->dev);
if (ret)
- goto err_vdev_unreg_enc;
+ goto err_deinit_cb;
return 0;
+err_deinit_cb:
+ iris_deinit_context_bank_devices(core);
err_vdev_unreg_enc:
video_unregister_device(core->vdev_enc);
err_vdev_unreg_dec:
diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
index 773f6548370a257b8ae7332242544266cbbd61a9..a2e648f4cdb8c63db89396d49f32bbc06d870ea5 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.c
+++ b/drivers/media/platform/qcom/iris/iris_resources.c
@@ -6,6 +6,7 @@
#include <linux/clk.h>
#include <linux/devfreq.h>
#include <linux/interconnect.h>
+#include <linux/iris_vpu_bus.h>
#include <linux/pm_domain.h>
#include <linux/pm_opp.h>
#include <linux/pm_runtime.h>
@@ -141,3 +142,48 @@ int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type
return 0;
}
+
+static void iris_device_release(struct device *dev)
+{
+ dev_set_drvdata(dev, NULL);
+ kfree(dev);
+}
+
+int iris_create_child_device_and_map(struct iris_core *core, const struct iris_context_bank *cb)
+{
+ u32 index, region_mask = cb->region_mask;
+ struct device *dev;
+ int ret;
+
+ dev = kzalloc_obj(*dev);
+ if (!dev)
+ return -ENOMEM;
+
+ dev->release = iris_device_release;
+ dev->bus = &iris_vpu_bus_type;
+ dev->parent = core->dev;
+ dev->coherent_dma_mask = core->iris_platform_data->dma_mask;
+ dev->dma_mask = &dev->coherent_dma_mask;
+
+ dev_set_name(dev, "%s", cb->name);
+ dev_set_drvdata(dev, (void *)cb);
+
+ ret = device_register(dev);
+ if (ret) {
+ put_device(dev);
+ return ret;
+ }
+
+ if (!device_iommu_mapped(dev)) {
+ device_unregister(dev);
+ return 0;
+ }
+
+ while (region_mask) {
+ index = __ffs(region_mask);
+ core->cb_devs[index] = dev;
+ region_mask &= ~BIT(index);
+ }
+
+ return 0;
+}
diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/media/platform/qcom/iris/iris_resources.h
index 6bfbd2dc6db095ec05e53c894e048285f82446c6..c573016535b87d4fd140cad967d926cc1de63382 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.h
+++ b/drivers/media/platform/qcom/iris/iris_resources.h
@@ -15,5 +15,6 @@ int iris_unset_icc_bw(struct iris_core *core);
int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw);
int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type clk_type);
int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_type clk_type);
+int iris_create_child_device_and_map(struct iris_core *core, const struct iris_context_bank *cb);
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 4/7] media: iris: add context bank devices using iommu-map
2026-03-13 13:19 ` [PATCH v3 4/7] media: iris: add context bank devices using iommu-map Vikash Garodia
@ 2026-03-13 15:33 ` Dmitry Baryshkov
0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:33 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue
On Fri, Mar 13, 2026 at 06:49:38PM +0530, Vikash Garodia wrote:
> Introduce different context banks(CB) and the associated buffer region.
> Different stream IDs from VPU would be associated to one of these CB.
> Multiple CBs are needed to increase the IOVA for the video usecases like
> higher concurrent sessions.
>
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_core.h | 2 +
> .../platform/qcom/iris/iris_platform_common.h | 14 +++++
> drivers/media/platform/qcom/iris/iris_probe.c | 66 ++++++++++++++++++++--
> drivers/media/platform/qcom/iris/iris_resources.c | 46 +++++++++++++++
> drivers/media/platform/qcom/iris/iris_resources.h | 1 +
> 5 files changed, 125 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
> index fb194c967ad4f9b5e00cd74f0d41e0b827ef14db..62364bd6909e9a03d223bac86962dc9094a40243 100644
> --- a/drivers/media/platform/qcom/iris/iris_core.h
> +++ b/drivers/media/platform/qcom/iris/iris_core.h
> @@ -34,6 +34,7 @@ enum domain_type {
> * struct iris_core - holds core parameters valid for all instances
> *
> * @dev: reference to device structure
> + * @cb_devs: array of context bank devices (eg: bitstream, non-pixel, pixel, etc)
> * @reg_base: IO memory base address
> * @irq: iris irq
> * @v4l2_dev: a holder for v4l2 device structure
> @@ -77,6 +78,7 @@ enum domain_type {
>
> struct iris_core {
> struct device *dev;
> + struct device *cb_devs[IRIS_MAX_REGION];
> void __iomem *reg_base;
> int irq;
> struct v4l2_device v4l2_dev;
> diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
> index 2273243d1a80446233dd82dcd77444aa043ad064..df63a06b8401cd367c69ab8909af227f04bf69bf 100644
> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h
> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
> @@ -204,6 +204,18 @@ struct icc_vote_data {
> u32 fps;
> };
>
> +enum iris_buffer_region {
> + IRIS_UNKNOWN_REGION,
> + IRIS_BITSTREAM_REGION,
> + IRIS_NON_PIXEL_REGION,
> + IRIS_PIXEL_REGION,
> + IRIS_SECURE_BITSTREAM_REGION,
> + IRIS_SECURE_NON_PIXEL_REGION,
> + IRIS_SECURE_PIXEL_REGION,
> + IRIS_FIRMWARE_REGION,
> + IRIS_MAX_REGION,
Why do you need this enum in addition to the DT bindings? Where are the
bindings being used?
> +};
> +
> struct iris_context_bank {
> char *name;
> u32 f_id;
> @@ -252,6 +264,8 @@ struct iris_platform_data {
> u32 inst_fw_caps_enc_size;
> const struct tz_cp_config *tz_cp_config_data;
> u32 tz_cp_config_data_size;
> + const struct iris_context_bank *cb_data;
> + const u32 cb_data_size;
> u32 core_arch;
> u32 hw_response_timeout;
> struct ubwc_config_data *ubwc_config;
> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
> index ddaacda523ecb9990af0dd0640196223fbcc2cab..439e6e0fe8adf8287f81d26257ef2a7e9f21e53d 100644
> --- a/drivers/media/platform/qcom/iris/iris_probe.c
> +++ b/drivers/media/platform/qcom/iris/iris_probe.c
> @@ -123,6 +123,55 @@ static int iris_init_resets(struct iris_core *core)
> core->iris_platform_data->controller_rst_tbl_size);
> }
>
> +static void iris_destroy_child_device(struct iris_core *core, const struct iris_context_bank *cb)
> +{
> + u32 index, region_mask = cb->region_mask;
> + struct device *dev = NULL;
> +
> + while (region_mask) {
> + index = __ffs(region_mask);
> + dev = core->cb_devs[index];
> + core->cb_devs[index] = NULL;
> + region_mask &= ~BIT(index);
> + }
> +
> + if (dev)
> + device_unregister(dev);
Which devices will be unregistered? You are setting dev in a loop, which
means that only the last one will be unregistered (and only if it is not
NULL).
> +}
> +
> +static void iris_deinit_context_bank_devices(struct iris_core *core)
> +{
> + const struct iris_context_bank *cb;
> + int i;
> +
> + for (i = 0; i < core->iris_platform_data->cb_data_size; i++) {
> + cb = &core->iris_platform_data->cb_data[i];
> + iris_destroy_child_device(core, cb);
> + }
> +}
> +
> +static int iris_init_context_bank_devices(struct iris_core *core)
> +{
> + const struct iris_context_bank *cb;
> + int ret, i;
> +
> + for (i = 0; i < core->iris_platform_data->cb_data_size; i++) {
> + cb = &core->iris_platform_data->cb_data[i];
> +
> + ret = iris_create_child_device_and_map(core, cb);
> + if (ret)
> + goto err_deinit_cb;
> + }
> +
> + return 0;
> +
> +err_deinit_cb:
> + while (i-- > 0)
> + iris_destroy_child_device(core, &core->iris_platform_data->cb_data[i]);
> +
> + return ret;
> +}
> +
> static int iris_init_resources(struct iris_core *core)
> {
> int ret;
> @@ -193,6 +242,7 @@ static void iris_remove(struct platform_device *pdev)
> return;
>
> iris_core_deinit(core);
> + iris_deinit_context_bank_devices(core);
>
> video_unregister_device(core->vdev_dec);
> video_unregister_device(core->vdev_enc);
> @@ -275,12 +325,18 @@ static int iris_probe(struct platform_device *pdev)
>
> platform_set_drvdata(pdev, core);
>
> - dma_mask = core->iris_platform_data->dma_mask;
> -
> - ret = dma_set_mask_and_coherent(dev, dma_mask);
> + ret = iris_init_context_bank_devices(core);
> if (ret)
> goto err_vdev_unreg_enc;
>
> + dma_mask = core->iris_platform_data->dma_mask;
> +
> + if (device_iommu_mapped(core->dev)) {
> + ret = dma_set_mask_and_coherent(core->dev, dma_mask);
> + if (ret)
> + goto err_deinit_cb;
> + }
> +
> dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
> dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32));
>
> @@ -288,10 +344,12 @@ static int iris_probe(struct platform_device *pdev)
> pm_runtime_use_autosuspend(core->dev);
> ret = devm_pm_runtime_enable(core->dev);
> if (ret)
> - goto err_vdev_unreg_enc;
> + goto err_deinit_cb;
>
> return 0;
>
> +err_deinit_cb:
> + iris_deinit_context_bank_devices(core);
> err_vdev_unreg_enc:
> video_unregister_device(core->vdev_enc);
> err_vdev_unreg_dec:
> diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
> index 773f6548370a257b8ae7332242544266cbbd61a9..a2e648f4cdb8c63db89396d49f32bbc06d870ea5 100644
> --- a/drivers/media/platform/qcom/iris/iris_resources.c
> +++ b/drivers/media/platform/qcom/iris/iris_resources.c
> @@ -6,6 +6,7 @@
> #include <linux/clk.h>
> #include <linux/devfreq.h>
> #include <linux/interconnect.h>
> +#include <linux/iris_vpu_bus.h>
> #include <linux/pm_domain.h>
> #include <linux/pm_opp.h>
> #include <linux/pm_runtime.h>
> @@ -141,3 +142,48 @@ int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type
>
> return 0;
> }
> +
> +static void iris_device_release(struct device *dev)
> +{
> + dev_set_drvdata(dev, NULL);
There is no need to clean this pointer.
> + kfree(dev);
> +}
> +
> +int iris_create_child_device_and_map(struct iris_core *core, const struct iris_context_bank *cb)
> +{
> + u32 index, region_mask = cb->region_mask;
> + struct device *dev;
> + int ret;
> +
> + dev = kzalloc_obj(*dev);
> + if (!dev)
> + return -ENOMEM;
> +
> + dev->release = iris_device_release;
> + dev->bus = &iris_vpu_bus_type;
> + dev->parent = core->dev;
> + dev->coherent_dma_mask = core->iris_platform_data->dma_mask;
> + dev->dma_mask = &dev->coherent_dma_mask;
> +
> + dev_set_name(dev, "%s", cb->name);
> + dev_set_drvdata(dev, (void *)cb);
> +
> + ret = device_register(dev);
> + if (ret) {
> + put_device(dev);
> + return ret;
> + }
> +
> + if (!device_iommu_mapped(dev)) {
> + device_unregister(dev);
> + return 0;
> + }
> +
> + while (region_mask) {
> + index = __ffs(region_mask);
> + core->cb_devs[index] = dev;
This needs to have some explanation how region masks work with the
device types.
> + region_mask &= ~BIT(index);
> + }
> +
> + return 0;
> +}
> diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/media/platform/qcom/iris/iris_resources.h
> index 6bfbd2dc6db095ec05e53c894e048285f82446c6..c573016535b87d4fd140cad967d926cc1de63382 100644
> --- a/drivers/media/platform/qcom/iris/iris_resources.h
> +++ b/drivers/media/platform/qcom/iris/iris_resources.h
> @@ -15,5 +15,6 @@ int iris_unset_icc_bw(struct iris_core *core);
> int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw);
> int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type clk_type);
> int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_type clk_type);
> +int iris_create_child_device_and_map(struct iris_core *core, const struct iris_context_bank *cb);
>
> #endif
>
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 5/7] media: iris: add helper to select context bank device
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
` (3 preceding siblings ...)
2026-03-13 13:19 ` [PATCH v3 4/7] media: iris: add context bank devices using iommu-map Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:41 ` Dmitry Baryshkov
2026-03-13 13:19 ` [PATCH v3 6/7] media: iris: add iris4 specific H265 line buffer calculation Vikash Garodia
2026-03-13 13:19 ` [PATCH v3 7/7] media: iris: add platform data for kaanapali Vikash Garodia
6 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
Depending on the buffer type (input, output, internal and interface
queues), associated context bank is selected, if available. Fallback to
parent device for backward compatibility.
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_buffer.c | 7 ++--
drivers/media/platform/qcom/iris/iris_hfi_queue.c | 16 +++++----
drivers/media/platform/qcom/iris/iris_resources.c | 41 +++++++++++++++++++++++
drivers/media/platform/qcom/iris/iris_resources.h | 2 ++
drivers/media/platform/qcom/iris/iris_vidc.c | 4 +--
5 files changed, 58 insertions(+), 12 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index 9151f43bc6b9c2c34c803de4231d1e6de0bec6c4..a016eaa4e02fe78aeefd97cc3cff51aec25778ff 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -335,8 +335,8 @@ void iris_get_internal_buffers(struct iris_inst *inst, u32 plane)
static int iris_create_internal_buffer(struct iris_inst *inst,
enum iris_buffer_type buffer_type, u32 index)
{
+ struct device *dev = iris_get_cb_dev(inst->core, iris_get_region(inst, buffer_type));
struct iris_buffers *buffers = &inst->buffers[buffer_type];
- struct iris_core *core = inst->core;
struct iris_buffer *buffer;
if (!buffers->size)
@@ -352,7 +352,7 @@ static int iris_create_internal_buffer(struct iris_inst *inst,
buffer->buffer_size = buffers->size;
buffer->dma_attrs = DMA_ATTR_WRITE_COMBINE | DMA_ATTR_NO_KERNEL_MAPPING;
- buffer->kvaddr = dma_alloc_attrs(core->dev, buffer->buffer_size,
+ buffer->kvaddr = dma_alloc_attrs(dev, buffer->buffer_size,
&buffer->device_addr, GFP_KERNEL, buffer->dma_attrs);
if (!buffer->kvaddr) {
kfree(buffer);
@@ -490,9 +490,10 @@ int iris_queue_internal_buffers(struct iris_inst *inst, u32 plane)
int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buffer)
{
struct iris_core *core = inst->core;
+ struct device *dev = iris_get_cb_dev(core, iris_get_region(inst, buffer->type));
list_del(&buffer->list);
- dma_free_attrs(core->dev, buffer->buffer_size, buffer->kvaddr,
+ dma_free_attrs(dev, buffer->buffer_size, buffer->kvaddr,
buffer->device_addr, buffer->dma_attrs);
kfree(buffer);
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
index b3ed06297953b902d5ea6c452385a88d5431ac66..b8179b2c0ee9d13ff4294922d74767825069683b 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c
@@ -245,25 +245,26 @@ static void iris_hfi_queue_deinit(struct iris_iface_q_info *iface_q)
int iris_hfi_queues_init(struct iris_core *core)
{
+ struct device *dev = iris_get_cb_dev(core, IRIS_NON_PIXEL_REGION);
struct iris_hfi_queue_table_header *q_tbl_hdr;
u32 queue_size;
/* Iris hardware requires 4K queue alignment */
queue_size = ALIGN((sizeof(*q_tbl_hdr) + (IFACEQ_QUEUE_SIZE * IFACEQ_NUMQ)), SZ_4K);
- core->iface_q_table_vaddr = dma_alloc_attrs(core->dev, queue_size,
+ core->iface_q_table_vaddr = dma_alloc_attrs(dev, queue_size,
&core->iface_q_table_daddr,
GFP_KERNEL, DMA_ATTR_WRITE_COMBINE);
if (!core->iface_q_table_vaddr) {
- dev_err(core->dev, "queues alloc and map failed\n");
+ dev_err(dev, "queues alloc and map failed\n");
return -ENOMEM;
}
- core->sfr_vaddr = dma_alloc_attrs(core->dev, SFR_SIZE,
+ core->sfr_vaddr = dma_alloc_attrs(dev, SFR_SIZE,
&core->sfr_daddr,
GFP_KERNEL, DMA_ATTR_WRITE_COMBINE);
if (!core->sfr_vaddr) {
- dev_err(core->dev, "sfr alloc and map failed\n");
- dma_free_attrs(core->dev, sizeof(*q_tbl_hdr), core->iface_q_table_vaddr,
+ dev_err(dev, "sfr alloc and map failed\n");
+ dma_free_attrs(dev, sizeof(*q_tbl_hdr), core->iface_q_table_vaddr,
core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE);
return -ENOMEM;
}
@@ -291,6 +292,7 @@ int iris_hfi_queues_init(struct iris_core *core)
void iris_hfi_queues_deinit(struct iris_core *core)
{
+ struct device *dev = iris_get_cb_dev(core, IRIS_NON_PIXEL_REGION);
u32 queue_size;
if (!core->iface_q_table_vaddr)
@@ -300,7 +302,7 @@ void iris_hfi_queues_deinit(struct iris_core *core)
iris_hfi_queue_deinit(&core->message_queue);
iris_hfi_queue_deinit(&core->command_queue);
- dma_free_attrs(core->dev, SFR_SIZE, core->sfr_vaddr,
+ dma_free_attrs(dev, SFR_SIZE, core->sfr_vaddr,
core->sfr_daddr, DMA_ATTR_WRITE_COMBINE);
core->sfr_vaddr = NULL;
@@ -309,7 +311,7 @@ void iris_hfi_queues_deinit(struct iris_core *core)
queue_size = ALIGN(sizeof(struct iris_hfi_queue_table_header) +
(IFACEQ_QUEUE_SIZE * IFACEQ_NUMQ), SZ_4K);
- dma_free_attrs(core->dev, queue_size, core->iface_q_table_vaddr,
+ dma_free_attrs(dev, queue_size, core->iface_q_table_vaddr,
core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE);
core->iface_q_table_vaddr = NULL;
diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/media/platform/qcom/iris/iris_resources.c
index a2e648f4cdb8c63db89396d49f32bbc06d870ea5..9a896271c21187ecda25be86c1abd2e905e32d8a 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.c
+++ b/drivers/media/platform/qcom/iris/iris_resources.c
@@ -13,6 +13,7 @@
#include <linux/reset.h>
#include "iris_core.h"
+#include "iris_instance.h"
#include "iris_resources.h"
#define BW_THRESHOLD 50000
@@ -187,3 +188,43 @@ int iris_create_child_device_and_map(struct iris_core *core, const struct iris_c
return 0;
}
+
+enum iris_buffer_region iris_get_region(struct iris_inst *inst, enum iris_buffer_type buffer_type)
+{
+ switch (buffer_type) {
+ case BUF_INPUT:
+ if (inst->domain == ENCODER)
+ return IRIS_PIXEL_REGION;
+ else
+ return IRIS_BITSTREAM_REGION;
+ case BUF_OUTPUT:
+ if (inst->domain == ENCODER)
+ return IRIS_BITSTREAM_REGION;
+ else
+ return IRIS_PIXEL_REGION;
+ case BUF_BIN:
+ return IRIS_BITSTREAM_REGION;
+ case BUF_DPB:
+ case BUF_PARTIAL:
+ case BUF_SCRATCH_2:
+ case BUF_VPSS:
+ return IRIS_PIXEL_REGION;
+ case BUF_ARP:
+ case BUF_COMV:
+ case BUF_LINE:
+ case BUF_NON_COMV:
+ case BUF_PERSIST:
+ return IRIS_NON_PIXEL_REGION;
+ default:
+ dev_err(inst->core->dev, "unknown buffer type: %d\n", buffer_type);
+ return IRIS_UNKNOWN_REGION;
+ }
+}
+
+struct device *iris_get_cb_dev(struct iris_core *core, enum iris_buffer_region region)
+{
+ if (core->cb_devs[region])
+ return core->cb_devs[region];
+
+ return core->dev;
+}
diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/media/platform/qcom/iris/iris_resources.h
index c573016535b87d4fd140cad967d926cc1de63382..2d0447309ca4e7833db2fa57ef8fc3758e9802a9 100644
--- a/drivers/media/platform/qcom/iris/iris_resources.h
+++ b/drivers/media/platform/qcom/iris/iris_resources.h
@@ -16,5 +16,7 @@ int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw);
int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk_type clk_type);
int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_type clk_type);
int iris_create_child_device_and_map(struct iris_core *core, const struct iris_context_bank *cb);
+enum iris_buffer_region iris_get_region(struct iris_inst *inst, enum iris_buffer_type buffer_type);
+struct device *iris_get_cb_dev(struct iris_core *core, enum iris_buffer_region buffer_type);
#endif
diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
index bd38d84c9cc79d15585ed5dd5f905a37521cb6dc..40744d487fbf1520c5e359d536cddb1c5ab0a706 100644
--- a/drivers/media/platform/qcom/iris/iris_vidc.c
+++ b/drivers/media/platform/qcom/iris/iris_vidc.c
@@ -107,7 +107,7 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_
src_vq->drv_priv = inst;
src_vq->buf_struct_size = sizeof(struct iris_buffer);
src_vq->min_reqbufs_allocation = MIN_BUFFERS;
- src_vq->dev = inst->core->dev;
+ src_vq->dev = iris_get_cb_dev(inst->core, iris_get_region(inst, BUF_INPUT));
src_vq->lock = &inst->ctx_q_lock;
ret = vb2_queue_init(src_vq);
if (ret)
@@ -121,7 +121,7 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_
dst_vq->drv_priv = inst;
dst_vq->buf_struct_size = sizeof(struct iris_buffer);
dst_vq->min_reqbufs_allocation = MIN_BUFFERS;
- dst_vq->dev = inst->core->dev;
+ dst_vq->dev = iris_get_cb_dev(inst->core, iris_get_region(inst, BUF_OUTPUT));
dst_vq->lock = &inst->ctx_q_lock;
return vb2_queue_init(dst_vq);
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 5/7] media: iris: add helper to select context bank device
2026-03-13 13:19 ` [PATCH v3 5/7] media: iris: add helper to select context bank device Vikash Garodia
@ 2026-03-13 15:41 ` Dmitry Baryshkov
0 siblings, 0 replies; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:41 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue
On Fri, Mar 13, 2026 at 06:49:39PM +0530, Vikash Garodia wrote:
> Depending on the buffer type (input, output, internal and interface
> queues), associated context bank is selected, if available. Fallback to
> parent device for backward compatibility.
>
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/iris_buffer.c | 7 ++--
> drivers/media/platform/qcom/iris/iris_hfi_queue.c | 16 +++++----
> drivers/media/platform/qcom/iris/iris_resources.c | 41 +++++++++++++++++++++++
> drivers/media/platform/qcom/iris/iris_resources.h | 2 ++
> drivers/media/platform/qcom/iris/iris_vidc.c | 4 +--
> 5 files changed, 58 insertions(+), 12 deletions(-)
>
> @@ -187,3 +188,43 @@ int iris_create_child_device_and_map(struct iris_core *core, const struct iris_c
>
> return 0;
> }
> +
> +enum iris_buffer_region iris_get_region(struct iris_inst *inst, enum iris_buffer_type buffer_type)
> +{
> + switch (buffer_type) {
> + case BUF_INPUT:
> + if (inst->domain == ENCODER)
> + return IRIS_PIXEL_REGION;
> + else
> + return IRIS_BITSTREAM_REGION;
> + case BUF_OUTPUT:
> + if (inst->domain == ENCODER)
> + return IRIS_BITSTREAM_REGION;
> + else
> + return IRIS_PIXEL_REGION;
> + case BUF_BIN:
> + return IRIS_BITSTREAM_REGION;
> + case BUF_DPB:
> + case BUF_PARTIAL:
> + case BUF_SCRATCH_2:
> + case BUF_VPSS:
> + return IRIS_PIXEL_REGION;
> + case BUF_ARP:
> + case BUF_COMV:
> + case BUF_LINE:
> + case BUF_NON_COMV:
> + case BUF_PERSIST:
> + return IRIS_NON_PIXEL_REGION;
> + default:
> + dev_err(inst->core->dev, "unknown buffer type: %d\n", buffer_type);
> + return IRIS_UNKNOWN_REGION;
> + }
> +}
> +
> +struct device *iris_get_cb_dev(struct iris_core *core, enum iris_buffer_region region)
Are you going to call these two functions separately? If not, it's
easier to squash them.
> +{
> + if (core->cb_devs[region])
> + return core->cb_devs[region];
> +
> + return core->dev;
> +}
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH v3 6/7] media: iris: add iris4 specific H265 line buffer calculation
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
` (4 preceding siblings ...)
2026-03-13 13:19 ` [PATCH v3 5/7] media: iris: add helper to select context bank device Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 13:19 ` [PATCH v3 7/7] media: iris: add platform data for kaanapali Vikash Garodia
6 siblings, 0 replies; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
The H265 decoder line buffer size calculation for iris4 (VPU4) was
previously reusing the iris3 formula. While this works for most
resolutions, certain configurations require a larger buffer size on
iris4, causing firmware errors during decode. This resolves firmware
failures seen with specific test vectors on kaanapali (iris4), and fixes
the following failing fluster tests
- PICSIZE_C_Bossen_1
- WPP_E_ericsson_MAIN_2
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_vpu_buffer.c | 51 +++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
index 9270422c16019ba658ee8813940cb9110ad030a1..a4d599c49ce9052b609b9cedf65f669ba78b5407 100644
--- a/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_vpu_buffer.c
@@ -1755,6 +1755,55 @@ static u32 hfi_vpu4x_buffer_line_vp9d(u32 frame_width, u32 frame_height, u32 _yu
return lb_size + dpb_obp_size;
}
+static u32 hfi_vpu4x_buffer_line_h265d(u32 frame_width, u32 frame_height, bool is_opb,
+ u32 num_vpp_pipes)
+{
+ u32 num_lcu_per_pipe, fe_left_lb, se_left_lb, vsp_left_lb, top_lb, qp_size,
+ dpb_obp = 0, lcu_size = 16;
+
+ num_lcu_per_pipe = (DIV_ROUND_UP(frame_height, lcu_size) / num_vpp_pipes) +
+ (DIV_ROUND_UP(frame_height, lcu_size) % num_vpp_pipes);
+
+ fe_left_lb = ALIGN((DMA_ALIGNMENT * num_lcu_per_pipe), DMA_ALIGNMENT) *
+ FE_LFT_CTRL_LINE_NUMBERS;
+ fe_left_lb += ALIGN((DMA_ALIGNMENT * 2 * num_lcu_per_pipe), DMA_ALIGNMENT) *
+ FE_LFT_DB_DATA_LINE_NUMBERS;
+ fe_left_lb += ALIGN((DMA_ALIGNMENT * num_lcu_per_pipe), DMA_ALIGNMENT);
+ fe_left_lb += ALIGN((DMA_ALIGNMENT * 2 * num_lcu_per_pipe), DMA_ALIGNMENT);
+ fe_left_lb += ALIGN((DMA_ALIGNMENT * 8 * num_lcu_per_pipe), DMA_ALIGNMENT) *
+ FE_LFT_LR_DATA_LINE_NUMBERS;
+
+ if (is_opb)
+ dpb_obp = size_dpb_opb(frame_height, lcu_size) * num_vpp_pipes;
+
+ se_left_lb = max_t(u32, (ALIGN(frame_height, BUFFER_ALIGNMENT_16_BYTES) >> 3) *
+ MAX_SE_NBR_CTRL_LCU16_LINE_BUFFER_SIZE,
+ max_t(u32, (ALIGN(frame_height, BUFFER_ALIGNMENT_32_BYTES) >> 3) *
+ MAX_SE_NBR_CTRL_LCU32_LINE_BUFFER_SIZE,
+ (ALIGN(frame_height, BUFFER_ALIGNMENT_64_BYTES) >> 3) *
+ MAX_SE_NBR_CTRL_LCU64_LINE_BUFFER_SIZE));
+
+ vsp_left_lb = ALIGN(DIV_ROUND_UP(frame_height, BUFFER_ALIGNMENT_64_BYTES) *
+ H265_NUM_TILE_ROW, DMA_ALIGNMENT);
+
+ top_lb = ALIGN((DMA_ALIGNMENT * DIV_ROUND_UP(frame_width, lcu_size)), DMA_ALIGNMENT) *
+ FE_TOP_CTRL_LINE_NUMBERS;
+ top_lb += ALIGN(DMA_ALIGNMENT * 2 * DIV_ROUND_UP(frame_width, lcu_size), DMA_ALIGNMENT) *
+ FE_TOP_DATA_LUMA_LINE_NUMBERS;
+ top_lb += ALIGN(DMA_ALIGNMENT * 2 * (DIV_ROUND_UP(frame_width, lcu_size) + 1),
+ DMA_ALIGNMENT) * FE_TOP_DATA_CHROMA_LINE_NUMBERS;
+ top_lb += ALIGN(ALIGN(frame_width, BUFFER_ALIGNMENT_64_BYTES) * 2, DMA_ALIGNMENT);
+ top_lb += ALIGN(ALIGN(frame_width, BUFFER_ALIGNMENT_64_BYTES) * 6, DMA_ALIGNMENT);
+ top_lb += size_h265d_lb_vsp_top(frame_width, frame_height);
+
+ qp_size = size_h265d_qp(frame_width, frame_height);
+
+ return ((ALIGN(dpb_obp, DMA_ALIGNMENT) + ALIGN(se_left_lb, DMA_ALIGNMENT) +
+ ALIGN(vsp_left_lb, DMA_ALIGNMENT)) * num_vpp_pipes) +
+ ALIGN(fe_left_lb, DMA_ALIGNMENT) + ALIGN(top_lb, DMA_ALIGNMENT) +
+ ALIGN(qp_size, DMA_ALIGNMENT);
+}
+
static u32 iris_vpu4x_dec_line_size(struct iris_inst *inst)
{
u32 num_vpp_pipes = inst->core->iris_platform_data->num_vpp_pipe;
@@ -1770,7 +1819,7 @@ static u32 iris_vpu4x_dec_line_size(struct iris_inst *inst)
if (inst->codec == V4L2_PIX_FMT_H264)
return hfi_buffer_line_h264d(width, height, is_opb, num_vpp_pipes);
else if (inst->codec == V4L2_PIX_FMT_HEVC)
- return hfi_buffer_line_h265d(width, height, is_opb, num_vpp_pipes);
+ return hfi_vpu4x_buffer_line_h265d(width, height, is_opb, num_vpp_pipes);
else if (inst->codec == V4L2_PIX_FMT_VP9)
return hfi_vpu4x_buffer_line_vp9d(width, height, out_min_count, is_opb,
num_vpp_pipes);
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH v3 7/7] media: iris: add platform data for kaanapali
2026-03-13 13:19 [PATCH v3 0/7] media: iris: add support for kaanapali platform Vikash Garodia
` (5 preceding siblings ...)
2026-03-13 13:19 ` [PATCH v3 6/7] media: iris: add iris4 specific H265 line buffer calculation Vikash Garodia
@ 2026-03-13 13:19 ` Vikash Garodia
2026-03-13 15:46 ` Dmitry Baryshkov
6 siblings, 1 reply; 24+ messages in thread
From: Vikash Garodia @ 2026-03-13 13:19 UTC (permalink / raw)
To: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Dmitry Baryshkov, Conor Dooley, Saravana Kannan, Joerg Roedel,
Will Deacon, Robin Murphy, Stefan Schmidt, Hans Verkuil,
Krzysztof Kozlowski, Vishnu Reddy, Hans Verkuil
Cc: linux-arm-msm, linux-media, devicetree, linux-kernel, iommu,
Bryan O'Donoghue, Vikash Garodia
Add support for the kaanapali platform by re-using the SM8550
definitions and using the vpu4 ops.
Move the configurations that differs in a per-SoC platform header, that
will contain SoC specific data.
Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
---
.../platform/qcom/iris/iris_platform_common.h | 1 +
.../media/platform/qcom/iris/iris_platform_gen2.c | 90 ++++++++++++++++++++++
.../platform/qcom/iris/iris_platform_kaanapali.h | 83 ++++++++++++++++++++
drivers/media/platform/qcom/iris/iris_probe.c | 4 +
4 files changed, 178 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index df63a06b8401cd367c69ab8909af227f04bf69bf..d97e3fb18c3636abbbca3c2086c5263efeca3db5 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -41,6 +41,7 @@ enum pipe_type {
PIPE_4 = 4,
};
+extern const struct iris_platform_data kaanapali_data;
extern const struct iris_platform_data qcs8300_data;
extern const struct iris_platform_data sc7280_data;
extern const struct iris_platform_data sm8250_data;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 5da90d47f9c6eab4a7e6b17841fdc0e599397bf7..df906f6b9fcd80100872a12815036a3aad9e925b 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -12,6 +12,7 @@
#include "iris_vpu_buffer.h"
#include "iris_vpu_common.h"
+#include "iris_platform_kaanapali.h"
#include "iris_platform_qcs8300.h"
#include "iris_platform_sm8650.h"
#include "iris_platform_sm8750.h"
@@ -921,6 +922,95 @@ static const u32 sm8550_enc_op_int_buf_tbl[] = {
BUF_SCRATCH_2,
};
+const struct iris_platform_data kaanapali_data = {
+ .get_instance = iris_hfi_gen2_get_instance,
+ .init_hfi_command_ops = iris_hfi_gen2_command_ops_init,
+ .init_hfi_response_ops = iris_hfi_gen2_response_ops_init,
+ .get_vpu_buffer_size = iris_vpu4x_buf_size,
+ .vpu_ops = &iris_vpu4x_ops,
+ .set_preset_registers = iris_set_sm8550_preset_registers,
+ .icc_tbl = sm8550_icc_table,
+ .icc_tbl_size = ARRAY_SIZE(sm8550_icc_table),
+ .clk_rst_tbl = kaanapali_clk_reset_table,
+ .clk_rst_tbl_size = ARRAY_SIZE(kaanapali_clk_reset_table),
+ .bw_tbl_dec = sm8550_bw_table_dec,
+ .bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
+ .pmdomain_tbl = kaanapali_pmdomain_table,
+ .pmdomain_tbl_size = ARRAY_SIZE(kaanapali_pmdomain_table),
+ .opp_pd_tbl = sm8550_opp_pd_table,
+ .opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
+ .clk_tbl = kaanapali_clk_table,
+ .clk_tbl_size = ARRAY_SIZE(kaanapali_clk_table),
+ .opp_clk_tbl = kaanapali_opp_clk_table,
+ /* Upper bound of DMA address range */
+ .dma_mask = 0xffc00000 - 1,
+ .fwname = "qcom/vpu/vpu40_p2_s7.mbn",
+ .pas_id = IRIS_PAS_ID,
+ .inst_iris_fmts = platform_fmts_sm8550_dec,
+ .inst_iris_fmts_size = ARRAY_SIZE(platform_fmts_sm8550_dec),
+ .inst_caps = &platform_inst_cap_sm8550,
+ .inst_fw_caps_dec = inst_fw_cap_sm8550_dec,
+ .inst_fw_caps_dec_size = ARRAY_SIZE(inst_fw_cap_sm8550_dec),
+ .inst_fw_caps_enc = inst_fw_cap_sm8550_enc,
+ .inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8550_enc),
+ .tz_cp_config_data = tz_cp_config_kaanapali,
+ .tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_kaanapali),
+ .cb_data = kaanapali_cb_data,
+ .cb_data_size = ARRAY_SIZE(kaanapali_cb_data),
+ .core_arch = VIDEO_ARCH_LX,
+ .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
+ .ubwc_config = &ubwc_config_sm8550,
+ .num_vpp_pipe = 2,
+ .max_session_count = 16,
+ .max_core_mbpf = NUM_MBS_8K * 2,
+ .max_core_mbps = ((8192 * 4320) / 256) * 60,
+ .dec_input_config_params_default =
+ sm8550_vdec_input_config_params_default,
+ .dec_input_config_params_default_size =
+ ARRAY_SIZE(sm8550_vdec_input_config_params_default),
+ .dec_input_config_params_hevc =
+ sm8550_vdec_input_config_param_hevc,
+ .dec_input_config_params_hevc_size =
+ ARRAY_SIZE(sm8550_vdec_input_config_param_hevc),
+ .dec_input_config_params_vp9 =
+ sm8550_vdec_input_config_param_vp9,
+ .dec_input_config_params_vp9_size =
+ ARRAY_SIZE(sm8550_vdec_input_config_param_vp9),
+ .dec_output_config_params =
+ sm8550_vdec_output_config_params,
+ .dec_output_config_params_size =
+ ARRAY_SIZE(sm8550_vdec_output_config_params),
+
+ .enc_input_config_params =
+ sm8550_venc_input_config_params,
+ .enc_input_config_params_size =
+ ARRAY_SIZE(sm8550_venc_input_config_params),
+ .enc_output_config_params =
+ sm8550_venc_output_config_params,
+ .enc_output_config_params_size =
+ ARRAY_SIZE(sm8550_venc_output_config_params),
+
+ .dec_input_prop = sm8550_vdec_subscribe_input_properties,
+ .dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties),
+ .dec_output_prop_avc = sm8550_vdec_subscribe_output_properties_avc,
+ .dec_output_prop_avc_size =
+ ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_avc),
+ .dec_output_prop_hevc = sm8550_vdec_subscribe_output_properties_hevc,
+ .dec_output_prop_hevc_size =
+ ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_hevc),
+ .dec_output_prop_vp9 = sm8550_vdec_subscribe_output_properties_vp9,
+ .dec_output_prop_vp9_size =
+ ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9),
+
+ .dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl,
+ .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl),
+ .dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl,
+ .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl),
+
+ .enc_op_int_buf_tbl = sm8550_enc_op_int_buf_tbl,
+ .enc_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_enc_op_int_buf_tbl),
+};
+
const struct iris_platform_data sm8550_data = {
.get_instance = iris_hfi_gen2_get_instance,
.init_hfi_command_ops = iris_hfi_gen2_command_ops_init,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
new file mode 100644
index 0000000000000000000000000000000000000000..bdca1e5bf673353862c1554fb0420f73b3f519cb
--- /dev/null
+++ b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
@@ -0,0 +1,83 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#ifndef __IRIS_PLATFORM_KAANAPALI_H__
+#define __IRIS_PLATFORM_KAANAPALI_H__
+
+#include <dt-bindings/media/qcom,kaanapali-iris.h>
+
+#define VIDEO_REGION_VM0_SECURE_NP_ID 1
+#define VIDEO_REGION_VM0_NONSECURE_NP_ID 5
+
+static const char *const kaanapali_clk_reset_table[] = {
+ "bus0",
+ "bus1",
+ "core",
+ "vcodec0_core",
+};
+
+static const char *const kaanapali_pmdomain_table[] = {
+ "venus",
+ "vcodec0",
+ "vpp0",
+ "vpp1",
+ "apv",
+};
+
+static const struct platform_clk_data kaanapali_clk_table[] = {
+ { IRIS_AXI_CLK, "iface" },
+ { IRIS_CTRL_CLK, "core" },
+ { IRIS_HW_CLK, "vcodec0_core" },
+ { IRIS_AXI1_CLK, "iface1" },
+ { IRIS_CTRL_FREERUN_CLK, "core_freerun" },
+ { IRIS_HW_FREERUN_CLK, "vcodec0_core_freerun" },
+ { IRIS_BSE_HW_CLK, "vcodec_bse" },
+ { IRIS_VPP0_HW_CLK, "vcodec_vpp0" },
+ { IRIS_VPP1_HW_CLK, "vcodec_vpp1" },
+ { IRIS_APV_HW_CLK, "vcodec_apv" },
+};
+
+static const char *const kaanapali_opp_clk_table[] = {
+ "vcodec0_core",
+ "vcodec_apv",
+ "vcodec_bse",
+ "core",
+ NULL,
+};
+
+static struct tz_cp_config tz_cp_config_kaanapali[] = {
+ {
+ .cp_start = VIDEO_REGION_VM0_SECURE_NP_ID,
+ .cp_size = 0,
+ .cp_nonpixel_start = 0x01000000,
+ .cp_nonpixel_size = 0x24800000,
+ },
+ {
+ .cp_start = VIDEO_REGION_VM0_NONSECURE_NP_ID,
+ .cp_size = 0,
+ .cp_nonpixel_start = 0x25800000,
+ .cp_nonpixel_size = 0xda400000,
+ },
+};
+
+static struct iris_context_bank kaanapali_cb_data[] = {
+ {
+ .name = "iris_bitstream",
+ .f_id = IRIS_BITSTREAM,
+ .region_mask = BIT(IRIS_BITSTREAM_REGION),
+ },
+ {
+ .name = "iris_non_pixel",
+ .f_id = IRIS_NON_PIXEL,
+ .region_mask = BIT(IRIS_NON_PIXEL_REGION),
+ },
+ {
+ .name = "iris_pixel",
+ .f_id = IRIS_PIXEL,
+ .region_mask = BIT(IRIS_PIXEL_REGION),
+ },
+};
+
+#endif /* __IRIS_PLATFORM_KAANAPALI_H__ */
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index 439e6e0fe8adf8287f81d26257ef2a7e9f21e53d..f6d8761daf0471d3aabec21c708445ee7698487b 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -406,6 +406,10 @@ static const struct dev_pm_ops iris_pm_ops = {
};
static const struct of_device_id iris_dt_match[] = {
+ {
+ .compatible = "qcom,kaanapali-iris",
+ .data = &kaanapali_data,
+ },
{
.compatible = "qcom,qcs8300-iris",
.data = &qcs8300_data,
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH v3 7/7] media: iris: add platform data for kaanapali
2026-03-13 13:19 ` [PATCH v3 7/7] media: iris: add platform data for kaanapali Vikash Garodia
@ 2026-03-13 15:46 ` Dmitry Baryshkov
2026-03-13 15:55 ` Krzysztof Kozlowski
0 siblings, 1 reply; 24+ messages in thread
From: Dmitry Baryshkov @ 2026-03-13 15:46 UTC (permalink / raw)
To: Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Krzysztof Kozlowski,
Vishnu Reddy, Hans Verkuil, linux-arm-msm, linux-media,
devicetree, linux-kernel, iommu, Bryan O'Donoghue
On Fri, Mar 13, 2026 at 06:49:41PM +0530, Vikash Garodia wrote:
> Add support for the kaanapali platform by re-using the SM8550
> definitions and using the vpu4 ops.
> Move the configurations that differs in a per-SoC platform header, that
> will contain SoC specific data.
>
> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
> ---
> .../platform/qcom/iris/iris_platform_common.h | 1 +
> .../media/platform/qcom/iris/iris_platform_gen2.c | 90 ++++++++++++++++++++++
> .../platform/qcom/iris/iris_platform_kaanapali.h | 83 ++++++++++++++++++++
> drivers/media/platform/qcom/iris/iris_probe.c | 4 +
> 4 files changed, 178 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..bdca1e5bf673353862c1554fb0420f73b3f519cb
> --- /dev/null
> +++ b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
> @@ -0,0 +1,83 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
> + */
> +
> +#ifndef __IRIS_PLATFORM_KAANAPALI_H__
> +#define __IRIS_PLATFORM_KAANAPALI_H__
> +
> +#include <dt-bindings/media/qcom,kaanapali-iris.h>
So, you are including the bindings here, from the header, which gets
included from the C source file including headers for all the platforms.
What if Kaanapali+1 (or +3) defines different sets of regions?
> +
> +#define VIDEO_REGION_VM0_SECURE_NP_ID 1
> +#define VIDEO_REGION_VM0_NONSECURE_NP_ID 5
> +
> +static const char *const kaanapali_clk_reset_table[] = {
> + "bus0",
> + "bus1",
> + "core",
> + "vcodec0_core",
> +};
> +
> +static const char *const kaanapali_pmdomain_table[] = {
> + "venus",
> + "vcodec0",
> + "vpp0",
> + "vpp1",
> + "apv",
> +};
> +
> +static const struct platform_clk_data kaanapali_clk_table[] = {
> + { IRIS_AXI_CLK, "iface" },
> + { IRIS_CTRL_CLK, "core" },
> + { IRIS_HW_CLK, "vcodec0_core" },
> + { IRIS_AXI1_CLK, "iface1" },
> + { IRIS_CTRL_FREERUN_CLK, "core_freerun" },
> + { IRIS_HW_FREERUN_CLK, "vcodec0_core_freerun" },
> + { IRIS_BSE_HW_CLK, "vcodec_bse" },
> + { IRIS_VPP0_HW_CLK, "vcodec_vpp0" },
> + { IRIS_VPP1_HW_CLK, "vcodec_vpp1" },
> + { IRIS_APV_HW_CLK, "vcodec_apv" },
> +};
> +
> +static const char *const kaanapali_opp_clk_table[] = {
> + "vcodec0_core",
> + "vcodec_apv",
> + "vcodec_bse",
> + "core",
> + NULL,
> +};
> +
> +static struct tz_cp_config tz_cp_config_kaanapali[] = {
> + {
> + .cp_start = VIDEO_REGION_VM0_SECURE_NP_ID,
> + .cp_size = 0,
> + .cp_nonpixel_start = 0x01000000,
> + .cp_nonpixel_size = 0x24800000,
> + },
> + {
> + .cp_start = VIDEO_REGION_VM0_NONSECURE_NP_ID,
> + .cp_size = 0,
> + .cp_nonpixel_start = 0x25800000,
> + .cp_nonpixel_size = 0xda400000,
> + },
> +};
> +
> +static struct iris_context_bank kaanapali_cb_data[] = {
> + {
> + .name = "iris_bitstream",
> + .f_id = IRIS_BITSTREAM,
> + .region_mask = BIT(IRIS_BITSTREAM_REGION),
I'd say, it's really easy to mix IRIS_BITSTREAM and
IRIS_BITSTREAM_REGION when looking at the code, which might be bad
because they are not equal.
> + },
> + {
> + .name = "iris_non_pixel",
> + .f_id = IRIS_NON_PIXEL,
> + .region_mask = BIT(IRIS_NON_PIXEL_REGION),
> + },
> + {
> + .name = "iris_pixel",
> + .f_id = IRIS_PIXEL,
> + .region_mask = BIT(IRIS_PIXEL_REGION),
> + },
> +};
> +
> +#endif /* __IRIS_PLATFORM_KAANAPALI_H__ */
> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
> index 439e6e0fe8adf8287f81d26257ef2a7e9f21e53d..f6d8761daf0471d3aabec21c708445ee7698487b 100644
> --- a/drivers/media/platform/qcom/iris/iris_probe.c
> +++ b/drivers/media/platform/qcom/iris/iris_probe.c
> @@ -406,6 +406,10 @@ static const struct dev_pm_ops iris_pm_ops = {
> };
>
> static const struct of_device_id iris_dt_match[] = {
> + {
> + .compatible = "qcom,kaanapali-iris",
> + .data = &kaanapali_data,
> + },
> {
> .compatible = "qcom,qcs8300-iris",
> .data = &qcs8300_data,
>
> --
> 2.34.1
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH v3 7/7] media: iris: add platform data for kaanapali
2026-03-13 15:46 ` Dmitry Baryshkov
@ 2026-03-13 15:55 ` Krzysztof Kozlowski
0 siblings, 0 replies; 24+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-13 15:55 UTC (permalink / raw)
To: Dmitry Baryshkov, Vikash Garodia
Cc: Dikshita Agarwal, Abhinav Kumar, Bryan O'Donoghue,
Mauro Carvalho Chehab, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Saravana Kannan, Joerg Roedel, Will Deacon,
Robin Murphy, Stefan Schmidt, Hans Verkuil, Vishnu Reddy,
Hans Verkuil, linux-arm-msm, linux-media, devicetree,
linux-kernel, iommu, Bryan O'Donoghue
On 13/03/2026 16:46, Dmitry Baryshkov wrote:
> On Fri, Mar 13, 2026 at 06:49:41PM +0530, Vikash Garodia wrote:
>> Add support for the kaanapali platform by re-using the SM8550
>> definitions and using the vpu4 ops.
>> Move the configurations that differs in a per-SoC platform header, that
>> will contain SoC specific data.
>>
>> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
>> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
>> ---
>> .../platform/qcom/iris/iris_platform_common.h | 1 +
>> .../media/platform/qcom/iris/iris_platform_gen2.c | 90 ++++++++++++++++++++++
>> .../platform/qcom/iris/iris_platform_kaanapali.h | 83 ++++++++++++++++++++
>> drivers/media/platform/qcom/iris/iris_probe.c | 4 +
>> 4 files changed, 178 insertions(+)
>>
>
>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..bdca1e5bf673353862c1554fb0420f73b3f519cb
>> --- /dev/null
>> +++ b/drivers/media/platform/qcom/iris/iris_platform_kaanapali.h
>> @@ -0,0 +1,83 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +/*
>> + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
>> + */
>> +
>> +#ifndef __IRIS_PLATFORM_KAANAPALI_H__
>> +#define __IRIS_PLATFORM_KAANAPALI_H__
>> +
>> +#include <dt-bindings/media/qcom,kaanapali-iris.h>
>
> So, you are including the bindings here, from the header, which gets
> included from the C source file including headers for all the platforms.
> What if Kaanapali+1 (or +3) defines different sets of regions?
Different problem - header file MUST NOT have data definitions.
That's basic of C, we don't write such code. First because it leads to
multiplied, redundant data. Second, that's not C coding style.
This pattern in Qualcomm Iris is terrible and I could accept variations
of existing data like below:
>
>> +
>> +#define VIDEO_REGION_VM0_SECURE_NP_ID 1
>> +#define VIDEO_REGION_VM0_NONSECURE_NP_ID 5
>> +
>> +static const char *const kaanapali_clk_reset_table[] = {
>> + "bus0",
>> + "bus1",
>> + "core",
>> + "vcodec0_core",
>> +};
>> +
>> +static const char *const kaanapali_pmdomain_table[] = {
>> + "venus",
>> + "vcodec0",
>> + "vpp0",
>> + "vpp1",
>> + "apv",
>> +};
>> +
>> +static const struct platform_clk_data kaanapali_clk_table[] = {
>> + { IRIS_AXI_CLK, "iface" },
>> + { IRIS_CTRL_CLK, "core" },
>> + { IRIS_HW_CLK, "vcodec0_core" },
>> + { IRIS_AXI1_CLK, "iface1" },
>> + { IRIS_CTRL_FREERUN_CLK, "core_freerun" },
>> + { IRIS_HW_FREERUN_CLK, "vcodec0_core_freerun" },
>> + { IRIS_BSE_HW_CLK, "vcodec_bse" },
>> + { IRIS_VPP0_HW_CLK, "vcodec_vpp0" },
>> + { IRIS_VPP1_HW_CLK, "vcodec_vpp1" },
>> + { IRIS_APV_HW_CLK, "vcodec_apv" },
>> +};
>> +
>> +static const char *const kaanapali_opp_clk_table[] = {
>> + "vcodec0_core",
>> + "vcodec_apv",
>> + "vcodec_bse",
>> + "core",
>> + NULL,
>> +};
>> +
>> +static struct tz_cp_config tz_cp_config_kaanapali[] = {
But this is new thus NAK.
Don't grow this broken pattern. There is no single reason data
definition should be placed in a header. No single one.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 24+ messages in thread