From nobody Sat Jul 25 17:34:03 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9018367B94 for ; Wed, 15 Jul 2026 14:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124624; cv=none; b=fve8LJuhjrJ/hpMhz7h/D7O7d4njfBb/MOGuZEuUfBwJsVSTEjh/A1AoMOeJWOGenfwIoAwIUDRh3hBXCAj1CMNi1mZuBRxr7dnAFdUgvmSXW2CmgeFZl3XifBkiSmavhFa/TUIqJOgLn4nEW+5Ld/yFm/JGPj36apQmo3WcwaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124624; c=relaxed/simple; bh=1LU9FZJPUHPC+RR4k/K6YKuTMFeyNyLyZrcpzk2OuRQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BGgKkgMbzkwSPD+XsPqr72QgMBIIjwIFCo6w+23wTlNshe9dH9z9zSerN8QX1KeQh68I3M4j6z9t04/Tk72usCyOxkjmY6f8YTrwUiPt0PtV/V+EKTpk2yniqDnCg3RBUtrDU6Li82tTBaEaTGcyGjKTr/8EalUHsZuVDYtnJgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=gCQU0py1; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Ns8ZUv56; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="gCQU0py1"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Ns8ZUv56" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3wml4036972 for ; Wed, 15 Jul 2026 14:10:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= HMXXtz5wPsY8Ow2Jocn+uz6khfFEAxGAmMr7OIuVcu8=; b=gCQU0py13sk6F1TA A+Zp5HbYT96+HD5eGEy6BrJwIB2Ij7vC4rE4W6t2SkEHgTEEk3rEOxCNJpDeTyNJ MxiLEPkLo6RsuOHlX/rcKkCtAUa6bQalQky5SIf2s6pUL5zKGsEW7c/NWho7NjHV EO+smhmVqUnXzbzxSeiZdgVr4L0kG9V4XkKx8SbmOJHffmKIHh4+mc6HyXuh7AWC NDPPIgIttAe3fUwruUCVruD/fFLRxfrARpfHWpaBnCLAJAFZtYExoguKPAbzclgD jbkFrJI+QONs0NFUUL6lhVRyYUIOP2M7MbW2ie4kTYOZ8rxn9TZG5T/tzZKEV6RS ReSADA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe7nmh2h8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:18 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cc86a9ef97so117639835ad.3 for ; Wed, 15 Jul 2026 07:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124617; x=1784729417; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HMXXtz5wPsY8Ow2Jocn+uz6khfFEAxGAmMr7OIuVcu8=; b=Ns8ZUv564923YP2DPwXQNJxZwEizmt+DXTwXDvaLmu2c9Rkwu4P1XcQhf9EwyRGI6p 7akPbKqqENubxnYXxZJxbSZQeblcOWp61uFqthabmlQrcIbkPVDJwepj4JyHuXVMsv6t 5giyY3sLfZTsZsE3a3FJ2P+533tf1mLb8B+DpWGNrEwK5rI3IilFHclmvNp8G651BvnM m9T4mZqA0s2CioMAsAzcEue8Xg8qyOuZZWoVabndmtaRt7gWCDc1D0bOBHJ729pGzTlD CU258ofICLzbfQXGBHND3Q3T+lOYggRZ7iEVChq+jZEql9ye0am1N2wFdXbcfLleqlJF +IXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124617; x=1784729417; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HMXXtz5wPsY8Ow2Jocn+uz6khfFEAxGAmMr7OIuVcu8=; b=kMMGkC/HeBt+geRkQGPkzmu/CPPR/4rWAftMr3EJSZPtpY7niR0M5XY1RImxmWZgTq sGAI1wdkVambeuNte1L5xHmQpVXwwC9hXpm5isGXvbMPvtRHp++rdVdWIwMClWVevE5V ffVcjcmAimPjuYT1SsTEGe9M3aWE7cDHJVXXVtcPUOrVfy9GQ1vfzRqRCbOS32iu5nTl Dcz1Blm4ett1o933zf0dRtzYtFUKWj4bslmYaY6NLSQQS4siFeOPdnsPjsV/1q6vm9gv F84Womu9evusOpU6nJdAdTZ6G85Yi+A05pfvKyCb8qB9UPH9GNPXsGkClQnFHhw22X88 sZpw== X-Gm-Message-State: AOJu0Yxu4JpJwoVQENgDP+ZiAZ6tMBkroC6T60ScVy4MFe6/ec5kKqyT XTFppd+mBYP0umry4//WX8qOAIoB41TGZOizABq2jm2+WQkJI7xpFLq0cDAS9T27qaQoUI350Ib q96eak2JvcEAp5uX4nEwQGu/uimkuM7o9EwA/EDrqn10ypdBK0f/++WA8qQpXopIPj8KiHkc8ow 0= X-Gm-Gg: AfdE7ckH4i3clbEJ2ymeElMDtA3DYn6CkbL7umXpxlDa3VwwyR0XRrn9c2ido8n8llS aRGRIPhR1BOeg/v+tN+O1Zb8/iv7blbfgyW0mCvhUoiXarlHpESAtlFEJ4M3mW1dlDWTXJN9lYm RPpJYyMBD9Sj/4jjJztlXslZjw0VRmyDy+34qoe2YLdRZ1vhGXsDIvaarFzQyNCs9rbOSSzBw3h oSZjV9xWM1M/By/2zDnyTzBoKJpAUmzeTDu4ow5Lh0VwpqUoZoNtKlpvrjMjMO/+JDBecDOW5FN ZfylPaTlMN/V2L1XfXCST369LcwARmSxwgf0FresUw7jsJJysU3KAc4jnMYsIBcBCKhiP0ZQnrY hb42/XKyISWj5CfQnFKQDS/JxLTaLXKdlSOywN6UqD6/2 X-Received: by 2002:a17:903:1ad0:b0:2cc:5fae:cc56 with SMTP id d9443c01a7336-2cee9b5901bmr91480425ad.27.1784124617310; Wed, 15 Jul 2026 07:10:17 -0700 (PDT) X-Received: by 2002:a17:903:1ad0:b0:2cc:5fae:cc56 with SMTP id d9443c01a7336-2cee9b5901bmr91479855ad.27.1784124616751; Wed, 15 Jul 2026 07:10:16 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:16 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:39:55 +0530 Subject: [PATCH v9 01/14] dt-bindings: media: qcom,glymur-iris: Add glymur video codec Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-1-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Krzysztof Kozlowski X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=9342; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=1LU9FZJPUHPC+RR4k/K6YKuTMFeyNyLyZrcpzk2OuRQ=; b=0MdfozpThvGAEEWS2NFRySTBrrY2ZrUgxlrOm3S4wJh9UlYugS7dUZnCQtBIjdbz7tXmUsphK djEgUzjW3mlBrATWATzAepCIDgLBiKWW4y8D8VO/ZBRfY6tI7HeIJob X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX+2lbNfkmYjzx wCr5q/3HLVYUmj2W28DQjUur/SQYxUrUWqMyQsmEVolD/2LilqYhuUfmdpROAKHg5Wbcgpzy14Q Cg+d5svDrviYE503bkWtBiDldePIF+s= X-Authority-Analysis: v=2.4 cv=cuGrVV4i c=1 sm=1 tr=0 ts=6a5794ca cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=fd_FPlQsB3JEVrxK6XYA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-ORIG-GUID: voUr5qmwaEzAtxU3zcVs0ANLuJYpxmnc X-Proofpoint-GUID: voUr5qmwaEzAtxU3zcVs0ANLuJYpxmnc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXxKvHoOHCEcHp ScpdNJuUZ+bUiJ6h6+wopAeaVGWBdqwj1PkTz5O/y7Ttn01EGIuV1rV2/o9DINlRMLma1jN27Rx J74mZIDGZGt7vSn0w0RXTWIXebXeHNbqzO/zMm6UoYYxERKAuEeWRt85D+9kazV3GYielyOFWNx ywAlh8Lp1jRjMfVylkd/PtX06xafNdXL3EtAs6M+jPGJf3xgXdeBfG28AOl9s24bNBL+pQ96dvq ASA8nxzQYCr9DjmVpL+xxzg4vwX2nWGYS2GeyP/8RmjKOQ5hkkxsCdvbzdpxSc/wFTMvMk9Zcck dYabUaFVxn+gpBoUpxNv7CJm5MUKWO5V2SuMkomZwTqP6ulEkkSLH9Q/v3fB10Mz3WTa60JWEcv 4KdYBOJSC4Jny61mUCuZCUq4ENGRSMTiT4ydQ6+BXGcKrtdRsuDof0qv+rKQ2/60MtWc0DVQEzh ib3rn7Pk37/6eRflyCA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 Add device tree binding for the Qualcomm Glymur Iris video codec. Glymur is a new generation of video IP that introduces a dual-core architecture. The second core brings its own power domain, clocks, and reset lines, requiring additional power domains and clocks in the power sequence. The current maxItems constraints for clocks and power-domains in the common venus schema were sized for platforms available at the time of authoring. The glymur platform introduces a dual core architecture that requires more clocks and power domains, exceeding these limits. Raise maxItems for clocks, clock-names, power-domains and power-domain-names to accommodate the glymur platform. The glymur platform-specific schema have fixed constraints for these properties, so the common schema only acts as an upper bound. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Vishnu Reddy --- .../bindings/media/qcom,glymur-iris.yaml | 255 +++++++++++++++++= ++++ .../bindings/media/qcom,venus-common.yaml | 8 +- 2 files changed, 259 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml new file mode 100644 index 000000000000..4db6c58e4a88 --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml @@ -0,0 +1,255 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/qcom,glymur-iris.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Glymur SoC Iris video encoder and decoder + +maintainers: + - Vishnu Reddy + +description: + The Iris video processing unit on Qualcomm Glymur SoC is a video encode = and + decode accelerator. + +properties: + compatible: + const: qcom,glymur-iris + + clocks: + maxItems: 9 + + clock-names: + items: + - const: core_iface + - const: core + - const: vcodec0_core + - const: vcodec0_iface + - const: core_freerun + - const: vcodec0_core_freerun + - const: vcodec1_iface + - const: vcodec1_core + - const: vcodec1_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + '#address-cells': + const: 2 + + '#size-cells': + const: 2 + + non-pixel: + type: object + description: + Context bank for VPU non-pixel buffers, including compressed and int= ernal buffers. + properties: + iommus: + maxItems: 3 + memory-region: + maxItems: 1 + required: + - iommus + - memory-region + additionalProperties: false + + pixel: + type: object + description: + Context bank for VPU pixel buffers containing uncompressed video dat= a. + properties: + iommus: + maxItems: 1 + required: + - iommus + additionalProperties: false + + firmware: + type: object + description: + Context bank for the VPU firmware processing domain. + properties: + iommus: + maxItems: 1 + required: + - iommus + additionalProperties: false + + operating-points-v2: true + opp-table: + type: object + + power-domains: + maxItems: 5 + + power-domain-names: + items: + - const: venus + - const: vcodec0 + - const: mxc + - const: mmcx + - const: vcodec1 + + resets: + maxItems: 6 + + reset-names: + items: + - const: core_bus + - const: vcodec0_bus + - const: core + - const: vcodec0_core + - const: vcodec1_bus + - const: vcodec1_core + +required: + - clocks + - clock-names + - compatible + - dma-coherent + - interconnects + - interconnect-names + - non-pixel + - pixel + - power-domains + - power-domain-names + - resets + - reset-names + +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + + video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0aa00000 0xf0000>; + + clocks =3D <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>, + <&gcc_video_axi1_clk>, + <&videocc_mvs1_clk>, + <&videocc_mvs1_freerun_clk>; + clock-names =3D "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun", + "vcodec1_iface", + "vcodec1_core", + "vcodec1_core_freerun"; + + dma-coherent; + + interconnects =3D <&hsc_noc_master_appss_proc &config_noc_slave_ve= nus_cfg>, + <&mmss_noc_master_video &mc_virt_slave_ebi1>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + interrupts =3D ; + + memory-region =3D <&video_mem>; + + operating-points-v2 =3D <&iris_opp_table>; + + power-domains =3D <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc_mvs1_gdsc>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vcodec1"; + + resets =3D <&gcc_video_axi0c_clk_ares>, + <&gcc_video_axi0_clk_ares>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>, + <&gcc_video_axi1_clk_ares>, + <&videocc_mvs1_freerun_clk_ares>; + reset-names =3D "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core"; + + #address-cells =3D <2>; + #size-cells =3D <2>; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0000>, + <&apps_smmu 0x1944 0x0000>, + <&apps_smmu 0x19e0 0x0000>; + memory-region =3D <&iris_resv>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1943 0x0000>; + }; + + firmware { + iommus =3D <&apps_smmu 0x19e2 0x0000>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000 240000000 360000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 507000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz =3D /bits/ 64 <366000000 366000000 549000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 666000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334 533333334 800000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz =3D /bits/ 64 <655000000 655000000 982000000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml= b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml index 59a3fde846d2..10716a93dd35 100644 --- a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml +++ b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml @@ -20,11 +20,11 @@ properties: =20 clocks: minItems: 3 - maxItems: 7 + maxItems: 9 =20 clock-names: minItems: 3 - maxItems: 7 + maxItems: 9 =20 firmware-name: maxItems: 1 @@ -41,11 +41,11 @@ properties: =20 power-domains: minItems: 1 - maxItems: 4 + maxItems: 5 =20 power-domain-names: minItems: 1 - maxItems: 4 + maxItems: 5 =20 required: - reg --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CFA833ADA0 for ; Wed, 15 Jul 2026 14:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124627; cv=none; b=NuGc5cBqA6FEm9zQMudUrEzjba2Ho70IloZ+6LBkAbyzVicPeUtjoBdCmNedyuOjdDj9Dc7VU7pJOJLiyjhkO8scxJpoCgt2e9tkIKVT4KhlrOcfkCFGI4gPfo4IhluNLVAPAlhpg7BpwNSnf6b0zKvYOXbylm+U1RE47hXb09o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124627; c=relaxed/simple; bh=tBM4xBzn/Xu0jRn9xB3qtH2PBSvLI/9VGMLOvNw3o5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CjINlIQ4U1jv2u3Hxhio1mr+vE0DrhjAxuTt/500L2Fqy2sO5KiAKKD0UnIu0NfSnbEhl+FXOsq08GozBeBrwrxQoBsu6R51AAzG66kuQQ2eSjGiPCt2Mm7/aHSmzfKRVVxCRbZHGqHbUWrqJnY9dfmdDP9DWoulaSSYwjOuXlI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=AQDuOgD2; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GBzC8+ZD; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="AQDuOgD2"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GBzC8+ZD" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3Qbv4006758 for ; Wed, 15 Jul 2026 14:10:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= mG+MV9RqZD61fcJc7fhHYvKrob3dAixJSqJ0wMGBFsQ=; b=AQDuOgD2MPFx9Qk+ jDvhXq33rTOeaktqP5IzDqtn7k7bRJ27BeoGxWQnnqKJTeyJ9jyUp7Bny46xAdlF lnNSJoTCCuVoXExD8ydeftMvOkU55zKEXspr5XGZMJIdC29ACW8zb6falFpcQ/2L 5Pk/rZ/NIBc9my3hCuSTth/vSzzaffFvpymxtBT0TKH11L5iLUj7p+DAmAC2m5k9 KBSP/DSRmS6JVykgq97Pg06r2UraJs1Sw0VVn3SthKWQcYfvItovrrWc65lpmTwp xOgUHAtfORPRnoXZyaxfZoxGXaRhzsuTlCq2lNfSS0+E85yyYDirV/ycLwGlOtrB GNrtWg== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529gau-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:25 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c88da04b719so2068740a12.2 for ; Wed, 15 Jul 2026 07:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124624; x=1784729424; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mG+MV9RqZD61fcJc7fhHYvKrob3dAixJSqJ0wMGBFsQ=; b=GBzC8+ZDEvbYmXuRmK2bF0Yr55/kcXiTediOT/PxWpfv519tfkJYjX3hCAySPAjcuQ bL8jx4PB3Aa5XwJSENOAzMt8Es+yquzqHWjbHMSteJuYVc1PW8hOgpfaMtRy6DnV63iU OrJQwLFh0g9smcb32nHEyvF5T73x5Je6lsd6X5f79HKuFxTz6robnvPZUmtxiG+WWW/H oNH86b3N90wIdxE51A2HbPcajzeug13Elp6dOAuILyzWS9TszLlHq7t7qxkcFbjE93pU 2drJMilbDrK8oARylOBRTNDKyR2deHMU3rs9xkFgPduXt3mPTaZOFtUj2/m5sQInzo8F qwqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124624; x=1784729424; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=mG+MV9RqZD61fcJc7fhHYvKrob3dAixJSqJ0wMGBFsQ=; b=htLaet9M2jx2Hfl6jfGJ0yqXwt7JsIUngSlXx+mMb5+AZpHA2t90HRFEx07DRKjixe zPNAJzDdxzLDCfXO0gQ5tJgAFVFvQkkTYeT30pbytAoKJwa9Kj7WPU6iahF2WeYNpvWX W8/8cOobZ1S2Y5J3lbz8sBwHQK6MNw1HXkQJeiIckau2bHrCIVxQYNZYvLVt9w1ttlQc fNuUdaWSCdjuvFuv2E08D6ACMy9OkrT8yEQIspuVcTl91es4F3fqBRs7Km6jPJIQ7xO7 xQFB1BPUAyAfBYMrjg6yDy9auGS7MR8liOimup2QAIu8ZUQ9bBzsw2DVLWHXH5NZvF1b 9Ngg== X-Gm-Message-State: AOJu0Yxgoz+sz53fk5y0d12YcgZFgQRiviuCGEcD/Y10LK2JSbmQ3GDW Qda1MNVmR0Y19AH+bwZl2GUXcudKb+tI2ITtNGdW7LaUWWLms0S8x8ZNLIf0fkHpC7gRrKbW3t3 4vVtlNNAuHFgL7emKDiQhwe6CTtD8sIUW72dkUp0hWQEN7pyl5ALr0oKYhQU1Ss5UCNF87kqGg3 4= X-Gm-Gg: AfdE7ckF3cbfmveKTha31VjQzpTQO1cxP4tkYh9XWI6dJblpR6bHjcQhgJZsXLFuOj2 5Iev/VYPGpN5I9pNNYhg1LnqIaICvCqORvbpPWw3QUJ6oN4GhEY/RH4KBkBQZO1ATgLRZBbqpMM D2Lig66xWXST7VfM+kNRps04NtMgojy8UKHvkFBH2bPg4wkk+0AU6Ht80yKYhAfVQEmIabvmP0C E7qpculJA4YK9cMaLF7iDJkHsXjxr2amvhu8TJl0WdJLLttITYlJ2YklHZVdWAU8vsa6xBoROMx Dk6uRbrUuSjD/HVoT734ya3MR5uDNoFMM7GGWIZjQISZmAMAlEqmI6XZarmK+0vn2TCGw5l70fw WT6g+4oIlpsI5ytITEsMLQLUVXbMYdbCH0MeySogFmFGS X-Received: by 2002:a17:902:c405:b0:2c9:bd64:8c8b with SMTP id d9443c01a7336-2ce9ee1143amr182310265ad.31.1784124624393; Wed, 15 Jul 2026 07:10:24 -0700 (PDT) X-Received: by 2002:a17:902:c405:b0:2c9:bd64:8c8b with SMTP id d9443c01a7336-2ce9ee1143amr182309755ad.31.1784124623841; Wed, 15 Jul 2026 07:10:23 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:23 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:39:56 +0530 Subject: [PATCH v9 02/14] media: iris: Add hooks to initialize and tear down context banks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-2-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Daniel J Blueman X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=3226; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=vPJQbRQVpDgoYGPs3GH5JVsYjK3ZXwBn3AcrWWr9aTo=; b=YMlHOOpdBxPUQfilr8FFvs7rxdpEwUrOIv6CUO72aj/DfFHXZ1yBpMUAyh3JdQPWw6a4B1g7i 0vDkxE1LkISBimhCDQKIHtl9/ukK1HkLgY3dv2aXdOluIoc0X7ucy6/ X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX5hrzAicht4zr gL2aClAK76AZa5VJotgdSoG0CzqcckxQtfpdYbtS+Ghs3xf/ZQsYg8K+OGPqZWYXvCwV5Wj+2px YUf3W5/vrVsl6OaaJRDhWcRHKTO9Ibt1JvMvnEkSJLYoYzPNQV+E3E2qkgV+fzPNvbF1DZ5wYvM 6yJQpY91N9CuX+sa1IiVkgjg4z6zVqmWKQU99FZQMPcpvqTbtr5UmTE3eh1suDwE6Td02XOSCXg /AkBWJEAdcQZBlrNbVPR3tKITRxipx6bAPDPikTdbI1ZnTlRLsd8QFg/p+re8/YcGD9/wZPGoS3 y+W1xUMHsw7D+xt4fKcCSOD2k8GhvsoNDh8xeQSXYysn0KpE2UMy5Etllm26glu9YVjIqYRo3PY YycBIV9/X0imqGhfiudtdRJtJPpE3r1271UQbP50ku+3OEpnosynOjdYk3m3Q/t/PnpssLV+FPz 9JyEeR4gTV0W9CFqG6Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXzhh0j/Jsc9le Wh3DDt4qW7s7hWk06NMprnbWs1OzhD4K8ty7LYe0gF+A6xoybN9T+TD8bTxI1rLFAQ4n4bv3sKJ SjqedEruB1+ZD2hVecyIb/aCmwxA1PA= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a5794d1 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=t9ty7G3lAAAA:8 a=UiTy4FYwoVgUUf68WHMA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: il-a0ZcmKIehaNzwt--iuOxnnw3oa-tX X-Proofpoint-GUID: il-a0ZcmKIehaNzwt--iuOxnnw3oa-tX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Vikash Garodia Add platform hooks to set up and tear down context bank devices. Different iris platforms may require different context bank setup, so let platform data provide the required operations via vpu_ops. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Tested-by: Daniel J Blueman --- drivers/media/platform/qcom/iris/iris_probe.c | 25 ++++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_common.h | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index c2dcb50a2782..2594f5a67378 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -15,6 +15,7 @@ #include "iris_core.h" #include "iris_ctrls.h" #include "iris_vidc.h" +#include "iris_vpu_common.h" =20 static int iris_init_icc(struct iris_core *core) { @@ -150,6 +151,20 @@ static int iris_init_resources(struct iris_core *core) return iris_init_resets(core); } =20 +static int iris_init_cb_devs(struct iris_core *core) +{ + if (core->iris_platform_data->vpu_ops->init_cb_devs) + return core->iris_platform_data->vpu_ops->init_cb_devs(core); + + return 0; +} + +static void iris_deinit_cb_devs(struct iris_core *core) +{ + if (core->iris_platform_data->vpu_ops->deinit_cb_devs) + core->iris_platform_data->vpu_ops->deinit_cb_devs(core); +} + static int iris_register_video_device(struct iris_core *core, enum domain_= type type) { struct video_device *vdev; @@ -207,6 +222,8 @@ static void iris_remove(struct platform_device *pdev) =20 v4l2_device_unregister(&core->v4l2_dev); =20 + iris_deinit_cb_devs(core); + mutex_destroy(&core->lock); } =20 @@ -273,10 +290,14 @@ static int iris_probe(struct platform_device *pdev) =20 iris_session_init_caps(core); =20 - ret =3D v4l2_device_register(dev, &core->v4l2_dev); + ret =3D iris_init_cb_devs(core); if (ret) return ret; =20 + ret =3D v4l2_device_register(dev, &core->v4l2_dev); + if (ret) + goto err_cb_deinit; + ret =3D iris_register_video_device(core, DECODER); if (ret) goto err_v4l2_unreg; @@ -310,6 +331,8 @@ static int iris_probe(struct platform_device *pdev) video_unregister_device(core->vdev_dec); err_v4l2_unreg: v4l2_device_unregister(&core->v4l2_dev); +err_cb_deinit: + iris_deinit_cb_devs(core); =20 return ret; } diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 09799a375c14..a8df9af0d3da 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -22,6 +22,8 @@ struct vpu_ops { 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 (*init_cb_devs)(struct iris_core *core); + void (*deinit_cb_devs)(struct iris_core *core); }; =20 int iris_vpu_boot_firmware(struct iris_core *core); --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4120037475D for ; Wed, 15 Jul 2026 14:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124634; cv=none; b=Ez1ZrZBYkvrWJ4fyBZo7errk+tjnymBk0Y8OsofFEs/U+/iD6KO5T9nSIGG/WxzzGslU6U2NEp4Qm1EkXvFSLFd5dVgIC7HMQcbJjxjuuVXPy+pevmtts3SsiTsWwc5nqs+k5cyooK7rL78KUJykR15YbkNggT/j3/vHIEnIvBs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124634; c=relaxed/simple; bh=Z7a+KeKlfsd6hODeCUGUk5GwLjPusVx49RSzZ6ytvIQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OalqL3aU71WQbd4VcxTYHpqa8EzRzEJ0zwXa3y1TuXDRkfhr0Pp32Mgi5LsauUGIHDNu9kU177Hqe/ciWG6wXhC54rzLdNH2ZpPp4GRdyr5sFPwNfdRTBYtHuV5jpy/Sfk8+KIHBGmFvVNxxQImT1NLyVfdst6RsFepGKPcwSBg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=V8vZWrnI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HOq7f4r7; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="V8vZWrnI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HOq7f4r7" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE47ST3905468 for ; Wed, 15 Jul 2026 14:10:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= rccCrQapLXpGKmzhslQnhMFu7V0TczQtmSRgtHbcpXA=; b=V8vZWrnIY8F4lR2l 4RXYe33gqTTTrtUP+tiuXZlpBjph2VhscMKCWaapZJ2KySvfQestzd5W1+h8zPrv 4cYbFWIoxSCnB7FWK6k2vnQ1bzKvg3xkfgkzlxpgGimqBoWCy4kgv/HuuKzgUaFB xm8R1Asdb/h/P0/hHzAIUCQKRvULIBj7V+YOTpyxS46AZRVfFo8WY8EDStIm2x6N S2yuD51XFbnh4oUcFb13FEIBoqTwIfFIcN3pYgKI1bor78fyK+vHV4gJ/SkUDF6i PlfFsRb76cL/D3BWL0Gi5lFP30I24zadIYEWMRY0VEyOlGyLn+rA2UGAgwrzRyD/ KErCrg== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fdwk336kk-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:32 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2ce7dff6253so6617035ad.1 for ; Wed, 15 Jul 2026 07:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124631; x=1784729431; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rccCrQapLXpGKmzhslQnhMFu7V0TczQtmSRgtHbcpXA=; b=HOq7f4r7JL+mOzq63uIaGCaC0tS3pSjuhShg3X37wrkkhqfs0ZHfaFocMd/rGQTLjD 2pM2UWxmXwhk0t0jxMNuUBvnNOpsF5dBjB2QCFgFv/WYjjYSwGAj3uFFSD2w87Yv/XkU R1u0sLRHvzOjvOr3VtMZu8S0VMCaFWpdlkStfKFQNbexiiPBTHGdfWPx33f1SbUoM2xQ qpsVQhrOdbt3NA1XVJ4mKp222XAvlY16C3FjjWhi/gDSrMwoMHdgJFV2nUHsCBrXslau qrFlrEtOloK2mJHHQgbr1Gcl3gqQgCKq1yMjrjO7EByl5fUzG10YwrnJ3XEwp81Ns7W8 mXPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124631; x=1784729431; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rccCrQapLXpGKmzhslQnhMFu7V0TczQtmSRgtHbcpXA=; b=NTi51ml+77BtKs3CykNwR/xaZVKFGPUNwGArHIx65JWzem//mSleFGV78+Vju3DjdC Zh9iIr69CdHmfMbV55r8zhGJjydj8bnpsWALcUVz3V/WnHoOUYNlNcINzVlf4iSIgdNO F8AbR2tIJiuhIWx952RY2zJ4CcIEArem5t/0ylwm65+/N7K2faROjebLSdASlhS3lT4h VFsuFOIqVExMVkRNnvMtJP3VScw6Ami8BWLxwH+QS0gfkzHsCikpfD3FfnB4n0WhuhZQ pPLWWAxkIlDlffW8DeyHnzC3F/O+XVFmE4z5hvjjnL0vmohWe3HSOOMyvsir++MsFIi0 CqpA== X-Gm-Message-State: AOJu0Yy6WBg6V/ULYt+z4SDFTksGvkG877sSa7+Oy+2NBqJrENTXXdxM 7ifD/ExEFUPIALL7VIi1SG14YHpuRabybtDNDSuV/GVBr6TdLDAYEQvY+Nq7pEPRntomdvT9rpb OkGAqfNh5fVw0YGHKsSnPXEsbZMryU0jisoIYYGhifWKc45qgZ0XuRjdmgo+Pb4RjESFidadE1U g= X-Gm-Gg: AfdE7cmzdhIeBzCuO08SBSXpnNs+nAv+oHdESVXrxethPuFrss/eukeVjdqmNoyBeO5 FV2i8V8XoZ/PHoz79LFRSavUP+UIbB/XHWyP56VM4CrgVt1Lex418yEwOR1+ty8wPKoPkeqoMbU du4SnM7vjahkSWGeq11I63+exem1KoK4qoqg6n2tz54nf9V9l6jnkTsehA889DMxdlvRhZD/MPP weuBkdQ9OLWswmqtA/k2okPhbBdHCPR4upqe3C4krAwlj/FMF7gyncliVF0kQ5O1t7rScN7ahIx HcDZ4DUuGGya1+NBMCNs4ULlr09ppzv6AzSnYGoATbmBsKj0lozIFGvzdR3G6YQB2nemceaRNeJ Z0ubc30poCHALQjlfiAs0DDNa3MKUPRuxQgGZT1cFhXvx X-Received: by 2002:a17:902:e542:b0:2c9:d277:2cdb with SMTP id d9443c01a7336-2cea16fc0cfmr159083925ad.9.1784124631155; Wed, 15 Jul 2026 07:10:31 -0700 (PDT) X-Received: by 2002:a17:902:e542:b0:2c9:d277:2cdb with SMTP id d9443c01a7336-2cea16fc0cfmr159083485ad.9.1784124630603; Wed, 15 Jul 2026 07:10:30 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:30 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:39:57 +0530 Subject: [PATCH v9 03/14] media: iris: Add helper to create a context bank device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-3-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Daniel J Blueman X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=2769; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=YR+PjYPX5zksaKJC/NvxWsdFNoGva+12VxA4G3rAknc=; b=bD+EReDXs3o480Zk1OghwCSx7mBFpmiw7ZRkROj5f0g9INqbdS/VO/svLYrOaoh2nS4yIFN8Q YyPxQHza2wWBJsxxNDlMSwHuKqIMINy0LMsqXjZJTzA0fcQDQJhWmW7 X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Yc6NIQRf c=1 sm=1 tr=0 ts=6a5794d8 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=t9ty7G3lAAAA:8 a=11-_c5lL_m6SPrwGrosA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: lp-eVhULpj2Ssgevkonx9FWTAv6hGCr8 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX/vnSLyaMB86D A2rpYJnBQRfI5dR4lu94LsEKrCc4Bcrjs3f+ps1udyYnWJNpIEUSP2Cx6h3CJL4ykH0DKa59kUm UsAY9L9YkcuEg97J6oA63NZuI8IHcWP4a9189asu/ZlCsZSEqI/WMLAKOR08XZOVk2v+ZnQCIVg P5soJPi7B9n9YCrNaIW7nYz13lzp/8wMMh39YNzU3ppsDzuXwjr/k4f3fYpkZr+b1JcX8Q0UwF3 Sp9jJptLGFVMbvkd4Dp4OD7Uueurm/zXZQBrVFpfks51V0xwQhd2iH1SWYeUCUNKpg9bwtsKzdv KZwcs9g1MM9IzYI/vgWWkyKQtql126dQrLsdXqSXAzLZbkmaD9gvp0wfWPDE0Kar3bs5x0yoJAq SSF7YGSFXj6q7cl5RlPgJ27bZGTUqCW/6AhTI+dF5xQeDGkhOzTWFkKmNtIT7rP0V0D1oNfDk5I Hd5T0Em5KYpB1wIZcrQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX9A2isZ6Vogr/ LEOvmU8cJSFIApndgxbIPv6ZzOwki0LwlNOakcZGB0uY+GzL1Q3tmY24FR52SEIbgTRBhiKEMt/ wWN5RUM4+zfcekXIJ+SYclQjnsG9A2o= X-Proofpoint-GUID: lp-eVhULpj2Ssgevkonx9FWTAv6hGCr8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 adultscore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Vikash Garodia The subnode in the device tree is registered as a separate device so that it gets its own IOMMU context. Pixel/non-pixel buffers are mapped into these iommu domain, to ensure they are within the addressable range. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Tested-by: Daniel J Blueman --- drivers/media/platform/qcom/iris/iris_resources.c | 28 +++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_resources.h | 1 + 2 files changed, 29 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index 773f6548370a..a685915a19e9 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -5,6 +5,7 @@ =20 #include #include +#include #include #include #include @@ -141,3 +142,30 @@ int iris_disable_unprepare_clock(struct iris_core *cor= e, enum platform_clk_type =20 return 0; } + +struct device *iris_create_cb_dev(struct iris_core *core, const char *name) +{ + struct platform_device_info plat_dev_info =3D {}; + struct device_node *child_of_node; + struct platform_device *pdev; + + child_of_node =3D of_get_child_by_name(core->dev->of_node, name); + if (!child_of_node) + return NULL; + + plat_dev_info.dma_mask =3D core->iris_platform_data->dma_mask; + plat_dev_info.fwnode =3D &child_of_node->fwnode; + plat_dev_info.name =3D child_of_node->name; + plat_dev_info.id =3D PLATFORM_DEVID_AUTO; + plat_dev_info.parent =3D core->dev; + + pdev =3D platform_device_register_full(&plat_dev_info); + of_node_put(child_of_node); + if (IS_ERR(pdev)) + return ERR_CAST(pdev); + + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32)); + + return &pdev->dev; +} diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index 6bfbd2dc6db0..ca53c01f60ae 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_ty= pe clk_type); +struct device *iris_create_cb_dev(struct iris_core *core, const char *name= ); =20 #endif --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A9E6334C3D for ; Wed, 15 Jul 2026 14:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124642; cv=none; b=mp0X5nhDzsDya7t3xNXmQYNhEMbbT1MRnnY8b/fTDcbnYu5fSAbDfmQepkW03P499p4lYzOPYZyyyobZx8xzL1dSofzZFEfaKTEmgI8enyjxbrwbW+AsZea8lT2JUt+Lre5kMe/rmcFo/9QTF0gJ8GQE/2SnBPjt3vtC7SRwreg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124642; c=relaxed/simple; bh=TWnfmPOlO+mOYgnlGCly8Bm2gHmg0/p2SiB17+MZEzQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pTjYFv9yRfT4VEvXyS0u0Hl5XxiEZGGoN/uu4NL1WM+5EwEuU7HnupilHR4iKKJaJn+z5Q1daVu3jj/0vHstqxgKBTUNoxu7gmaYVwzg+L2WRx4iBk7FtcZfjYxVKB6PWcalHRtp81VnxPxNkPl+WokRGCL87KDVf7sapblI/58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=l0s+oMht; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XNJtNeZR; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="l0s+oMht"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XNJtNeZR" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3rsh3905164 for ; Wed, 15 Jul 2026 14:10:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= svIy/K6G5c/If16VRcQMxrUiCQCVENhFRu4Xsi5uR6g=; b=l0s+oMhtoSahTOwJ XdpaYIVc30LOSud0UZMQJm/Xa+hvCvcUyFGN4e9lRBErJZRjDCqbnmyfrzoWuXTQ PxgeXNRum3ZIO6vmA19JQfHnwYwewDHu35xur1G776G6fqqaqZdzUJe0dwrKXRUd 9bRY29Qk39MDZySZCLtfKJjFT60IXzZDph8TiTuG5R1fNvLwmc2BgZwNB4rJdKKO pafen+bJIsGhdWDFEN0llBrajc4M2WRHappTTbG18wX/9rQ+R6S6SvfIeKIWw1fi zbw/aVbE6QqLs0tPaXtkzy6eijSw9gfxQVE4GYtTjjf3LIKG6ZbuDH13AQEsR++U T73w8g== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fdwk336m7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:38 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2cd01a14e81so81094055ad.1 for ; Wed, 15 Jul 2026 07:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124638; x=1784729438; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=svIy/K6G5c/If16VRcQMxrUiCQCVENhFRu4Xsi5uR6g=; b=XNJtNeZR88qKP9lslsiRuEVjT4SzjEzrs0U9GmPmIxdzbKNNHtvbPYMtf8+CihSwkm WzoBVKGTS7X7poSW1sGA2hz72GQTu/Rpy6PCcybxrPurBCskn6V5m0rJPnVFhDGgzeaq bMaY87xSHXwTIH4ILFuzpjM5Fb+7pkMwlnrAYclLGe2gD9ZwyL8biXyMrQoIIBi2Odi/ vVS5CNimo/iFkOT3XPEdVa1jhy0+5X63Bs30U9WOM4TZw9joe6Y5zVDmZ9VigTJdSi6/ BQyRS1QBshYz15zdKvC5wheOqVljkqp1dgTfmGrcjENuENDbpSf6YLYOwdDgXddGHf0e eKcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124638; x=1784729438; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=svIy/K6G5c/If16VRcQMxrUiCQCVENhFRu4Xsi5uR6g=; b=W50CADVzHzt92hwN8EvgkCN2u+0b4pF/XTJm2uHwAhh/ZznaR/ffIRJzQ9ItozT8zY Ck68mYq4rwaZHdG3Ewwg9Q1pdOUCnAExZx4ETFe1pInNefMHgTBl8wEIZHkepyNo/Zoa OtejzfOt2kkebZGK8H+IAlNa8WiLCisk1d4AMN1qac7UBoo2K/xkM/3dgC9DZv3lo1Nj ojBEj9H208weHe8n1cnWIvinzH4vGWbe2CZip8iehpijiNzIc+DxSiyHoLXNTJAokQ7r XLb6CeyJXmOOuXd5qu972SX8+zzPWhaIDz+VpRNXleNTlBfRtZPWoEiCd83WZ0g+VWWJ 9Mew== X-Gm-Message-State: AOJu0YyAPmGE4EdYVpZFlIAMffLQIw9dNKdBLhRXK61bUnrVXoilgZ7k wU+HaPPCxiMQ9IQzSmus6CcPGhFaCSCOmKx6aW3M8upVdpsbMZe6zF8lwF0bCImoxvtMtW975xb s40KqMwLdZ6AWOxY8UjKlG02l2PvHd4qq79z5IzMcBtzDizi23ugrl+iE0ClGfgRJ2/HZ1Pp6/1 Y= X-Gm-Gg: AfdE7cnSQex4MB7HdFI0ym5yfy81pagjGPcC0x8Sg5kvu/NWBHp1X9OtwWlfofgosxA R7WVen4AktDN2InewyNh/X6gtfiM0oITbMjQOoKvfvpDh2OP5e44Xr6p9SjpVql/RlPI0/IW2su xDen1eZeVDvzP5HtjWa7QNx96SBwbMyil0Mh7Hs+oNOjNJTFitQP1ntcC8By/WnxB3mq8CY3j6Y DXMN+VMX6alEA/UG7l15RCMTwXIbaZvW9bCgyKQ61P1/ntz5G6suZ7+dl5c7YVmfAV1Eg+nP2NE 8AQPKSDSFe3jOxcbiVxyQWSVBM/Poqcsc0W/l3QBEaBSVuzRzCjRcJSWey+LQOEwJV5SgAdWhoa y69j3Iy1xQB2bGBzJ/b6eybsSBMJaa6df/6MsklAioONT X-Received: by 2002:a17:903:288:b0:2c9:c6f3:457a with SMTP id d9443c01a7336-2cf03d71fd4mr26990395ad.31.1784124637897; Wed, 15 Jul 2026 07:10:37 -0700 (PDT) X-Received: by 2002:a17:903:288:b0:2c9:c6f3:457a with SMTP id d9443c01a7336-2cf03d71fd4mr26989925ad.31.1784124637405; Wed, 15 Jul 2026 07:10:37 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:37 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:39:58 +0530 Subject: [PATCH v9 04/14] media: iris: Add helper to select relevant context bank device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-4-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Daniel J Blueman X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=9226; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=Pr3Au1H6jFHDbntQ1fqrPLFjbIEO/fGUoiMyA/l0Va8=; b=Knxt7iTd/66d1CzrRCKjq0i9jeIIFtmrZPtFqpov2XPdpDpfwvraXiYAg4RkLQoF11mQYKeOu 2HW4tO+rb0ZBGLjdOeViBft6RdlNkQOj/xo5Bemdt1x//VDqOAxl/kD X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Yc6NIQRf c=1 sm=1 tr=0 ts=6a5794de cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=t9ty7G3lAAAA:8 a=1mAbuoZ9JynoZkEgmloA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: wNYNIzv68CN4j08N298QoQq6o_v491XV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX54yLtzANYjNd ATL4s52Aq2lrGpBmQ5YLbHjbbJVTjw0y1pk1p3tMw+bDYsBJ5S7emXOHWyo5gEJPXodRWVQ0U3t U8x58rzYZ+bKeyINA4SEPrkjT7S4vbDLhui7FQM1iFiOtiHCm36N7Z13WOvLSprtsezfhpAhnwh 6arA8+qZH7moIGgKeoN4aam3bf04GliQK6mAk+2xiJHljgs9Ovu8fhwlTMvR+EIT5v3zb4TGN7x G4bsNlwvs07Agcw6wziqYQl0IyB1G1Z6fSDS3ncRjfCM5uAqnYl/1AFTfXLHgMJHp/+hdLUa+dM WizLSCsvNnACHQFQNMKZv8K9KNvcJxQSMPANNfFAB8RiLhVgUaMAStfkzpGoZOoxxaK0cmNrCJx SDOM9HAEhWTLDHrrYm/b6Q3GwVHwXXa/Tg067ADiDAprb7sSde2rA5+TtoGeJlKifVYGXHmogYP yvVmt2llg5tpjYoSyLQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXx9ngN1gZkXWu kq/rZbT8cWg7l/hUsUuTutw2XG6eMD1SAdYb5o9GJ+wHiATXyP+IGFDDsBd0g/9akSddMkiJLon S8qfdQFSzU/bz1WYgfeB7pe3sZS21EM= X-Proofpoint-GUID: wNYNIzv68CN4j08N298QoQq6o_v491XV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 impostorscore=0 adultscore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Vikash Garodia Associate the context bank device with the respective buffers. Fall back to core->dev when the platform still describes the IOMMU on the parent iris node instead of using subnodes. Those platforms would be migrated gradually. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Tested-by: Daniel J Blueman --- drivers/media/platform/qcom/iris/iris_buffer.c | 8 ++--- drivers/media/platform/qcom/iris/iris_core.h | 4 +++ 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 | 1 + drivers/media/platform/qcom/iris/iris_vidc.c | 4 +-- 6 files changed, 61 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media= /platform/qcom/iris/iris_buffer.c index 246ad0abbac3..249c9f1d0d5d 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -529,7 +529,7 @@ static int iris_create_internal_buffer(struct iris_inst= *inst, enum iris_buffer_type buffer_type, u32 index) { struct iris_buffers *buffers =3D &inst->buffers[buffer_type]; - struct iris_core *core =3D inst->core; + struct device *dev =3D iris_get_cb_dev(inst, buffer_type); struct iris_buffer *buffer; =20 if (!buffers->size) @@ -545,7 +545,7 @@ static int iris_create_internal_buffer(struct iris_inst= *inst, buffer->buffer_size =3D buffers->size; buffer->dma_attrs =3D DMA_ATTR_WRITE_COMBINE | DMA_ATTR_NO_KERNEL_MAPPING; =20 - buffer->kvaddr =3D dma_alloc_attrs(core->dev, buffer->buffer_size, + buffer->kvaddr =3D dma_alloc_attrs(dev, buffer->buffer_size, &buffer->device_addr, GFP_KERNEL, buffer->dma_attrs); if (!buffer->kvaddr) { kfree(buffer); @@ -682,10 +682,10 @@ int iris_queue_internal_buffers(struct iris_inst *ins= t, u32 plane) =20 int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffe= r *buffer) { - struct iris_core *core =3D inst->core; + struct device *dev =3D iris_get_cb_dev(inst, buffer->type); =20 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); =20 diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 24da60448cf2..3c96f46cf567 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -36,6 +36,8 @@ struct qcom_ubwc_cfg_data; * struct iris_core - holds core parameters valid for all instances * * @dev: reference to device structure + * @np_dev: reference to non-pixel device structure + * @p_dev: reference to pixel device structure * @reg_base: IO memory base address * @irq: iris irq * @v4l2_dev: a holder for v4l2 device structure @@ -81,6 +83,8 @@ struct qcom_ubwc_cfg_data; =20 struct iris_core { struct device *dev; + struct device *np_dev; + struct device *p_dev; void __iomem *reg_base; int irq; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/me= dia/platform/qcom/iris/iris_hfi_queue.c index bf6db23b53e2..ce6a682b0f9a 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) =20 int iris_hfi_queues_init(struct iris_core *core) { + struct device *dev =3D core->np_dev ? core->np_dev : core->dev; struct iris_hfi_queue_table_header *q_tbl_hdr; u32 queue_size; =20 /* Iris hardware requires 4K queue alignment */ queue_size =3D ALIGN((sizeof(*q_tbl_hdr) + (IFACEQ_QUEUE_SIZE * IFACEQ_NU= MQ)), SZ_4K); - core->iface_q_table_vaddr =3D dma_alloc_attrs(core->dev, queue_size, + core->iface_q_table_vaddr =3D 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; } =20 - core->sfr_vaddr =3D dma_alloc_attrs(core->dev, SFR_SIZE, + core->sfr_vaddr =3D 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, queue_size, core->iface_q_table_vaddr, + dev_err(dev, "sfr alloc and map failed\n"); + dma_free_attrs(dev, queue_size, 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) =20 void iris_hfi_queues_deinit(struct iris_core *core) { + struct device *dev =3D core->np_dev ? core->np_dev : core->dev; u32 queue_size; =20 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); =20 - 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); =20 core->sfr_vaddr =3D NULL; @@ -309,7 +311,7 @@ void iris_hfi_queues_deinit(struct iris_core *core) queue_size =3D ALIGN(sizeof(struct iris_hfi_queue_table_header) + (IFACEQ_QUEUE_SIZE * IFACEQ_NUMQ), SZ_4K); =20 - 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); =20 core->iface_q_table_vaddr =3D NULL; diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index a685915a19e9..309a593d755b 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -13,6 +13,7 @@ #include =20 #include "iris_core.h" +#include "iris_instance.h" #include "iris_resources.h" =20 #define BW_THRESHOLD 50000 @@ -169,3 +170,43 @@ struct device *iris_create_cb_dev(struct iris_core *co= re, const char *name) =20 return &pdev->dev; } + +struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type) +{ + struct iris_core *core =3D inst->core; + struct device *dev =3D NULL; + + switch (buffer_type) { + case BUF_INPUT: + if (inst->domain =3D=3D DECODER) + dev =3D core->np_dev; + else + dev =3D core->p_dev; + break; + case BUF_OUTPUT: + if (inst->domain =3D=3D DECODER) + dev =3D core->p_dev; + else + dev =3D core->np_dev; + break; + case BUF_DPB: + case BUF_PARTIAL: + case BUF_SCRATCH_1: + case BUF_SCRATCH_2: + case BUF_VPSS: + dev =3D core->p_dev; + break; + case BUF_BIN: + case BUF_ARP: + case BUF_COMV: + case BUF_LINE: + case BUF_NON_COMV: + case BUF_PERSIST: + dev =3D core->np_dev; + break; + default: + dev_err(core->dev, "invalid buffer type: %d\n", buffer_type); + } + + return dev ? dev : core->dev; +} diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index ca53c01f60ae..2eef0676a146 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.h +++ b/drivers/media/platform/qcom/iris/iris_resources.h @@ -16,5 +16,6 @@ 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_ty= pe clk_type); struct device *iris_create_cb_dev(struct iris_core *core, const char *name= ); +struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index 14d63dc76c9b..26df872fb4fa 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_v= q, struct vb2_queue *dst_ src_vq->drv_priv =3D inst; src_vq->buf_struct_size =3D sizeof(struct iris_buffer); src_vq->min_reqbufs_allocation =3D MIN_BUFFERS; - src_vq->dev =3D inst->core->dev; + src_vq->dev =3D iris_get_cb_dev(inst, BUF_INPUT); src_vq->lock =3D &inst->ctx_q_lock; ret =3D vb2_queue_init(src_vq); if (ret) @@ -121,7 +121,7 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_v= q, struct vb2_queue *dst_ dst_vq->drv_priv =3D inst; dst_vq->buf_struct_size =3D sizeof(struct iris_buffer); dst_vq->min_reqbufs_allocation =3D MIN_BUFFERS; - dst_vq->dev =3D inst->core->dev; + dst_vq->dev =3D iris_get_cb_dev(inst, BUF_OUTPUT); dst_vq->lock =3D &inst->ctx_q_lock; =20 return vb2_queue_init(dst_vq); --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAEDD37C91A for ; Wed, 15 Jul 2026 14:10:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124648; cv=none; b=PKEpI2G7eAg1FjhbGoyaRdXOXkKHotReWydl2XaAy8adxatckhjKOPWcELxjxQdgA6PQzUqe5NlGftRaqJnPiB0tJ2dIgWGLmfP7xbpTKb2gG+d8UPkLFKAapuyealE5inBX3Q3AOtIutWKz3TTd4ELUXDcBkIt6jt/NYcsR8wE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124648; c=relaxed/simple; bh=xDKjG51jBAk9EXSAgV+S8o6yhO9zrtRBIJx3AXPH7vc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IxHnyRR0RPsZSyUkU/nke2fcwriaW2tzNn6rB9bfKmtUMz+byeQ1XrS6AcTy78pw6AHaVnTlCgLk+pPVaEl/11+uXem5Ao1TNyw+XSW6qrpN7IvSp5rRpU0u+pDToAJEadKZI2PeKliy9hZONAKIJKM6uLWkReG6QgFcSOgYnR4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XyxjMH36; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=azaW0gUM; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XyxjMH36"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="azaW0gUM" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE4DPr4037435 for ; Wed, 15 Jul 2026 14:10:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= jQ1czwxEPod8YlqEh+zmO/6OKv3iOp22VfF1LBuIlCI=; b=XyxjMH36YcJYCkgq TcU5Kyl3MDusL3IHng7fMmA1mootoYxMMTmttEKkJgbs7i4vnplaKd2roZzJ1p1P QdGBkf73b3BxR8aByaWY+ZklGtCFDuvpPUUB3Y+s6e4NL++gnWr69Z7RAVRLGvyA SBWR/u4Wxa2tcb71VVAONa/ZIXpS6XCuniX0SBuFFcr1fh/B9EFEcYLRWd6v3wxo /l0x5N6Y0XIwF9PCeEsgC/cMB99Wgsw/GuVU7/fTOmwyuLbk7ToPo4CgP416peC6 4pnep2+FnBJFShicP1fPaX1jSxcED346tWWIhIkr2iy6tOanQVJv9ZUx/MPHAQeK MGb8mQ== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe7nmh2k2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:45 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2ccafc5e82cso26975465ad.3 for ; Wed, 15 Jul 2026 07:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124645; x=1784729445; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jQ1czwxEPod8YlqEh+zmO/6OKv3iOp22VfF1LBuIlCI=; b=azaW0gUMk3FamrWF37awvsDfKhO7cp5x9AbaBUbglQ4h3xbxxgIn7TWVxwPFDf/FqT XsnJe6MmPzRa3DZJ069AxGIwUI+0w+Y60vGgrp5NNd7IfJR5Icz6JRbmq7w5oCRhtFTE aYyhlZPJRm1h4GaGH2+Kt0/d+IgogZ0lRR+h8x86N3vQefhharWdKwOWH/Xaq8HwWH7j C03J9MZ1dS6nffCVc1RAwhqWWXTornSgNnWUQkX1WR8/15zRgOoaD5HC9hYNBdjFuCA8 PnfOlGVonXlrpBVYmQVG6UDIbCUH3IfwsIOv97plzNe10YnF/Wh7V3IKhBp/JSNPqKlL Tcgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124645; x=1784729445; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=jQ1czwxEPod8YlqEh+zmO/6OKv3iOp22VfF1LBuIlCI=; b=Iyh/JvM/loqf6FgXi3Nb14p2Wye9Bg4E7T7sBiOySqa11j6eM4VpQgpWK9LJ+zusLY /dPjMkjQC2pNe0o1nogwZN27WmQznriWugKGQpJJoSPYnGtQjTUL6r0KVmSM1ujBkuHp WeIQ9MV60BsVEZn7VY0f4C6ex3KiZKOL+HSafycrphYBmQqd2ddgQ4q8nUoCKkF6FJV7 UXlTvTO0nVqiwYD9ayICUAT4L6WaLvRdYUKIDysBRvKgHR1X/e2wJnez2GfNsGSQuwYs 6ZVj/73fd3st5w34YQO7qTv8c0R9jkDNBXGX1oA9luYn/g0WrJ4UyO3EZvdE96j4wMZ5 Ymzg== X-Gm-Message-State: AOJu0YyPPjlvR0rTYbiZcZh3YnEuBcI3Qx26aiMS5BhF1W7bmj1G+M5r IHx/SZu/rTy6QtS6TArJn+/pKNhP5s/k2zTTC0HBr2Ira96X9FXMOLgYjmPzLfx0UYjuxlVM9Pl c8WyaBlLkh/UU8kN/PYiBLmmFVGJt38tjG6iKduzo+WwhVGbs5H5REb5TWuCxZRQQPeg6SxN46t Y= X-Gm-Gg: AfdE7cmuluI2SeafRRgqDkMJSQaYXbEDXrcKQ5H+h/0Ul8Ibw9F+3iKo6QksyRWbr3X BYhSVvG9QNcVMCBTLt4CdpzmqR6PQXaVfRFlFlklRiAJg3f5rMbjo2LfTE68GuZ4xP/Zkvvmmzm 4J1KOskK7uKEtcYcrKCiJPbDWroBMpzO4mvzlEcoj89ByWARJP0wOiUdG+MxuaMxCTSQzMluTvE wRHRc0vuL/oNzQULMdGbM9xlerO01YQFdITcVOpMSHPTylHmQAqy0M9KHCne8KmSHbQ6wMcBD9H nSBLtVgsCZKf1DJ5HYudI/78/Lf1Gqw2984TB1mavzjgsIMGYI0UyM0f5v9vEdv46Kg5NSZKKiQ tqTQpC6EAhNwHX1TOUjBmABwr9gpGDZEs1m2Io1nNGEPz X-Received: by 2002:a17:902:f68e:b0:2c2:cf20:213 with SMTP id d9443c01a7336-2ce9ee1142emr186082025ad.29.1784124644512; Wed, 15 Jul 2026 07:10:44 -0700 (PDT) X-Received: by 2002:a17:902:f68e:b0:2c2:cf20:213 with SMTP id d9443c01a7336-2ce9ee1142emr186081605ad.29.1784124644086; Wed, 15 Jul 2026 07:10:44 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:43 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:39:59 +0530 Subject: [PATCH v9 05/14] media: iris: Skip DMA mask setting to core device when IOMMU is not mapped Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-5-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Daniel J Blueman X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=1589; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=sjEt7zVED5HiiTDKACtd2anjSuOH/+nGuerIdCCDwyY=; b=Akf49Yj7dW3GwqxuoRtoRP9AK2qcSXDAAVD2VoECqphz29qaa69SzMfa0lyuS81QJoZMYeFtN VXSV51eLUv2BIs9kTVKE9Zn7eYjgvGiQ1FBu34jm+ykdqzRBARCJtpg X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX1pIOaNSFteFg axwGym2vADzNQsIp4BcS8kER45UqjbVQx2TmQm6PI9Ik5JtZpSNryMbbhHBhXuUHe8ajRQb0GX0 r1yC+SXhubGaA5nFfpS4Gr/87noGyaA= X-Authority-Analysis: v=2.4 cv=cuGrVV4i c=1 sm=1 tr=0 ts=6a5794e5 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=t9ty7G3lAAAA:8 a=2w7d1ukKp82XeiQ8bL8A:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: AWjjXNjsa_WFNflfXeczjE_Lf--wTwS2 X-Proofpoint-GUID: AWjjXNjsa_WFNflfXeczjE_Lf--wTwS2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX5VUnVISHfalR DtfbLrNv1RJfS9v1Ud+2PYfEBSLeMdp5z8Gb4WSgLgDyv6kv20CSQ62zjDLdq7ekNnr+IvEcOYe Fq7JBj7No/ebtskYR99mJIolkg1FiTzeVUnwN1sUngAsl67fKSSlZtwPZONUY0wV7qPhDDOEQr7 jG3LGMfrVrxSJ4hM2a+ySpbCQW6F2uB/mWQHh5keAzgL4sO2VYXjj1byea1SDFh4zvUZDtzt1CW 5TqFfN+hTUh7WyvZXxLU/TGToudUp44GlsWYlzMd4a5zEOvZrliSHVyd7BAaMQmYLY/yvOy3tr4 uOE3W+0bxGtJroQy5q/FwnW5BuP1h7FGR/x2rJ7kfMg3BuSUacmLXE7sYHTGVmH/dnRoPESN6if z57yf2rsRMAaPr+uoox0DlkfsPgbSF2Vj2OLKSUTuisEUMjghlZ5Wg7YtafY9EzGTKUjf2RgrBc bU5mQCFjDmCndImS0dg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 spamscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Vikash Garodia The non-pixel and pixel subnodes move the IOMMU streams away from the iris parent device. As a result, the core device may not have an IOMMU mapping, and setting its DMA mask is unnecessary. Legacy platforms that have not migrated to subnodes still associate the streams with the parent device and still need the DMA mask setup. Call dma_set_mask_and_coherent() only when an IOMMU is mapped to the iris core device. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Tested-by: Daniel J Blueman --- drivers/media/platform/qcom/iris/iris_probe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 2594f5a67378..c40c4ec44e83 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -310,9 +310,11 @@ static int iris_probe(struct platform_device *pdev) =20 dma_mask =3D core->iris_platform_data->dma_mask; =20 - ret =3D dma_set_mask_and_coherent(dev, dma_mask); - if (ret) - goto err_vdev_unreg_enc; + if (device_iommu_mapped(dev)) { + ret =3D dma_set_mask_and_coherent(dev, dma_mask); + if (ret) + goto err_vdev_unreg_enc; + } =20 dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32)); --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4A04A37CD2C for ; Wed, 15 Jul 2026 14:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124655; cv=none; b=Vzwx2bScYQGhh6XaArT24oYM2BpKCDkV5Dxg/V3UWniBml6M+gisPcifqM/VceW+XmDn2/mIdMol+SN9VsfNWd6hubI+NP8vy0O90YfnWZ7NVBYSVnvwzYBsqrdaIXH3363ehFb/EwSo6+aY/9SlGrOGocBAtOLRzqLKllaZ6i0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124655; c=relaxed/simple; bh=baQ90teJi7Apuw1DT4Yon0BjJAdFT+yLP4AlGLp6bYg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NTm2UDtwJodnn6yn19z0H1HR8/M51fWaVqfkjS1RzEiU0Ih3a070IiXLEQpC1R/hnvyaJ+sR0NXiS0qKxMT4KmN0BPZs3+8mUxPbzbNO7jZ4M3B72kBS47keX9mFNLs/cMdqksIeaeUInW1bYTxACVc+zSXeu9mCTxSA1fVmKEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=SsJwP2Zp; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XruEIX07; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="SsJwP2Zp"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XruEIX07" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3Wl04097297 for ; Wed, 15 Jul 2026 14:10:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= rrdJsg/xINTNx7WBKUwZo/8lLXCAgU7OCvD1SQztacw=; b=SsJwP2Zpr4BciJEJ oKfYxBim4QlDRFxXmpTnxdVzyBOXMQuQWEopHfpLJg1nlY7LWnFyxAyKK+5rmOum hQqtI+OMZbE1xDmr3oQCwVZp+EwjQYv03fRMvCetIK152hrZH+qqJnUMYN94oVW4 4qszCcRtbakyhKlEjLXqz5FLADdSoDLLYx9OKid+y9Shy3ZA+Lzoa8Fly9Om74Jt 53N/d7L8asau9W5XzySsDnr61Ac3jOKwLeJ71cTBTQEi+6bjUZJ+uY+bSf46L/2i c7DyGUJrXUrMPEm3AsNk1aCIrROmPeeso/qnGTJm8XJflnGB9LPVmO1ouqknqzE3 mOg9Nw== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe8558ygg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:52 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-c96b4f58ddcso2122806a12.3 for ; Wed, 15 Jul 2026 07:10:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124651; x=1784729451; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=rrdJsg/xINTNx7WBKUwZo/8lLXCAgU7OCvD1SQztacw=; b=XruEIX07Mg7E2OMdAkTGE4BjHOK9bbea/9B4gFlU0pbdvfaZv1PhizLE6HyosGU0gh wweo2uPGfaInPuLGOOTe36xZ0jLPNpqGz6FwViM138R4CPUaI67N6uFr2ZU2Kf1/2Fo8 ZYGmw3MgUnhIK/ivRVrqGkk7xOi/UJuv6v/VRfkTy+Si8ClBIcpPSkO9lgj6Jafdwc+H +kmp7bnS4yW24vTfMdr3DoLmrMcRN+WeMVD3b+nBy9BG2J9G4t784wj5/YqU3/r/HOnE YDna9AvhtmEgd3YFP+Ay3lG/CFn25FGF0Ltf3feP6ZYWWPmSDLmFa8WpEj052Z7BjJaZ 5xIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124651; x=1784729451; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=rrdJsg/xINTNx7WBKUwZo/8lLXCAgU7OCvD1SQztacw=; b=Rs8CfUINvh5ET7slB5Jujb1h8NFAa18DYRAiN49qL4TOe5JTuEXbkKRSNXbASvg591 rH21JFoXqiOwmNZ91pxCl30RKYYB4c19EU/ID9HHGvA0TCxJAH4AHDmvFsNwyhrq91mK pWoRh/4gXtXvdX8+4ElJS5Lt4Z3gKkVTM3DTylSNI05Wb6SfUR5h6u+kPbV4a7qo+mFt bZ1l/2jxjcbBDwKAB7m897umsySCmnS/w0p5AdiMXfIGsHjVEJpWJmQgckyRK4AvVQX0 4mTIYVmDDbRmPFIBEU95k9kN4/g7f/3b6eZ9znnSr0tKfR9bcNXM7MO0E5IoanMUPWKd vWWA== X-Gm-Message-State: AOJu0Yxed3KuLBDwPeU4F7CRnoCfTNx+Fexg3qoOGyDEUGEPXqnRlJQC EPhfQBfvovPajGC1QuQTel/+iM2Hir8ioaJkT8p2P6MpAtCCqdNSv4V64Xh17XtX7h12V1Ra/Sz qk5QTrP4IFsmBaluAODt7iRW8XCTDWjMyhdMhhpSttZ5oEUSxUodJ2pWzzH33P+utolqjQ+uOvb o= X-Gm-Gg: AfdE7cl9b6NRZCyssSXEM/33GpDlIfEmPe5NY3YgwxA2PwPFTIfrMlupyKyvdhkN0qP +L5ldBOCSifDlKUO+ASuytxy9KyssnyV3Rc50se/IbJJ0J6505qwwA1m5WISURptXnmIKYBShzD QtR+vf3bhydFj2ZW2qbdqPU1iWhFx0HbGB2dpl8LRXLlPFs7uxgy4X9eRnsynnHA2smpKFRh54O fS72Kqa0/TVqChn/u+lO+CT7sqdEmK6/BHXaHm2ih0K12+6aOtLk30cktJ7nXyvxOlm3MpPAOa5 5JIr/PwJ0DrA9qbMv25RIeZ2/VKC6jgP3XU/tsfni4dryXGtR0zMlEbcpCjdBCgsRpErHv/J4i+ uedEfARaaNbFZH0PIA9704pIwOcqqomhn088ZoJ0m+0XT X-Received: by 2002:a17:903:388c:b0:2cc:9773:1313 with SMTP id d9443c01a7336-2ce9ebf84f7mr162566995ad.11.1784124651292; Wed, 15 Jul 2026 07:10:51 -0700 (PDT) X-Received: by 2002:a17:903:388c:b0:2cc:9773:1313 with SMTP id d9443c01a7336-2ce9ebf84f7mr162566465ad.11.1784124650754; Wed, 15 Jul 2026 07:10:50 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:50 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:00 +0530 Subject: [PATCH v9 06/14] media: iris: Enable Secure PAS support with IOMMU managed by Linux Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-6-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Mukesh Ojha X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=7611; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=Wuzgz1rzYvmDPB16a5Puzh+s48WQEHTanWtzd6CqHlE=; b=odkLVJ4nr2zh2Z+CcxNiUkSjlLIjbEJAXhQ1GWbxqSD1k9DkP4ivWYWIYf1kfAlbH2uZ6Q8y7 arzPAi5rPLwAw8+W8GONX/QbpMg2zWInOYrEwk1O9HXmrc+jEcvSA4/ X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: I-K3sxyu5xBcdkA9U0n67reJPQnqJgu9 X-Authority-Analysis: v=2.4 cv=KOlqylFo c=1 sm=1 tr=0 ts=6a5794ec cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=U8OLdchxA3Z7P0hrdlYA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX5ooSzgp3P6df ViDRoqH7xxM138y8fkGLgGSk9GFS1t+/eX7HDWz9S4dfFTMd0FLPJKXTvdd2NI3gQuCyJp+Yh9Y L4rcAqZzPv4GlUTxuyy9Sr4YRIsTyGb1K9OANhjBXRBXs/+WnO8pgoUH9eqS2iLW9dOpMgiNqPd b9lyGwI6vqROtB7WUmSlVuGDjL/lj4/oCcI08dY29y1S4owJS0Q3pdZNwiZmDIs1l/SCmtiYbcB HMR/dymycXth+COgQX+GclnnfXtPpwvB/LhN0U4qme79vXIql8fnG8efz1nR3corRzmwsACQUfS PTldJ7Xo1tZUbdzoUtu/O9YpFKqrxPkDRypfa0YHZAO6tXyfxk92OGuz+NDGi+xIoRnUHyXFLeJ whFJ/A0rhpB9fLgmM0zxR463Y14EWjYSMQrP23j+J67skdONs4YDra0xeEScgUu5wUWRU3GZwDo sRs0dt3TV0jhKdUuJ+Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX/G/cPj98IPs1 htEZJevLL2xM93HhiSmi6x7mis4mmjP0EJoaq5EBDv5t9ihUrTEjPqwxrnL7ue+KO5Uq4nRjeLm bxhr0/8z/aa4hy9EQ5RMeKDxjd5Sa/U= X-Proofpoint-ORIG-GUID: I-K3sxyu5xBcdkA9U0n67reJPQnqJgu9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Mukesh Ojha On platforms where a hypervisor is present, all Secure Monitor Calls (SMC) are intercepted. For qcom_scm_pas_auth_and_reset(), the hypervisor registers a Shared Memory (SHM) bridge over the Peripheral Image Loader (PIL) memory region so that TrustZone (TZ) can access it, forwards the authentication SMC to TZ, and upon return maps the PIL region and triggers the co-processor bring-up sequence: HLOS -> Hypervisor(SHM setup) -> TZ(auth) -> Hypervisor(map+reset) -> IRIS On platforms without a hypervisor, Linux drives these steps directly. The SHM bridge infrastructure required for this is already upstream [1]. To isolate firmware memory in its own Input-Output Memory Management Unit (IOMMU) context, a dedicated stream ID (SID) is required, tied to the firmware function ID. This SID is specified via the iommu-map property in the device tree using the firmware function ID as the lookup key. A firmware device is created and mapped to this SID. The presence of a SID mapped to the firmware device via iommu-map is used to detect whether a hypervisor is absent: when the firmware device has a SID mapped, Linux manages the IOMMU directly; when no SID is mapped, a hypervisor is assumed to be present and these steps are skipped. Extend the Iris driver to support Secure Peripheral Authentication Service (PAS) on platforms where Linux manages the IOMMU, by creating the firmware context device and performing the necessary IOMMU mapping when the firmware device SID is present. [1] https://lore.kernel.org/lkml/20260105-kvmrprocv10-v10-0-022e96815380 @oss.qualcomm.com/ Reviewed-by: Vishnu Reddy Co-developed-by: Vikash Garodia Signed-off-by: Vikash Garodia Signed-off-by: Mukesh Ojha Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/lkml/20260105-kvmrprocv10-v10-0-022e96815380@= oss.qualcomm.com/ Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_core.h | 4 ++ drivers/media/platform/qcom/iris/iris_firmware.c | 73 ++++++++++++++++++++= ---- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 3c96f46cf567..5ed2ec0b97ec 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -38,6 +38,8 @@ struct qcom_ubwc_cfg_data; * @dev: reference to device structure * @np_dev: reference to non-pixel device structure * @p_dev: reference to pixel device structure + * @fw_dev: reference to firmware device structure + * @pas_ctx: PAS context for authenticated firmware load and shutdown * @reg_base: IO memory base address * @irq: iris irq * @v4l2_dev: a holder for v4l2 device structure @@ -85,6 +87,8 @@ struct iris_core { struct device *dev; struct device *np_dev; struct device *p_dev; + struct device *fw_dev; + struct qcom_pas_context *pas_ctx; void __iomem *reg_base; int irq; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/med= ia/platform/qcom/iris/iris_firmware.c index 1a476146d758..56c477b36b61 100644 --- a/drivers/media/platform/qcom/iris/iris_firmware.c +++ b/drivers/media/platform/qcom/iris/iris_firmware.c @@ -4,7 +4,9 @@ */ =20 #include +#include #include +#include #include #include #include @@ -15,11 +17,14 @@ #define IRIS_PAS_ID 9 =20 #define MAX_FIRMWARE_NAME_SIZE 128 +#define IRIS_FW_START_ADDR 0 =20 static int iris_load_fw_to_memory(struct iris_core *core, const char *fw_n= ame) { + struct device *fw_dev =3D core->fw_dev ? core->fw_dev : core->dev; const struct firmware *firmware =3D NULL; - struct device *dev =3D core->dev; + struct qcom_pas_context *ctx; + struct iommu_domain *domain; struct resource res; phys_addr_t mem_phys; size_t res_size; @@ -30,14 +35,21 @@ static int iris_load_fw_to_memory(struct iris_core *cor= e, const char *fw_name) if (strlen(fw_name) >=3D MAX_FIRMWARE_NAME_SIZE - 4) return -EINVAL; =20 - ret =3D of_reserved_mem_region_to_resource(dev->of_node, 0, &res); + ret =3D of_reserved_mem_region_to_resource(core->dev->of_node, 0, &res); if (ret) return ret; =20 mem_phys =3D res.start; res_size =3D resource_size(&res); =20 - ret =3D request_firmware(&firmware, fw_name, dev); + if (!core->pas_ctx) { + ctx =3D devm_qcom_pas_context_alloc(core->dev, IRIS_PAS_ID, mem_phys, re= s_size); + if (IS_ERR(ctx)) + return PTR_ERR(ctx); + core->pas_ctx =3D ctx; + } + + ret =3D request_firmware(&firmware, fw_name, fw_dev); if (ret) return ret; =20 @@ -53,9 +65,23 @@ static int iris_load_fw_to_memory(struct iris_core *core= , const char *fw_name) goto err_release_fw; } =20 - ret =3D qcom_mdt_load(dev, firmware, fw_name, - IRIS_PAS_ID, mem_virt, mem_phys, res_size, NULL); + core->pas_ctx->use_tzmem =3D !!core->fw_dev; + ret =3D qcom_mdt_pas_load(core->pas_ctx, firmware, fw_name, mem_virt, NUL= L); + if (ret) + goto err_mem_unmap; + + if (core->pas_ctx->use_tzmem) { + domain =3D iommu_get_domain_for_dev(fw_dev); + if (!domain) { + ret =3D -ENODEV; + goto err_mem_unmap; + } + + ret =3D iommu_map(domain, IRIS_FW_START_ADDR, mem_phys, res_size, + IOMMU_READ | IOMMU_WRITE | IOMMU_PRIV, GFP_KERNEL); + } =20 +err_mem_unmap: memunmap(mem_virt); err_release_fw: release_firmware(firmware); @@ -63,6 +89,18 @@ static int iris_load_fw_to_memory(struct iris_core *core= , const char *fw_name) return ret; } =20 +static void iris_fw_iommu_unmap(struct iris_core *core) +{ + struct iommu_domain *domain; + + if (!core->fw_dev) + return; + + domain =3D iommu_get_domain_for_dev(core->fw_dev); + if (domain) + iommu_unmap(domain, IRIS_FW_START_ADDR, core->pas_ctx->mem_size); +} + int iris_fw_load(struct iris_core *core) { const struct tz_cp_config *cp_config; @@ -77,13 +115,13 @@ int iris_fw_load(struct iris_core *core) ret =3D iris_load_fw_to_memory(core, fwpath); if (ret) { dev_err(core->dev, "firmware download failed\n"); - return -ENOMEM; + return ret; } =20 - ret =3D qcom_scm_pas_auth_and_reset(IRIS_PAS_ID); + ret =3D qcom_pas_prepare_and_auth_reset(core->pas_ctx); if (ret) { dev_err(core->dev, "auth and reset failed: %d\n", ret); - return ret; + goto err_unmap; } =20 for (i =3D 0; i < core->iris_platform_data->tz_cp_config_data_size; i++) { @@ -94,20 +132,31 @@ int iris_fw_load(struct iris_core *core) cp_config->cp_nonpixel_size); if (ret) { dev_err(core->dev, "qcom_scm_mem_protect_video_var failed: %d\n", ret); - qcom_scm_pas_shutdown(IRIS_PAS_ID); - return ret; + goto err_pas_shutdown; } } =20 + return 0; + +err_pas_shutdown: + qcom_pas_shutdown(IRIS_PAS_ID); +err_unmap: + iris_fw_iommu_unmap(core); + return ret; } =20 int iris_fw_unload(struct iris_core *core) { - return qcom_scm_pas_shutdown(IRIS_PAS_ID); + int ret; + + ret =3D qcom_pas_shutdown(IRIS_PAS_ID); + iris_fw_iommu_unmap(core); + + return ret; } =20 int iris_set_hw_state(struct iris_core *core, bool resume) { - return qcom_scm_set_remote_state(resume, 0); + return qcom_pas_set_remote_state(resume, 0); } --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9360B37DE99 for ; Wed, 15 Jul 2026 14:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124663; cv=none; b=JI9iD1GaOFc0EI9iBdEX0igA+WtqLs6YSWxmm0kEf7mYgHbhs1J4wB9iPUBYvAGjGa/jzyjYGplUBSbIemqk6ycxZQ6ufuVCuEjd0QG5OuYCboEFE74P4SAzUAGLUo/1xRRVfrvBxF3ycdy5PER1vPZkCLpcKnWxTMUCH5VQmek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124663; c=relaxed/simple; bh=7242Y0iw4NSOYIhVK1zpZvQSQU4cWJ9dObzrJoH9mdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u4dCStwiirmno/BqEO8w2dcgRnl4ttLDR/Vmy8hXChCMl8hkPkC6OaDLIPYUCQQp5gXkE80tC1CgnCfriMo8bzS5RJmXpbub4tzY21yWITdPc/P2WuF2R4ZlmYvQGd0U25cqv2STstueS1GhwqU4epo1znsd3R0ruqCqsOrxj6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=YJppYkM3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ckDUc9nq; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="YJppYkM3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ckDUc9nq" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3Tvf3775588 for ; Wed, 15 Jul 2026 14:10:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= DmrbTTohhGCukdUlYLk+eYL+AStMAIy/qbQaNaI5pWk=; b=YJppYkM3okcKjDUS HTKTsyClf2CDRd1Ocr4wsYzsn8gd3gW6tfmyhkZd7Nv/ngofXpDglrakKb+aTcI4 aDKuZBkrGXMFvL0Tr9GONoKkJN6U5aa767oSn40G0pVGgMOj1onJ2Ue9+EYnoVmG Xk2Lb2U5XpzD7vKOF/Mgwjk+LKSLx0p6OsA0oMI0iYLeeGA9PSgZuLbVFGs6vgb4 VPpXkAqJEBh/EQFaWMMcoQN0SNbQ64Wver/0t25k7SsveFXhbyy8TXy5evmChBFf HuezTNy8INMPRZIS2ucfxvIvaMw34vvb26pZCcOxSuY/NNhl18l3ZsNCmDr5NvYY bxsP9A== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe7ka9456-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:10:59 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2ca5d2474c7so58642545ad.2 for ; Wed, 15 Jul 2026 07:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124659; x=1784729459; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DmrbTTohhGCukdUlYLk+eYL+AStMAIy/qbQaNaI5pWk=; b=ckDUc9nqyEZFjh/KrMfE8rTC3g4/raLJ6F+DA9IOfze8y8Pf51XX1hyaTPFi5Ezr8D qDYThaKeWmycUpFQIyNH8PbInebrS28tj6Ag38+7arR/RcjWGVLeM6ke1MhYd/v5P6rO EvrOsOCdRpswGEO9C6qspKpJhazB5Hs4QXaahkfK7H+d23axfLTVqW4Ny3NdOv9j6wtm MfDS3sZmTgFtO9vvKNVbIGFM2npy8zIIRx6TDO+R8a+cj53jka6EU23RFnqwGrxlEkju AIktpfLxDQwlQs38jFm5jp8Owt3cBghDhT5bX+nfl1axZQ46GD8kUTAzHdzARu78/zw2 NyJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124659; x=1784729459; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DmrbTTohhGCukdUlYLk+eYL+AStMAIy/qbQaNaI5pWk=; b=ORkfxRo/wb6EubZKxJBoZz7uNUVBXnsuJn6z6lkl/Mqeu2+PyteNh8WcEwPN+kqGFQ JQQKYtGW0QZJdTYOPTGtuidysuqywITVlsQJfp+n66yZAtH9wYJ5eUvSmul97OCXkTOf LXQjbMi7cnbv3U9rhMDcltc85KdtmcpApt0jAFOJI+ZbAurjy9Yrutiw84wX7pHmjLot QXwYfaPj5DllDL9g/oNM1FuxvM+PGwMeJfliXjcljsP5ND7o2+evaWXCfiu3aJWyrjYa hVBUS0Ojh4/9xdxb65e6/eAs1hTxR6Q8ti5LoqlKw0SHtOYsKnfcbvL+M1QFf8xl9fCo yXdw== X-Gm-Message-State: AOJu0YxPlc6CSo90ItO8n+WreIfmku0/r7s8F5tG8UfbBIZRVeskQ1Vp LsCyC8T3EtYsDNNGe1t+MaFhNPAMQaqV4uLUuNM12UMeuvT395t2kolESEIQNJixFzU5LGBtxkI fSlKlhvEt9QYHwPseUtf83FmNsdpeqWW85uHoBFoeaNb/we9MbPL//uqqhkxzefcPvk7tJe1pbM 4= X-Gm-Gg: AfdE7cmzSXmjGedLKiUUYZanbnGRQfEM2CnhHVB4NZq+w87O3E6M5W7KkHz9bIF4/QC oS6jFFsyHCU6H2bjZYevf92k2oP3yhF6ziKG2ePSBTAmEKv7LhvvK6/AU3u44wFTyQu41+Abpj5 9apq93H7PX9CVb0S4hkWLTetQcFacuAVshKKqwmH6DJD2ygQjHRil6xTQdIB323zIJEyHBSaDhg asJ1rG3TiKMIQ96u7suzhJK3Gbdr8rmztky/RIJzV0SiL4kB+PHn7K2fkaXAfBMqvNWwys6i5GP cnMEgeCKCIyum/88hLfjiHPKRyQE/wLD1ZbfXIdl/JFtUiezYNneZ0k6R8yAY8B2SKa0PX5ahS1 iylt6nSQkz4uTPn9hr9h9NMM0fIt0u1gEx5djTEqChbqD X-Received: by 2002:a17:902:ef0a:b0:2ca:9ab:e725 with SMTP id d9443c01a7336-2ce9e59d62cmr183257325ad.1.1784124658266; Wed, 15 Jul 2026 07:10:58 -0700 (PDT) X-Received: by 2002:a17:902:ef0a:b0:2ca:9ab:e725 with SMTP id d9443c01a7336-2ce9e59d62cmr183256675ad.1.1784124657410; Wed, 15 Jul 2026 07:10:57 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:10:57 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:01 +0530 Subject: [PATCH v9 07/14] media: iris: Replace enum-indexed clock and power domain tables with per-block structures Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-7-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=43859; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=7242Y0iw4NSOYIhVK1zpZvQSQU4cWJ9dObzrJoH9mdM=; b=9edwqcZCBZ7R2CAW2oSkVZTP1WloqYrusLMMQd3pgQGAg5EBW/Oy8PQFbqLrYRcWGHlc9O8uJ gs3nGiBe8yWAqnyv3zCSGn/nVKLgVFYdCyzt0yaV4S7M4ir0W33UChI X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=TMF1jVla c=1 sm=1 tr=0 ts=6a5794f3 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=oG6sQh-P3z_XRahHWLcA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: R_0XpuMzPrygJQypMLV8gNElcIiIvtsQ X-Proofpoint-ORIG-GUID: R_0XpuMzPrygJQypMLV8gNElcIiIvtsQ X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX3X0/pwwlmvaZ zn8hY8i/lojHrgaZaGYXl55ONjWSvHIVDXWFveaxb+v0BO6dUc3baY28XHtNYRD/YaSOP6NQ/OE bVjcpa4UVj88kqcISRUuqMV4v+T8SJY= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX5VL80vaIXjBK b9S84NOxryp/gDwPQ5WoSUsDoIoaHCDIQRroY9TQWF7FnmjBEGfSW9NXMeQFfySEKtPt2sXSiGN dTd9NvZYfdI2uNgNYA9Y2QRqCVqsqx/iUL4FfZtMUliQcjf07bSySEn0EY41tB7yd6jiTOCO5Q9 T5toO6HwtnH3VDh3P7lvYxWlX569kyHOrVYba+8eZsrnZhcOYy4YIdhWfxzHOcwZqsrIKmV/0Ss SAs8qJ+IlpSW3Po/uc9istC/4z/uL7kIOJ3o0FmDBgcnofJ4i1HUBe8UTC9OPs8+bSa7NiD2l8N XxxiqW51oPWXDGp+UM4xp65AtebP+B/Uho4sQPgJTbY2vjRKej+FSesKaXb2XxUBwRsmR29NxAp Y4SwDeL7ptOAJCNurev0Hf8/RrQ+JRHNL1BGH6nJE676KXC6EW2eKM0yL5Z97PbdqyRZEdW4R4o 3GK00E8NURloi29DR+w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 phishscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 As new platforms are added, the platform_clk_type and platform_pm_domain_type enums keep growing. Every new clock or power domain requires a new enum entry, and every enable/disable path has to loop through the clock table to find the right clock by enum value, adding overhead and boilerplate on each path. The enum index space is also shared across all hardware blocks. On the Glymur platform, the VPP0 index for VPU4x and the VCODEC1 index clash, making it error-prone to extend support without breaking existing platforms. Replace the flat tables and enum-based lookups with iris_power_domain, which bundles a power domain device and its associated clocks together per hardware block. Platform data describes each block via iris_power_domain_data, and the enable and disable helpers operate directly on an iris_power_domain instance, removing the need for any index lookup at runtime. Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_core.h | 23 +++- .../platform/qcom/iris/iris_platform_common.h | 41 ++---- .../platform/qcom/iris/iris_platform_sc7280.h | 28 ++++- .../platform/qcom/iris/iris_platform_sm8250.h | 26 +++- .../platform/qcom/iris/iris_platform_sm8550.h | 26 +++- .../platform/qcom/iris/iris_platform_sm8750.h | 29 +++-- .../media/platform/qcom/iris/iris_platform_vpu2.c | 14 +-- .../media/platform/qcom/iris/iris_platform_vpu3x.c | 32 ++--- .../platform/qcom/iris/iris_platform_x1p42100.h | 27 +++- drivers/media/platform/qcom/iris/iris_probe.c | 134 +++++++++++++++++= +-- drivers/media/platform/qcom/iris/iris_resources.c | 82 +++++------- drivers/media/platform/qcom/iris/iris_resources.h | 8 +- drivers/media/platform/qcom/iris/iris_vpu3x.c | 37 +----- drivers/media/platform/qcom/iris/iris_vpu4x.c | 137 +++--------------= ---- drivers/media/platform/qcom/iris/iris_vpu_common.c | 98 ++------------- 15 files changed, 341 insertions(+), 401 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 5ed2ec0b97ec..f528f53f20fc 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -16,6 +16,13 @@ #include "iris_resources.h" #include "iris_state.h" =20 +struct iris_power_domain { + struct device **dev; + unsigned int pd_cnt; + struct clk_bulk_data *clocks; + unsigned int clk_cnt; +}; + struct icc_info { const char *name; u32 bw_min_kbps; @@ -51,10 +58,12 @@ struct qcom_ubwc_cfg_data; * @iris_vb2_ops: iris vb2 ops * @icc_tbl: table of iris interconnects * @icc_count: count of iris interconnects - * @pmdomain_tbl: table of iris power domains + * @ctrl: power domain and clocks for the controller + * @vcodec: power domain and clocks for the vcodec + * @vcodec_vpp0: power domain and clocks for the vcodec VPP0 + * @vcodec_vpp1: power domain and clocks for the vcodec VPP1 + * @apv: power domain and clocks for the APV hardware block * @opp_pmdomain_tbl: table of opp power domains - * @clock_tbl: table of iris clocks - * @clk_count: count of iris clocks * @resets: table of iris reset clocks * @controller_resets: table of controller reset clocks * @iris_platform_data: a structure for platform data @@ -100,10 +109,12 @@ struct iris_core { const struct vb2_ops *iris_vb2_ops; struct icc_bulk_data *icc_tbl; u32 icc_count; - struct dev_pm_domain_list *pmdomain_tbl; + struct iris_power_domain *ctrl; + struct iris_power_domain *vcodec; + struct iris_power_domain *vcodec_vpp0; + struct iris_power_domain *vcodec_vpp1; + struct iris_power_domain *apv; struct dev_pm_domain_list *opp_pmdomain_tbl; - struct clk_bulk_data *clock_tbl; - u32 clk_count; struct reset_control_bulk_data *resets; struct reset_control_bulk_data *controller_resets; const struct iris_platform_data *iris_platform_data; diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index c9256f2323dc..99f59b64f853 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -61,26 +61,6 @@ extern const struct iris_platform_data sm8650_data; extern const struct iris_platform_data sm8750_data; extern const struct iris_platform_data x1p42100_data; =20 -enum platform_clk_type { - IRIS_AXI_CLK, /* AXI0 in case of platforms with multiple AXI clocks */ - IRIS_CTRL_CLK, - IRIS_AHB_CLK, - IRIS_HW_CLK, - IRIS_HW_AHB_CLK, - IRIS_AXI1_CLK, - IRIS_CTRL_FREERUN_CLK, - IRIS_HW_FREERUN_CLK, - IRIS_BSE_HW_CLK, - IRIS_VPP0_HW_CLK, - IRIS_VPP1_HW_CLK, - IRIS_APV_HW_CLK, -}; - -struct platform_clk_data { - enum platform_clk_type clk_type; - const char *clk_name; -}; - struct tz_cp_config { u32 cp_start; u32 cp_size; @@ -228,12 +208,11 @@ struct icc_vote_data { u32 fps; }; =20 -enum platform_pm_domain_type { - IRIS_CTRL_POWER_DOMAIN, - IRIS_HW_POWER_DOMAIN, - IRIS_VPP0_HW_POWER_DOMAIN, - IRIS_VPP1_HW_POWER_DOMAIN, - IRIS_APV_HW_POWER_DOMAIN, +struct iris_power_domain_data { + const char * const *pd_names; + unsigned int pd_cnt; + const char * const *clk_names; + unsigned int clk_cnt; }; =20 struct iris_firmware_data { @@ -300,13 +279,14 @@ struct iris_platform_data { unsigned int icc_tbl_size; const struct bw_info *bw_tbl_dec; unsigned int bw_tbl_dec_size; - const char * const *pmdomain_tbl; - unsigned int pmdomain_tbl_size; + const struct iris_power_domain_data *ctrl_data; + const struct iris_power_domain_data *vcodec_data; + const struct iris_power_domain_data *vcodec_vpp0_data; + const struct iris_power_domain_data *vcodec_vpp1_data; + const struct iris_power_domain_data *apv_data; const char * const *opp_pd_tbl; unsigned int opp_pd_tbl_size; - const struct platform_clk_data *clk_tbl; const char * const *opp_clk_tbl; - unsigned int clk_tbl_size; const char * const *clk_rst_tbl; unsigned int clk_rst_tbl_size; const char * const *controller_rst_tbl; @@ -320,6 +300,7 @@ struct iris_platform_data { u32 num_vpp_pipe; bool no_aon; u32 max_session_count; + u32 num_cores; /* max number of macroblocks per frame supported */ u32 max_core_mbpf; /* max number of macroblocks per second supported */ diff --git a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h b/driv= ers/media/platform/qcom/iris/iris_platform_sc7280.h index 0ec8f334df67..f19547a8a51d 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h @@ -15,12 +15,28 @@ static const struct bw_info sc7280_bw_table_dec[] =3D { =20 static const char * const sc7280_opp_pd_table[] =3D { "cx" }; =20 -static const struct platform_clk_data sc7280_clk_table[] =3D { - {IRIS_CTRL_CLK, "core" }, - {IRIS_AXI_CLK, "iface" }, - {IRIS_AHB_CLK, "bus" }, - {IRIS_HW_CLK, "vcodec_core" }, - {IRIS_HW_AHB_CLK, "vcodec_bus" }, +static const struct iris_power_domain_data sc7280_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", "bus", + }, + .clk_cnt =3D 3, +}; + +static const struct iris_power_domain_data sc7280_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec_core", "vcodec_bus", + }, + .clk_cnt =3D 2, + }, }; =20 static const char * const sc7280_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8250.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8250.h index 50306043eb8e..7674cf9a330f 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8250.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8250.h @@ -15,10 +15,28 @@ static const struct bw_info sm8250_bw_table_dec[] =3D { =20 static const char * const sm8250_opp_pd_table[] =3D { "mx", "mmcx" }; =20 -static const struct platform_clk_data sm8250_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, +static const struct iris_power_domain_data sm8250_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data sm8250_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", + }, + .clk_cnt =3D 1, + }, }; =20 static const char * const sm8250_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8550.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8550.h index 3c9dae995bb2..71de71a75e95 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8550.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8550.h @@ -8,10 +8,28 @@ =20 static const char * const sm8550_clk_reset_table[] =3D { "bus" }; =20 -static const struct platform_clk_data sm8550_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, +static const struct iris_power_domain_data sm8550_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data sm8550_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", + }, + .clk_cnt =3D 1, + }, }; =20 static struct platform_inst_caps platform_inst_cap_sm8550 =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8750.h b/driv= ers/media/platform/qcom/iris/iris_platform_sm8750.h index 719056656a5b..45ab78781f4a 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8750.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8750.h @@ -10,13 +10,28 @@ static const char * const sm8750_clk_reset_table[] =3D { "bus0", "bus1", "core", "vcodec0_core" }; =20 -static const struct platform_clk_data sm8750_clk_table[] =3D { - {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" }, +static const struct iris_power_domain_data sm8750_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface1", "core_freerun", "core", + }, + .clk_cnt =3D 3, +}; + +static const struct iris_power_domain_data sm8750_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "vcodec0_core_freerun", "vcodec0_core", + }, + .clk_cnt =3D 3, + }, }; =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c b/driver= s/media/platform/qcom/iris/iris_platform_vpu2.c index 6e06a32822bb..c381a40da9ba 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu2.c @@ -53,8 +53,6 @@ static const struct icc_info iris_icc_info_vpu2[] =3D { =20 static const char * const iris_clk_reset_table_vpu2[] =3D { "bus", "core" = }; =20 -static const char * const iris_pmdomain_table_vpu2[] =3D { "venus", "vcode= c0" }; - static const struct tz_cp_config tz_cp_config_vpu2[] =3D { { .cp_start =3D 0, @@ -71,12 +69,10 @@ const struct iris_platform_data sc7280_data =3D { .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu2), .bw_tbl_dec =3D sc7280_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), - .pmdomain_tbl =3D iris_pmdomain_table_vpu2, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .ctrl_data =3D &sc7280_ctrl_data, + .vcodec_data =3D sc7280_vcodec_data, .opp_pd_tbl =3D sc7280_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sc7280_opp_pd_table), - .clk_tbl =3D sc7280_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sc7280_clk_table), .opp_clk_tbl =3D sc7280_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -102,12 +98,10 @@ const struct iris_platform_data sm8250_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(iris_clk_reset_table_vpu2), .bw_tbl_dec =3D sm8250_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), - .pmdomain_tbl =3D iris_pmdomain_table_vpu2, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu2), + .ctrl_data =3D &sm8250_ctrl_data, + .vcodec_data =3D sm8250_vcodec_data, .opp_pd_tbl =3D sm8250_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8250_opp_pd_table), - .clk_tbl =3D sm8250_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8250_clk_table), .opp_clk_tbl =3D sm8250_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drive= rs/media/platform/qcom/iris/iris_platform_vpu3x.c index 2c63adbc5579..72dd23dbe02a 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -67,8 +67,6 @@ static const struct bw_info iris_bw_table_dec_vpu3x[] =3D= { { ((1920 * 1080) / 256) * 30, 294000 }, }; =20 -static const char * const iris_pmdomain_table_vpu3x[] =3D { "venus", "vcod= ec0" }; - static const char * const iris_opp_pd_table_vpu3x[] =3D { "mxc", "mmcx" }; =20 static const char * const iris_opp_clk_table_vpu3x[] =3D { @@ -98,12 +96,10 @@ const struct iris_platform_data qcs8300_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -127,12 +123,10 @@ const struct iris_platform_data sm8550_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -164,12 +158,10 @@ const struct iris_platform_data sm8650_data =3D { .controller_rst_tbl_size =3D ARRAY_SIZE(sm8650_controller_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8550_ctrl_data, + .vcodec_data =3D sm8550_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8550_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8550_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -193,12 +185,10 @@ const struct iris_platform_data sm8750_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8750_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &sm8750_ctrl_data, + .vcodec_data =3D sm8750_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D sm8750_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(sm8750_clk_table), .opp_clk_tbl =3D iris_opp_clk_table_vpu3x, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, @@ -228,12 +218,10 @@ const struct iris_platform_data x1p42100_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), - .pmdomain_tbl =3D iris_pmdomain_table_vpu3x, - .pmdomain_tbl_size =3D ARRAY_SIZE(iris_pmdomain_table_vpu3x), + .ctrl_data =3D &x1p42100_ctrl_data, + .vcodec_data =3D x1p42100_vcodec_data, .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), - .clk_tbl =3D x1p42100_clk_table, - .clk_tbl_size =3D ARRAY_SIZE(x1p42100_clk_table), .opp_clk_tbl =3D x1p42100_opp_clk_table, /* Upper bound of DMA address range */ .dma_mask =3D 0xe0000000 - 1, diff --git a/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h b/dr= ivers/media/platform/qcom/iris/iris_platform_x1p42100.h index d89acfbc1233..3444c1c3012b 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h +++ b/drivers/media/platform/qcom/iris/iris_platform_x1p42100.h @@ -6,11 +6,28 @@ #ifndef __IRIS_PLATFORM_X1P42100_H__ #define __IRIS_PLATFORM_X1P42100_H__ =20 -static const struct platform_clk_data x1p42100_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, - {IRIS_BSE_HW_CLK, "vcodec0_bse" }, +static const struct iris_power_domain_data x1p42100_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "iface", "core", + }, + .clk_cnt =3D 2, +}; + +static const struct iris_power_domain_data x1p42100_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_core", "vcodec0_bse", + }, + .clk_cnt =3D 2, + }, }; =20 static const char *const x1p42100_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index c40c4ec44e83..9e96fa218dea 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -40,15 +40,42 @@ static int iris_init_icc(struct iris_core *core) return devm_of_icc_bulk_get(core->dev, core->icc_count, core->icc_tbl); } =20 -static int iris_init_power_domains(struct iris_core *core) +static int iris_init_power_domains_per_block(struct iris_core *core, + struct iris_power_domain *pd, + const struct iris_power_domain_data *pd_data) { - int ret; + struct dev_pm_domain_attach_data iris_pd_data =3D {}; + struct dev_pm_domain_list *pmdomain_tbl; + int ret, i; =20 - struct dev_pm_domain_attach_data iris_pd_data =3D { - .pd_names =3D core->iris_platform_data->pmdomain_tbl, - .num_pd_names =3D core->iris_platform_data->pmdomain_tbl_size, - .pd_flags =3D PD_FLAG_NO_DEV_LINK, - }; + if (!pd_data->pd_cnt) + return -EINVAL; + + iris_pd_data.pd_names =3D pd_data->pd_names; + iris_pd_data.num_pd_names =3D pd_data->pd_cnt; + iris_pd_data.pd_flags =3D PD_FLAG_NO_DEV_LINK; + + ret =3D devm_pm_domain_attach_list(core->dev, &iris_pd_data, &pmdomain_tb= l); + if (ret < 0) + return ret; + + pd->pd_cnt =3D ret; + + pd->dev =3D devm_kzalloc(core->dev, pd->pd_cnt * sizeof(*pd->dev), GFP_KE= RNEL); + if (!pd->dev) + return -ENOMEM; + + for (i =3D 0; i < pd->pd_cnt; i++) + pd->dev[i] =3D pmdomain_tbl->pd_devs[i]; + + return 0; +} + +static int iris_init_power_domains(struct iris_core *core) +{ + const struct iris_platform_data *plat =3D core->iris_platform_data; + unsigned int num_cores =3D max(plat->num_cores, 1); + int i, ret; =20 struct dev_pm_domain_attach_data iris_opp_pd_data =3D { .pd_names =3D core->iris_platform_data->opp_pd_tbl, @@ -61,10 +88,57 @@ static int iris_init_power_domains(struct iris_core *co= re) .config_clks =3D dev_pm_opp_config_clks_simple, }; =20 - ret =3D devm_pm_domain_attach_list(core->dev, &iris_pd_data, &core->pmdom= ain_tbl); - if (ret < 0) + core->ctrl =3D devm_kzalloc(core->dev, sizeof(*core->ctrl), GFP_KERNEL); + if (!core->ctrl) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->ctrl, plat->ctrl_da= ta); + if (ret) return ret; =20 + core->vcodec =3D devm_kzalloc(core->dev, num_cores * sizeof(*core->vcodec= ), GFP_KERNEL); + if (!core->vcodec) + return -ENOMEM; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_init_power_domains_per_block(core, &core->vcodec[i], + &plat->vcodec_data[i]); + if (ret) + return ret; + } + + if (plat->vcodec_vpp0_data) { + core->vcodec_vpp0 =3D devm_kzalloc(core->dev, sizeof(*core->vcodec_vpp0)= , GFP_KERNEL); + if (!core->vcodec_vpp0) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->vcodec_vpp0, + plat->vcodec_vpp0_data); + if (ret) + return ret; + } + + if (plat->vcodec_vpp1_data) { + core->vcodec_vpp1 =3D devm_kzalloc(core->dev, sizeof(*core->vcodec_vpp1)= , GFP_KERNEL); + if (!core->vcodec_vpp1) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->vcodec_vpp1, + plat->vcodec_vpp1_data); + if (ret) + return ret; + } + + if (plat->apv_data) { + core->apv =3D devm_kzalloc(core->dev, sizeof(*core->apv), GFP_KERNEL); + if (!core->apv) + return -ENOMEM; + + ret =3D iris_init_power_domains_per_block(core, core->apv, plat->apv_dat= a); + if (ret) + return ret; + } + ret =3D devm_pm_domain_attach_list(core->dev, &iris_opp_pd_data, &core->= opp_pmdomain_tbl); /* backwards compatibility for incomplete ABI SM8250 */ if (ret =3D=3D -ENODEV && @@ -83,17 +157,51 @@ static int iris_init_power_domains(struct iris_core *c= ore) return devm_pm_opp_of_add_table(core->dev); } =20 +static int iris_init_clocks_per_block(struct iris_core *core, struct iris_= power_domain *pd, + const struct iris_power_domain_data *pd_data) +{ + unsigned int i; + + if (!pd_data) + return 0; + + pd->clk_cnt =3D pd_data->clk_cnt; + pd->clocks =3D devm_kcalloc(core->dev, pd->clk_cnt, sizeof(*pd->clocks), = GFP_KERNEL); + if (!pd->clocks) + return -ENOMEM; + + for (i =3D 0; i < pd->clk_cnt; i++) + pd->clocks[i].id =3D pd_data->clk_names[i]; + + return devm_clk_bulk_get(core->dev, pd->clk_cnt, pd->clocks); +} + static int iris_init_clocks(struct iris_core *core) { + const struct iris_platform_data *plat =3D core->iris_platform_data; + unsigned int num_cores =3D max(plat->num_cores, 1); + unsigned int i; int ret; =20 - ret =3D devm_clk_bulk_get_all(core->dev, &core->clock_tbl); - if (ret < 0) + ret =3D iris_init_clocks_per_block(core, core->ctrl, plat->ctrl_data); + if (ret) + return ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_init_clocks_per_block(core, &core->vcodec[i], &plat->vcodec= _data[i]); + if (ret) + return ret; + } + + ret =3D iris_init_clocks_per_block(core, core->vcodec_vpp0, plat->vcodec_= vpp0_data); + if (ret) return ret; =20 - core->clk_count =3D ret; + ret =3D iris_init_clocks_per_block(core, core->vcodec_vpp1, plat->vcodec_= vpp1_data); + if (ret) + return ret; =20 - return 0; + return iris_init_clocks_per_block(core, core->apv, plat->apv_data); } =20 static int iris_init_reset_table(struct iris_core *core, diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index 309a593d755b..fd4dd0269223 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -10,7 +10,6 @@ #include #include #include -#include =20 #include "iris_core.h" #include "iris_instance.h" @@ -72,76 +71,63 @@ int iris_opp_set_rate(struct device *dev, unsigned long= freq) return dev_pm_opp_set_opp(dev, opp); } =20 -int iris_enable_power_domains(struct iris_core *core, struct device *pd_de= v) +int iris_enable_power_domain_and_clocks(struct iris_core *core, struct iri= s_power_domain *pd) { - int ret; + int ret, i; =20 ret =3D iris_opp_set_rate(core->dev, ULONG_MAX); if (ret) return ret; =20 - ret =3D pm_runtime_get_sync(pd_dev); - if (ret < 0) - return ret; - - return ret; -} - -int iris_disable_power_domains(struct iris_core *core, struct device *pd_d= ev) -{ - int ret; + for (i =3D 0; i < pd->pd_cnt; i++) { + ret =3D pm_runtime_resume_and_get(pd->dev[i]); + if (ret < 0) + goto error; + } =20 - ret =3D iris_opp_set_rate(core->dev, 0); + ret =3D clk_bulk_prepare_enable(pd->clk_cnt, pd->clocks); if (ret) - return ret; - - pm_runtime_put_sync(pd_dev); + goto error; =20 return 0; -} =20 -static struct clk *iris_get_clk_by_type(struct iris_core *core, enum platf= orm_clk_type clk_type) -{ - const struct platform_clk_data *clk_tbl; - u32 clk_cnt, i, j; - - clk_tbl =3D core->iris_platform_data->clk_tbl; - clk_cnt =3D core->iris_platform_data->clk_tbl_size; - - for (i =3D 0; i < clk_cnt; i++) { - if (clk_tbl[i].clk_type =3D=3D clk_type) { - for (j =3D 0; core->clock_tbl && j < core->clk_count; j++) { - if (!strcmp(core->clock_tbl[j].id, clk_tbl[i].clk_name)) - return core->clock_tbl[j].clk; - } - } - } +error: + iris_opp_set_rate(core->dev, 0); =20 - return NULL; + while (--i >=3D 0) + pm_runtime_put_sync(pd->dev[i]); + + return ret; } =20 -int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_ty= pe clk_type) +void iris_disable_power_domain_and_clocks(struct iris_core *core, struct i= ris_power_domain *pd) { - struct clk *clock; + int i; =20 - clock =3D iris_get_clk_by_type(core, clk_type); - if (!clock) - return -ENOENT; + clk_bulk_disable_unprepare(pd->clk_cnt, pd->clocks); + iris_opp_set_rate(core->dev, 0); =20 - return clk_prepare_enable(clock); + for (i =3D 0; i < pd->pd_cnt; i++) + pm_runtime_put_sync(pd->dev[i]); } =20 -int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk= _type clk_type) +int iris_genpd_set_hwmode(struct iris_power_domain *pd, bool mode) { - struct clk *clock; + int i, ret; =20 - clock =3D iris_get_clk_by_type(core, clk_type); - if (!clock) - return -EINVAL; - - clk_disable_unprepare(clock); + for (i =3D 0; i < pd->pd_cnt; i++) { + ret =3D dev_pm_genpd_set_hwmode(pd->dev[i], mode); + if (ret) + goto error; + } =20 return 0; + +error: + while (--i >=3D 0) + dev_pm_genpd_set_hwmode(pd->dev[i], !mode); + + return ret; } =20 struct device *iris_create_cb_dev(struct iris_core *core, const char *name) diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index 2eef0676a146..36efa89f5d10 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.h +++ b/drivers/media/platform/qcom/iris/iris_resources.h @@ -7,15 +7,15 @@ #define __IRIS_RESOURCES_H__ =20 struct iris_core; +struct iris_power_domain; =20 int iris_opp_set_rate(struct device *dev, unsigned long freq); -int iris_enable_power_domains(struct iris_core *core, struct device *pd_de= v); -int iris_disable_power_domains(struct iris_core *core, struct device *pd_d= ev); 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_ty= pe clk_type); struct device *iris_create_cb_dev(struct iris_core *core, const char *name= ); struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type); +int iris_enable_power_domain_and_clocks(struct iris_core *core, struct iri= s_power_domain *pd); +void iris_disable_power_domain_and_clocks(struct iris_core *core, struct i= ris_power_domain *pd); +int iris_genpd_set_hwmode(struct iris_power_domain *pd, bool mode); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 3dad47be78b5..7cda94601555 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -205,53 +205,20 @@ static int iris_vpu33_power_off_controller(struct iri= s_core *core) val &=3D ~NOC_HALT; writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); =20 - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return 0; } =20 static int iris_vpu35_power_on_hw(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); - if (ret) - goto err_disable_axi_clk; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto err_disable_hw_free_clk; - - return 0; - -err_disable_hw_free_clk: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); -err_disable_axi_clk: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); -err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->vcodec); } =20 static void iris_vpu35_power_off_hw(struct iris_core *core) { iris_vpu33_power_off_hardware(core); - - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); } =20 const struct vpu_ops iris_vpu3_ops =3D { diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index 02e100a4045f..caee9e4351db 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -27,27 +27,24 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core= *core, bool hw_mode, u32 { int ret; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec, hw_mode); if (ret) return ret; =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec_vpp0, hw_mode); if (ret) goto restore_hw_domain_mode; } =20 if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->vcodec_vpp1, hw_mode); if (ret) goto restore_vpp0_domain_mode; } =20 if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs - [IRIS_APV_HW_POWER_DOMAIN], hw_mode); + ret =3D iris_genpd_set_hwmode(core->apv, hw_mode); if (ret) goto restore_vpp1_domain_mode; } @@ -56,37 +53,19 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core= *core, bool hw_mode, u32 =20 restore_vpp1_domain_mode: if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP1_HW_POWER_D= OMAIN], - !hw_mode); + iris_genpd_set_hwmode(core->vcodec_vpp1, !hw_mode); restore_vpp0_domain_mode: if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP0_HW_POWER_D= OMAIN], - !hw_mode); + iris_genpd_set_hwmode(core->vcodec_vpp0, !hw_mode); restore_hw_domain_mode: - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , !hw_mode); + iris_genpd_set_hwmode(core->vcodec, !hw_mode); =20 return ret; } =20 static int iris_vpu4x_power_on_apv(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, - core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_APV_HW_CLK); - if (ret) - goto disable_apv_hw_power_domain; - - return 0; - -disable_apv_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_= POWER_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->apv); } =20 static void iris_vpu4x_power_off_apv(struct iris_core *core) @@ -138,8 +117,7 @@ static void iris_vpu4x_power_off_apv(struct iris_core *= core) writel(0x0, core->reg_base + CPU_CS_APV_BRIDGE_SYNC_RESET); =20 disable_clocks_and_power: - iris_disable_unprepare_clock(core, IRIS_APV_HW_CLK); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_= POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->apv); } =20 static void iris_vpu4x_ahb_sync_reset_apv(struct iris_core *core) @@ -158,116 +136,43 @@ static void iris_vpu4x_ahb_sync_reset_hardware(struc= t iris_core *core) writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); } =20 -static int iris_vpu4x_enable_hardware_clocks(struct iris_core *core, u32 e= fuse_value) -{ - int ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); - if (ret) - goto disable_axi_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto disable_hw_free_run_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK); - if (ret) - goto disable_hw_clock; - - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D iris_prepare_enable_clock(core, IRIS_VPP0_HW_CLK); - if (ret) - goto disable_bse_hw_clock; - } - - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D iris_prepare_enable_clock(core, IRIS_VPP1_HW_CLK); - if (ret) - goto disable_vpp0_hw_clock; - } - - return 0; - -disable_vpp0_hw_clock: - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); -disable_bse_hw_clock: - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); -disable_hw_clock: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); -disable_hw_free_run_clock: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); -disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); - - return ret; -} - -static void iris_vpu4x_disable_hardware_clocks(struct iris_core *core, u32= efuse_value) -{ - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP1_HW_CLK); - - if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); - - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); -} - static int iris_vpu4x_power_on_hardware(struct iris_core *core) { u32 efuse_value =3D readl(core->reg_base + WRAPPER_EFUSE_MONITOR); int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec); if (ret) return ret; =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) { - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec_vpp0); if (ret) goto disable_hw_power_domain; } =20 if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) { - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->vcodec_vpp1); if (ret) goto disable_vpp0_power_domain; } =20 - ret =3D iris_vpu4x_enable_hardware_clocks(core, efuse_value); - if (ret) - goto disable_vpp1_power_domain; - if (!(efuse_value & DISABLE_VIDEO_APV_BIT)) { ret =3D iris_vpu4x_power_on_apv(core); if (ret) - goto disable_hw_clocks; + goto disable_vpp1_power_domain; } =20 return 0; =20 -disable_hw_clocks: - iris_vpu4x_disable_hardware_clocks(core, efuse_value); disable_vpp1_power_domain: if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp1); disable_vpp0_power_domain: if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp0); disable_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec); =20 return ret; } @@ -335,17 +240,13 @@ static void iris_vpu4x_power_off_hardware(struct iris= _core *core) writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); =20 disable_clocks_and_power: - iris_vpu4x_disable_hardware_clocks(core, efuse_value); - if (!(efuse_value & DISABLE_VIDEO_VPP1_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP1_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp1); =20 if (!(efuse_value & DISABLE_VIDEO_VPP0_BIT)) - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs - [IRIS_VPP0_HW_POWER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec_vpp0); =20 - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->vcodec); } =20 static int iris_vpu4x_set_hwmode(struct iris_core *core) diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index ab41da1f47c8..e690c566c875 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -212,21 +212,15 @@ int iris_vpu_power_off_controller(struct iris_core *c= ore) writel(0x0, core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); =20 disable_power: - iris_disable_unprepare_clock(core, IRIS_AHB_CLK); - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return 0; } =20 void iris_vpu_power_off_hw(struct iris_core *core) { - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , false); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + iris_genpd_set_hwmode(core->vcodec, false); + iris_disable_power_domain_and_clocks(core, core->vcodec); } =20 void iris_vpu_power_off(struct iris_core *core) @@ -245,7 +239,7 @@ int iris_vpu_power_on_controller(struct iris_core *core) u32 rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); + ret =3D iris_enable_power_domain_and_clocks(core, core->ctrl); if (ret) return ret; =20 @@ -253,65 +247,22 @@ int iris_vpu_power_on_controller(struct iris_core *co= re) if (ret) goto err_disable_power; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_CLK); - if (ret) - goto err_disable_axi_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_AHB_CLK); - if (ret && ret !=3D -ENOENT) - goto err_disable_ctrl_clock; - return 0; =20 -err_disable_ctrl_clock: - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); -err_disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 return ret; } =20 int iris_vpu_power_on_hw(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_HW_AHB_CLK); - if (ret && ret !=3D -ENOENT) - goto err_disable_hw_clock; - - ret =3D iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK); - if (ret && ret !=3D -ENOENT) - 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: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->vcodec); } =20 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); + return iris_genpd_set_hwmode(core->vcodec, true); } =20 int iris_vpu_switch_to_hwmode(struct iris_core *core) @@ -372,11 +323,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_= core *core) val, val =3D=3D 0, 200, 2000); =20 disable_power: - iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); - iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI1_CLK); - - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domain_and_clocks(core, core->ctrl); =20 reset_control_bulk_reset(clk_rst_tbl_size, core->resets); =20 @@ -385,34 +332,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_= core *core) =20 int iris_vpu35_vpu4x_power_on_controller(struct iris_core *core) { - int ret; - - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); - if (ret) - return ret; - - ret =3D iris_prepare_enable_clock(core, IRIS_AXI1_CLK); - if (ret) - goto err_disable_power; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_FREERUN_CLK); - if (ret) - goto err_disable_axi1_clk; - - ret =3D iris_prepare_enable_clock(core, IRIS_CTRL_CLK); - if (ret) - goto err_disable_ctrl_free_clk; - - return 0; - -err_disable_ctrl_free_clk: - iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); -err_disable_axi1_clk: - iris_disable_unprepare_clock(core, IRIS_AXI1_CLK); -err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); - - return ret; + return iris_enable_power_domain_and_clocks(core, core->ctrl); } =20 void iris_vpu35_vpu4x_program_bootup_registers(struct iris_core *core) --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B7103806C2 for ; Wed, 15 Jul 2026 14:11:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124667; cv=none; b=ngYFj+K9a4dpcR0LA3RHG1zt66+NQbx/z/iFAhrakWHuyf3zkL9n2TzUnD6MPp13D+42s3MapGSkBwRc6FdA6RCio5hRUW4+ZdCPWKOZCEjnRNEsBeCjw+rNCswKBYtnOInfmVkLjRITk8OQkmmfGZwrlLQOfjQo4bsRXrXZtSc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124667; c=relaxed/simple; bh=D+I3piFeCESGPcz/eI+7CcWTIabAW6H9hDCT776W4Xg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gVRJGy1m9WxOFMJlydN+JH48gbjF+ai3yjtrelB80QcMWFZMaaWNzF661OH4ZMmeQrBxf9y1r5ZJTKLAyLWfF799UTKPqmt+VErhD7Bkz3SdkiFI87nLl3bHtKUq9UbfTmDSvVZ2dFxhZF3zprtVp4XnE9fKk8b2YgpZ/nCe3IE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=M5p0Eo9L; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dVIpSE86; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="M5p0Eo9L"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dVIpSE86" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3WKg4097303 for ; Wed, 15 Jul 2026 14:11:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= EfmP+DU02dQBazhbUiwzTHTt7cqb8LqUf1X5ED+Ub1c=; b=M5p0Eo9LK10M3x8V reHFbhuy/i3Qlh/j9PlR4KySl9NVerd1BTiTtti6cfgXk5IVHW0rCGabKJ2mWvFt cWG5ra2pZ+hQ7Od8DJT/f8aTg80VEyg+O/acBHWXEm631LqELbDajyR1KFABOBLC EzOGDtLvoDdB1upJVaDa9ffCno+5JzPE0K+fhUxGXn7bW3uNgwINrxf0/lsYMAzf Lig12s0JOawGVhGprn1nAYed0w63oHETAJDiwtnVDGUBaozAuYitIbmS29yT38wy VByqYqD1oyrlgX1Xi7phqR/1vEtgnTqK0aDSZai9jK5RlvgIgYEqMpoT0NBkc9r7 noF8JQ== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe8558yhf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:05 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cc73f47bdcso98031345ad.3 for ; Wed, 15 Jul 2026 07:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124665; x=1784729465; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EfmP+DU02dQBazhbUiwzTHTt7cqb8LqUf1X5ED+Ub1c=; b=dVIpSE863cm8TU7YpLyVXlxBWfaNlQwiqs0z9OEVjoRkjEyyV1yo3u4HeuyP2nSDGY JR6G/MRezwPR5udHDqrXOx7r+P9O7JjBebpYpx+tVx8VKZAhg08rYiKY9yOG8kmcXqth o9G7Ce1ocDfymUm8jr0WsmGFIi9/nnH6fWvRr41iKcwabXz/KIU+k2wQRwLJbaRu7wyy CVtXnCDI1lXsT9+LYmCa0kb17vpcqPJO7z/p+VKyQexuJUr3K3vOCtMfv0EjPYJ9TEI7 msFg4aKkzThWoYRRLtvjD7dei34VeEgQQeXEafMA+BPROuq3dE5JVUGz4jpy8F2zxx7M Fxlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124665; x=1784729465; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EfmP+DU02dQBazhbUiwzTHTt7cqb8LqUf1X5ED+Ub1c=; b=U9dhLJbsFknFy/QJm4niA4v32IVNNIv01bWIH3PgrkN1oMoeyC0eevBFnOdIrrghfZ O6r4AtdzjFq5BM/Esg/1gqtUVAKq4kgMmftR/fVukyiy2gCLVRj4xKkYmZ9UI7YiHHvH bX0mg+l3pUuHyxmM2a0vbvLUabBQeosKjpfpqsotSijcHBHo0KxIIX593P7YEFrxNzXE 0rxY76zXpV/OEmHl9qI0eWKfmStub8Apyp8q83EqzDf+Qd0hjo6u03M3Jx/t3+Mib4GU I6vjpBYsXAsBjl+V/PfsoXWuXyMtAubXD8cL85lIeDyf5AUQ2LwFmLO80Yo7iqk7agi+ D6QQ== X-Gm-Message-State: AOJu0YzHPoQp2PqJgxkPRjMloFKHDT1I44uuHnW3Vjk1ieROQm3kflGA XIn60ycWkHCD7haZVm3QlLf/TGlvVScA9yHTMO5+hv+gX7hxsojR0cGJFzBalX9ckqME1Cc3Zv5 RRBnRb7lLnjxgHsrtWTDfSZaYFMvlhdjyI98ZKfo45l/Ye3tr4SDkBIEvMkIizYwmuSWCqlocDd 0= X-Gm-Gg: AfdE7cmjhQBRs8lOZ13QiZbTM13R3cbbiTnaJ90xsPicdrlvxNNAyDSmAB5bws9oEul E9F+YMcTlAreEw+1Z/J+SYnzj7XP/IeRLshEgJxOgJwt5faAZyDMFQvqD+Tc875qPjgqAUDnsY4 w/KZCqZPwKUGM/Vk8jqqe8Grpk586TpBGz0hEq7TK2a91znzbYPKv2xEMbMi1/smd/bWzv7hNl9 xvxgd8zbHoUPE7CdXmhR12hSAlKhJ+KdA3AYssIb3A2g0tpvkt5wqsRZhzhqG0PWj0Bm032OI++ 7f10sdg5XkYxv1ojktWHYm3Ml1Y8vJLRnGXYCRertuYXByGgTALurxmqU2VR1wkmSP6ETB/DUI4 bkdjX5ReLAi5CrmUsDb2cKjw2bpElmQh6ipIaHDI85/vG X-Received: by 2002:a17:903:19c8:b0:2ca:feb:303b with SMTP id d9443c01a7336-2cef143a620mr81040715ad.25.1784124664555; Wed, 15 Jul 2026 07:11:04 -0700 (PDT) X-Received: by 2002:a17:903:19c8:b0:2ca:feb:303b with SMTP id d9443c01a7336-2cef143a620mr81040035ad.25.1784124663930; Wed, 15 Jul 2026 07:11:03 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:03 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:02 +0530 Subject: [PATCH v9 08/14] media: iris: Add power sequence for glymur Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-8-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=9727; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=D+I3piFeCESGPcz/eI+7CcWTIabAW6H9hDCT776W4Xg=; b=CMIhHzkz7LGG6Rj8JOLfZyTJee+ddrLeso5QCLWlV7wV+VlA5d9LO+epM/wRcqu6L4CTNmuOn V0kZ2+KXFeWCfbE3CNcQDItwDW309y1ZgahmSWSfSQftBR+mTanAT3U X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: Lqi7Q1kVfD8Ozf2jUQnmI7NyL4EM7920 X-Authority-Analysis: v=2.4 cv=KOlqylFo c=1 sm=1 tr=0 ts=6a5794f9 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=gBN5huzyN1sx2lhoZCEA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX7XUtzULRm8de OUBiyORI+uNEeUicLO5u3mm7XEfnSfG2kCk8M8VUFQm1Ymy7691xIGSjU96CUs2ynGM2WvV+WQV p/8WJG+RokaOhrw3QrKmqN0IaHuoH5tXRqSEFeXHh9pwJ+5cVhOx4J3TFT3IC1uSu3DilKxr8aG qsBQoLvb4B92O6zgiuSf2f+qJbMCbhdKZ6rBhWp4ahDbtSYBf5i8wvIcM08UFa06qaRnwqM7onv 9/ZbpI+EpRr2abjeH59rLs43vyvZTMOJdIOyy8tSMAg7Fp8kbzrc26pGhMWvtAO09WsvJvdOnOE HxeCDOZcCeW1cP/klmdQ6sCohHu5xvhhcbKUyZ/isd6mQGgg3Y/0s9pFqRwHd7kKd6Nih86OyST DSR2ojWY3xsfcBJlmkqmyJkzR3JlwJe8TqxSzbo/vgKxXblJZIoIVPkwaarx8ewLnfsfKHSeVJ0 hmK6Ox7QnuFyTti0Qqw== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX8QkjTmCh+Qtq cU3Ac3kO0IUa21xGf39B3rlPUusnwCkgDTLCyBclhirl22Tj3QyqhczVOaKcjqRrVT1XgNdL6/G uSdeanGbZvRaAUFyUkf4wDxhbGFVPtU= X-Proofpoint-ORIG-GUID: Lqi7Q1kVfD8Ozf2jUQnmI7NyL4EM7920 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 Glymur platform has two video codec cores: vcodec0 and vcodec1. Both cores share a common clock source (video_cc_mvs0_clk_src) and the same power rails. The clock dividers between the source and the branch clocks are fixed. So when both cores are running, the source clock always runs at the highest frequency requested by either core. Since both cores share the same power rails, the power corner cannot be voted independently. Scaling one core's power corner up or down would directly affect the other, leading to under or over-voting. For these reasons, both cores should voted the clock and power rail must be based on the workload of both cores. Reviewed-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 131 +++++++++++++++++= +++- drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + .../platform/qcom/iris/iris_vpu_register_defines.h | 12 ++ 3 files changed, 139 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 7cda94601555..4894cba62677 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -17,14 +17,14 @@ #define NOC_HALT BIT(0) #define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28) =20 -static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core) +static bool iris_vpu3x_hw_power_collapsed(struct iris_core *core, u32 pwr_= status_bit) { u32 value, pwr_status; =20 value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); - pwr_status =3D value & BIT(1); + pwr_status =3D value & pwr_status_bit; =20 - return pwr_status ? false : true; + return !pwr_status; } =20 static void iris_vpu3_power_off_hardware(struct iris_core *core) @@ -32,7 +32,7 @@ static void iris_vpu3_power_off_hardware(struct iris_core= *core) u32 reg_val =3D 0, value, i; int ret; =20 - if (iris_vpu3x_hw_power_collapsed(core)) + if (iris_vpu3x_hw_power_collapsed(core, VCODEC0_POWER_STATUS)) goto disable_power; =20 dev_err(core->dev, "video hw is power on\n"); @@ -78,7 +78,7 @@ static void iris_vpu33_power_off_hardware(struct iris_cor= e *core) u32 count =3D 0; int ret; =20 - if (iris_vpu3x_hw_power_collapsed(core)) + if (iris_vpu3x_hw_power_collapsed(core, VCODEC0_POWER_STATUS)) goto disable_power; =20 dev_err(core->dev, "video hw is power on\n"); @@ -221,6 +221,118 @@ static void iris_vpu35_power_off_hw(struct iris_core = *core) iris_vpu33_power_off_hardware(core); } =20 +static void iris_vpu36_power_off_vcodec(struct iris_core *core, u32 core_i= d) +{ + u32 bridge_hw_reset[] =3D {CORE_BRIDGE_HW_RESET_DISABLE, VCODEC1_BRIDGE_H= W_RESET_DISABLE}; + u32 lpi_status_active[] =3D {NOC_LPI_STATUS_ACTIVE, NOC_LPI_VCODEC1_STATU= S_ACTIVE}; + u32 power_down_prep[] =3D {REQ_POWER_DOWN_PREP, REQ_VCODEC1_POWER_DOWN_PR= EP}; + u32 lpi_status_done[] =3D {NOC_LPI_STATUS_DONE, NOC_LPI_VCODEC1_STATUS_DO= NE}; + u32 lpi_status_deny[] =3D {NOC_LPI_STATUS_DENY, NOC_LPI_VCODEC1_STATUS_DE= NY}; + u32 bridge_sw_reset[] =3D {CORE_BRIDGE_SW_RESET, VCODEC1_BRIDGE_SW_RESET}; + u32 idle_status[] =3D {VCODEC_SS_IDLE_STATUSN, VCODEC1_SS_IDLE_STATUSN}; + u32 power_status[] =3D {VCODEC0_POWER_STATUS, VCODEC1_POWER_STATUS}; + bool handshake_done, handshake_busy; + u32 value, i, count =3D 0; + int ret; + + if (iris_vpu3x_hw_power_collapsed(core, power_status[core_id])) + goto disable_power; + + value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + if (value) + writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + for (i =3D 0; i < core->iris_platform_data->num_vpp_pipe; i++) { + ret =3D readl_poll_timeout(core->reg_base + idle_status[core_id] + 4 * i, + value, value & DMA_NOC_IDLE, 2000, 20000); + if (ret) + goto disable_power; + } + + do { + writel(power_down_prep[core_id], core->reg_base + AON_WRAPPER_MVP_NOC_LP= I_CONTROL); + usleep_range(15, 20); + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); + + handshake_done =3D value & lpi_status_done[core_id]; + handshake_busy =3D value & (lpi_status_deny[core_id] | lpi_status_active= [core_id]); + + if (handshake_done || !handshake_busy) + break; + + writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + usleep_range(15, 20); + } while (++count < 1000); + + if (!handshake_done && handshake_busy) + goto disable_power; + + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATU= S, value, + value & lpi_status_done[core_id], 200, 2000); + if (ret) + goto disable_power; + + writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + writel(bridge_sw_reset[core_id] | bridge_hw_reset[core_id], + core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(bridge_hw_reset[core_id], core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_= RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_power: + iris_genpd_set_hwmode(&core->vcodec[core_id], false); + iris_disable_power_domain_and_clocks(core, &core->vcodec[core_id]); +} + +static void iris_vpu36_power_off_hw(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i; + + for (i =3D 0; i < num_cores; i++) + iris_vpu36_power_off_vcodec(core, i); +} + +static int iris_vpu36_power_on_hw(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i, ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_enable_power_domain_and_clocks(core, &core->vcodec[i]); + if (ret) + goto error; + } + + return 0; + +error: + while (--i >=3D 0) + iris_vpu36_power_off_vcodec(core, i); + + return ret; +} + +static int iris_vpu36_set_hwmode(struct iris_core *core) +{ + u32 num_cores =3D core->iris_platform_data->num_cores; + int i, ret; + + for (i =3D 0; i < num_cores; i++) { + ret =3D iris_genpd_set_hwmode(&core->vcodec[i], true); + if (ret) + goto error; + } + + return 0; + +error: + while (--i >=3D 0) + iris_genpd_set_hwmode(&core->vcodec[i], false); + + return ret; +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -248,3 +360,12 @@ const struct vpu_ops iris_vpu35_ops =3D { .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu_set_hwmode, }; + +const struct vpu_ops iris_vpu36_ops =3D { + .power_off_hw =3D iris_vpu36_power_off_hw, + .power_on_hw =3D iris_vpu36_power_on_hw, + .power_off_controller =3D iris_vpu35_vpu4x_power_off_controller, + .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, + .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, + .set_hwmode =3D iris_vpu36_set_hwmode, +}; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index a8df9af0d3da..34ecb18aefb3 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -12,6 +12,7 @@ extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; extern const struct vpu_ops iris_vpu33_ops; extern const struct vpu_ops iris_vpu35_ops; +extern const struct vpu_ops iris_vpu36_ops; extern const struct vpu_ops iris_vpu4x_ops; =20 struct vpu_ops { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h b= /drivers/media/platform/qcom/iris/iris_vpu_register_defines.h index 72168b9ffa73..c44c85eac3b5 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -7,6 +7,7 @@ #define __IRIS_VPU_REGISTER_DEFINES_H__ =20 #define VCODEC_BASE_OFFS 0x00000000 +#define VCODEC1_BASE_OFFS 0x00040000 #define AON_MVP_NOC_RESET 0x0001F000 #define CPU_BASE_OFFS 0x000A0000 #define WRAPPER_BASE_OFFS 0x000B0000 @@ -14,6 +15,8 @@ #define AON_BASE_OFFS 0x000E0000 =20 #define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70) +#define VCODEC1_SS_IDLE_STATUSN (VCODEC1_BASE_OFFS + 0x70) +#define DMA_NOC_IDLE BIT(22) =20 #define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000) #define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1)) @@ -35,6 +38,8 @@ #define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160) #define CORE_BRIDGE_SW_RESET BIT(0) #define CORE_BRIDGE_HW_RESET_DISABLE BIT(1) +#define VCODEC1_BRIDGE_SW_RESET BIT(2) +#define VCODEC1_BRIDGE_HW_RESET_DISABLE BIT(3) =20 #define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168) #define MSK_SIGNAL_FROM_TENSILICA BIT(0) @@ -52,14 +57,21 @@ #define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58) #define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C) #define REQ_POWER_DOWN_PREP BIT(0) +#define REQ_VCODEC1_POWER_DOWN_PREP BIT(1) =20 #define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60) #define NOC_LPI_STATUS_DONE BIT(0) /* Indicates the NOC handshake is com= plete */ #define NOC_LPI_STATUS_DENY BIT(1) /* Indicates the NOC handshake is den= ied */ #define NOC_LPI_STATUS_ACTIVE BIT(2) /* Indicates the NOC is active */ +#define NOC_LPI_VCODEC1_STATUS_DONE BIT(8) +#define NOC_LPI_VCODEC1_STATUS_DENY BIT(9) +#define NOC_LPI_VCODEC1_STATUS_ACTIVE BIT(10) =20 #define WRAPPER_IRIS_VCODEC_VPU_WRAPPER_SPARE_0 (WRAPPER_BASE_OFFS + 0x78) #define WRAPPER_CORE_POWER_STATUS (WRAPPER_BASE_OFFS + 0x80) +#define VCODEC0_POWER_STATUS BIT(1) +#define VCODEC1_POWER_STATUS BIT(4) + #define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88) #define CORE_CLK_RUN 0x0 =20 --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 694263E639F for ; Wed, 15 Jul 2026 14:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124674; cv=none; b=dkksOyQYVGVzSs3JT4PzlkHFiuPLDsctsDALjytB9GOw9A7/rfQquRAxQzms3OrhfxhGivobRDTzIW8UUGrVE6pZJMLR9IOYFRH5n9xwYXJupJkFkkF4rPEc7vDIqIpcBlF+Dd+H5sEUFAzrdlrSAJEedFx3uxhQvc2+OAi6bfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124674; c=relaxed/simple; bh=j2F1BecakdsVQPJVT1OChM6/odBNNP5n+m7cYa+S3EM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e8DGRP+PCsM0EnSE9jco7fQ/fJRIRZIVolbwweqR4q8VdW7X0WfrQB1kWX6vSg3v6ctPSq2Zo0oqiKQUifWobbTRWkANQlGYKpmB7zkMJJpiPko4i8EesTjhXFVDR3g5Di4VyBL6HJtiQkI1kSMA3exgEP6CTX88c2DGT613R9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=IB7RsLkO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Dvqzu680; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="IB7RsLkO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Dvqzu680" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3QK44006743 for ; Wed, 15 Jul 2026 14:11:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= uUXkx4Ku/EFI2n6r1fYOWCM/WqhVpiu7V2violHeIes=; b=IB7RsLkOApXfakX7 llDBN0EwmrSki+Wf35W0sQDebM+75eLCHnq9hXswlZOXiUce9QEkjzrqUDQnCQol whhnIPzpHSAqkzBexWsmYas6bhKwzGCaypI43EFvM0arv8PO15LfUj1MpEXfY1Kg Th39A6ogHDiwiKzJdUN9qcsFVkaLN5fZUJpkNYraP9iSx3Ut/ymNDlMpb7OU38x1 Lw/ok9aJWUs+fUnccuCBdVUm+jW/bpLlwFXGNlVsxpuST2MDiAgAejSvkPp2sg4o KJ4tARVqf6XfmqHdXCWduBpY1J6phLJjc+B4Cju2e7bEwnbLfP0+JnpiuTJhcu2T nyfYZw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529ge8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:11 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2ccbb61893fso124932285ad.0 for ; Wed, 15 Jul 2026 07:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124671; x=1784729471; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uUXkx4Ku/EFI2n6r1fYOWCM/WqhVpiu7V2violHeIes=; b=Dvqzu680CrQNkgJzQArP4T/L8mJ+WXFoHe5zGaakOR5eb4k8vnNs5+fMMVYd4WyIEL AFvz4CHwYWU3QSwLfSz2KsiLfPIGV0FHkqfpFTOXsoVIsVeKIeoLo9dDYAmZHXy9s31l k29m+PNdhyGfpGdcDn6DPfVYbtPSr1nhCIlbV5EbXa1u9B0HCKKHU7N0/vg4hAlzk1DX ZPpoc1w3gaCuCVDvOtTmNmAZ9TtgFCA9htZEia+JVi9K7sITn89iNuvztqUz/mTvevoL aygopdF94ktbpVJUuyCcDSi6khxEhmc4qYbjyeD4SOmhBPDVtOvnzIr1Mjzy8GtbmD/g hltg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124671; x=1784729471; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uUXkx4Ku/EFI2n6r1fYOWCM/WqhVpiu7V2violHeIes=; b=CNVh/47dLGq2aKi+M24ve8otpC/Ran69kytGZZCP6alWzpgBYnOitWIoxSKkFh18iq 0it/O0xL/eEIygHiRGS9xRvh+rIpmsfEE2PXDoLfSetPi20sY1wxsL53tCFBupmDOGv9 3pdFbIBTRiw47uGxjrrC34K+z04GihQ3+Sx0jMroC9fK0eTi8BW6+JOHmmEkI+vluzsE CtVU6Enu9CX349lYX81MwiTmjV6Rhavalicly6M6RJn2v8dwdiGbYAsW2/GbValLDuut bt5Tdo+9tqSSZ+e78auQzmUZNhPo67SZuWZ4gZHNZ+xyW/bVw9TiEKW8uhCz69lO5CvO qbhA== X-Gm-Message-State: AOJu0Yyqp/gnR9LiwWQExr0XK+2teK4PsLsyzhKTMelgXZvdMDa2/qzA /LF59y4+e6PL7PeuzvFNF1riOaku2kwMHuUFHwPfGQIoNAYavbL+Fg34ewYm8hVZS3tbase7uja tHUaPwzYRJqQ/uewDP+5wlk2vdKpZfNegLMENT8ewOHjPIF3tnTDWKW8QrJEJqDZX2mxIe1OquF 4= X-Gm-Gg: AfdE7cmb2Jks/fF9CDYmc5EJE4oj/jD2Bpz4Ekk67hOfSdfA3KgRvJ78SGNVxlVsmR+ de8nESWEhygWNM0vFqqusca1UhaEF3pSeln02OG5ndxdrTOdRYIf4+DWLb4ze2M1xFm722GP04l xI/RL/Elc4XC2BYnBGE4z8ZIMVlhqgAIGn43fpCowRsmSyzVuMz35RiAknTUuErPwx88WIBiEiw oxOsZr9xMz9kPmp2cKP5f1mp8pJy+RZtfGx31pvoKd7NxEWAsgpBzxzKsslZSlK5pqHjOmcm0Qy 8TsfrTZPklYuG3dJYaWKvB/ue04IiOa5hsX7rQeiqaTSwZB9psg76RspIs2RDWE+rYdl7PChE5Q pPy+smKvuB5APxNu+aTKhjisz4o9SdweO1vfMcChHg5TI X-Received: by 2002:a17:903:3585:b0:2c9:abe1:c352 with SMTP id d9443c01a7336-2cef1327a72mr72569175ad.13.1784124670927; Wed, 15 Jul 2026 07:11:10 -0700 (PDT) X-Received: by 2002:a17:903:3585:b0:2c9:abe1:c352 with SMTP id d9443c01a7336-2cef1327a72mr72568685ad.13.1784124670343; Wed, 15 Jul 2026 07:11:10 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:10 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:03 +0530 Subject: [PATCH v9 09/14] media: iris: Handle CPU_CS_SCIACMDARG3 register write via program bootup registers hook Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-9-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=3528; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=j2F1BecakdsVQPJVT1OChM6/odBNNP5n+m7cYa+S3EM=; b=2qipjg45gfc/Q86MUudP2IYVC2Qlg3JxMTxLLbpVLRgnMcPjCSalBAsP470+oXsfKJSpB4oGA RffdrC+4IIACk3ajQumdtL9pzPGYvWKLGbtd+rxWPoyoXo/jzMRA7bZ X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX3l7Bf0FLq7F9 h+wdnk+gcBvGbOfBAta1zslyRiuDRpYaXrnUk19Xpi9pkoXH8o44ea79INbzCTvgLHtL0Pi8acA zPP0+/kXKKpSwsMWbJ4afXl12T06pOrOMcyCS+PnFbE2wLZufIfbbsZGBpZO+5hVNDDORoxLxt/ /q/gNV71BPB+RMmVLiD5VW5p6XrVAzGTMc/3qywc5YuLy/glbkZOnqinCaCRreaZPHY/1lg361p z9ciWgqIUhXfqMZIZGcoW1hoQpA/DK7Ptpp4xCGAqHuq6YvXOF3C2XPNNfCkahG41S7rG+HF4c2 W1tEio3HIfG8lPAWEqLhC65gFnm0MiknsduGYVF4y/jMAMA8b4vOCZJTAba5IVGQxdwhU+6mz2S Q7YN2ArlUa0k9M42DTsh3dsTW+NdSHQXkaThKzLqWl38qG6sVEmBcHKQusQ2e2J1FEgcIomwlq7 syOPN3ta6bH3YMIRBJQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX+CWEzfMwj25/ 2RPt13Abtsmc8VzYgljpliX0EdR17WdKelge26OLjIltUKoFJa5K0kAyCJ+odOWL4GxCM56tyB+ PXvDiJ+YikVLSWIIH5VywSNZiBgRMFM= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a5794ff cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=_-2Oxswyk2Zu2Y7AJ8cA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: hE-_Mpht5G2jK209HH19n74puxEF3xRX X-Proofpoint-GUID: hE-_Mpht5G2jK209HH19n74puxEF3xRX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 On the Glymur platform, the firmware reads CPU_CS_SCIACMDARG3 during boot to determine the VM count and increments it by 1. Writing the default 0x1 causes the firmware to treat the VM count as 2. To avoid that write 0x0 to CPU_CS_SCIACMDARG3 as a Glymur platform specific. Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 6 ++++++ drivers/media/platform/qcom/iris/iris_vpu_common.c | 4 ++-- drivers/media/platform/qcom/iris/iris_vpu_register_defines.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 4894cba62677..7d5007abaded 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -333,6 +333,11 @@ static int iris_vpu36_set_hwmode(struct iris_core *cor= e) return ret; } =20 +static void iris_vpu36_program_bootup_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + CPU_CS_SCIACMDARG3); +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -366,6 +371,7 @@ const struct vpu_ops iris_vpu36_ops =3D { .power_on_hw =3D iris_vpu36_power_on_hw, .power_off_controller =3D iris_vpu35_vpu4x_power_off_controller, .power_on_controller =3D iris_vpu35_vpu4x_power_on_controller, + .program_bootup_registers =3D iris_vpu36_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu36_set_hwmode, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index e690c566c875..72eb8f6240b7 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -26,7 +26,6 @@ #define QTBL_ENABLE BIT(0) =20 #define QTBL_ADDR (CPU_CS_BASE_OFFS + 0x54) -#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE_OFFS + 0x58) #define SFR_ADDR (CPU_CS_BASE_OFFS + 0x5C) #define UC_REGION_ADDR (CPU_CS_BASE_OFFS + 0x64) #define UC_REGION_SIZE (CPU_CS_BASE_OFFS + 0x68) @@ -67,6 +66,8 @@ static void iris_vpu_setup_ucregion_memory_map(struct iri= s_core *core) writel(value, core->reg_base + SFR_ADDR); } =20 + writel(0x1, core->reg_base + CPU_CS_SCIACMDARG3); + if (vpu_ops->program_bootup_registers) vpu_ops->program_bootup_registers(core); } @@ -78,7 +79,6 @@ int iris_vpu_boot_firmware(struct iris_core *core) iris_vpu_setup_ucregion_memory_map(core); =20 writel(ctrl_init, core->reg_base + CTRL_INIT); - writel(0x1, core->reg_base + CPU_CS_SCIACMDARG3); =20 while (!ctrl_status && count < max_tries) { ctrl_status =3D readl(core->reg_base + CTRL_STATUS); diff --git a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h b= /drivers/media/platform/qcom/iris/iris_vpu_register_defines.h index c44c85eac3b5..3782454b7d06 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_register_defines.h @@ -29,6 +29,7 @@ #define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE_OFFS + 0x1C) #define CLEAR_XTENSA2HOST_INTR BIT(0) =20 +#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE_OFFS + 0x58) #define CPU_CS_H2XSOFTINTEN (CPU_CS_BASE_OFFS + 0x148) #define HOST2XTENSA_INTR_ENABLE BIT(0) =20 --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DFA740EB9C for ; Wed, 15 Jul 2026 14:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124681; cv=none; b=lUzG8kS7S8g93yCf68gOKvN43BNPsJ6gI0Rn5xZIxHmJ9DOHzxd2oAITl3giQV3iicfcPbWF+wccQFW9ASvfR3sXczgHIhsq02ABBMJJvz3GKA06kjKGFJMcZIhI3sPDhEBQmmaIHWsavvC1HYqnhMZTdi8yK7aJHBzEykpmFOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124681; c=relaxed/simple; bh=tR+dYUeMwS+JvcomEV9pPNLdoRwUDOERZypS6K/b4V0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xm1h4gwUdEvq3adLm5hEGkcfiX4aldRc1CqJG2zeJ+bXK3rht507C5Tbcpv8INMSRatFSduzGP3jyJScq1wDO/2sit1vKmrHqW32zCEzulkWtfmuAyOO0JAcco3dSusY9uHiuYjGMMHEXrNujobWYehgwhpBTAQjcNztzpBaVBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=LImV2XFK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NkCokX8V; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="LImV2XFK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NkCokX8V" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3Pcl4006724 for ; Wed, 15 Jul 2026 14:11:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= lZtCcErJSxGsuWs2xTejpGoLv4QfzGYFSD8ZAqoG+6E=; b=LImV2XFKZJfOJkn0 idrKpSYHISPMlYvoUw51NyDy395bSh6bxptn5fFWApjdmPVJJCLsSEQ3lVgvlsIv iFkCDrqeTTmdExn5ZACf44cjDiNsunY4Pdum2/6Pg4awtHRknIR0EuGKasx/rZyr j+wQOkN3lvb2VmN/bUASn8datWGIUHeTnYNHibI3lbJdB0IMB6tmdRAK5w7oV5ke zgAd1dbY63FGMc/AAG6fe7Rr39j5iGwQ+Rk604GiZbcW6XaMM2oDve88Rd+DqwI+ 3TXFWKbOwSW4FwtYdHwhZiGR3JBtx4KR1/P1TsGhhv7w7PAuWv2jSYZe/YABVEjz kYLe0w== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529gev-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:18 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2cc640dfde3so27676195ad.1 for ; Wed, 15 Jul 2026 07:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124678; x=1784729478; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lZtCcErJSxGsuWs2xTejpGoLv4QfzGYFSD8ZAqoG+6E=; b=NkCokX8Vcpm+4fWW+ThedQNus3nGGswZJIbKjz/du0oMrhGuhAeOPRz1Jjfx4AE6ds XD6Xf649TJs/HJphEocOrdJXVeF1w31qGhxvKsxuof0JICv5B0yYEocPE+FeatEyyk+N JvcReuYm7xN44ZtECxMHFWote8Rd6Ov70KwZO1aWyI5pxrJ2WQQhOODw3PA2lXpmbbn2 QiNlqAlzGSQAj6w8+Pxu8MiMwcDT8DEIm9EVfm5DhCK109RaRx5RHdfsg1BGZQSQmnb0 ir6mAf59Ju2EraYOxP+DYXV6y9JdGkv3gvCFgK/V3jynh4naBPs6h8tXaU29Nc/NU8bp FHhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124678; x=1784729478; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lZtCcErJSxGsuWs2xTejpGoLv4QfzGYFSD8ZAqoG+6E=; b=Sjpk5ZGeXCqAfsqpcZY2zbAC4tKtZU2K7ANmY0sc1OgAzVz2YDfYQS/yiE0OCzLxLP D3p76Io1xs5grqCRDnU+mo1IW+vjPjR2ixeO9hnX4xmScPe6uFBVjQS+1SLEqpw5axWU fMINT5qKJ+iTORXwUDn9F71zNslEHBxz/8SDShUGkiEcJU6ikBvVwDdc38UbkaOZm8w7 lHFHjR7LxDo0prVyf9A8MHBA+oZjwXe2aZamPXHasAwPvbZU2E/S5x5eQGRV4F/Pi1PT GchvtLhHYyQmVHL13aJZ0xd+zAAW151dxVV1NTtiEup/ASn2eai/vsW4qI/IvPZ09r+v n1bA== X-Gm-Message-State: AOJu0YybPSlPC1Zvpiwd32ZIIRN17xI6WoWUN4WYVeEYm+fVHkqgTarU cQ8uVAzEiveucru0OEquVBKIluvMqhtBk6ZcGd1ZB3S/4fYV8ziwdzj43GAqXa6gSlC5oDVBGNw 2T9oc5juGMx1REmGnD0/Yr+pOEKJPPk9WbncX8iTRsFKwA/s9Vf8bjvjxziPylPDexhxr9xHU2G Y= X-Gm-Gg: AfdE7ck/6pDFGJgrnJ0rf8JeAEBvVYX1PoOqjFUJsOaJMUmvn7TUYG9IP86i5g7rUxq Vd8E+HgpYY57LDXVIAa1rHCiV5mkUTSInpT7yrnyJkpRwsRu0WNSIn7H6iwy3FjJ3Ndp7oLpiL4 6XRfhOUJb2Qdg6y5+q0DOwqJwwEpsgxpOt9J4b/ULKFVnXIf6BHVC2lYFEtm83adDgU1GlWz+Bs cef3F64uww7crs1eYVXLc4YMVtQ8X1y0RWx/nt71x7MqK4DQ9w/iLpMGEB/qdcj1WH4i6D/7Fgs Qy+Md7q3Xbqz9Hmu7cm8QrXo//8axCEl8NG8e6om7nOxJ1FkJ8u8sZ+WtlLysAPIHUx+1CjtLEh vfHdN4zsMD0Jii+QX4DNBPrK8RUh2ZEQpCd95jfnZjaao X-Received: by 2002:a17:903:1b08:b0:2ca:17a8:cfce with SMTP id d9443c01a7336-2ce9f2852b2mr177958745ad.29.1784124677455; Wed, 15 Jul 2026 07:11:17 -0700 (PDT) X-Received: by 2002:a17:903:1b08:b0:2ca:17a8:cfce with SMTP id d9443c01a7336-2ce9f2852b2mr177958195ad.29.1784124676877; Wed, 15 Jul 2026 07:11:16 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:16 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:04 +0530 Subject: [PATCH v9 10/14] media: iris: Add support to select core for dual core platforms Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-10-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=17582; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=tR+dYUeMwS+JvcomEV9pPNLdoRwUDOERZypS6K/b4V0=; b=fpBFIV84BAZdsfzZkepHse6gK9omPhlifonDy0SPzLOzgfm/0xtr8UJMy/uITtB0oEivpUoir 6BCrQl3WWQYBQNAcDGqnQtlLK9sq0fDEDijJfOO4Yzb+WvbAXir12YM X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX/U991LTqFERJ dkJnRbxmKG9yBXbHWLto8XugI8FXJmKfv8bChvhxPz5txrCZIWE60rVyLCKkVx56ZSf3dOJsvzh 7mdBOWvea9IiBWJG2eOiIBDNh3Ornk2pDEWEMsMut9eRqKg2qglSSIsMMADWdo9ofIkl+6x1L9f izyMxC/Aa7KxvJdF8xaWrixBCCfOzfj0nnXZkyBotHicEAbir766nPWsPfmv97ErPjFT3N1cL4E eyyTrpTg2dooNuL8JhnjyCA1pIimf1hZHFhxBczpLSvDGTwlr3aoMcGddtHB+a6S3yfIVO5Z4ti kcyXPM5FRTQ8vekmIo+doVKmPt8U723ojq3I7RAdWNiLmVHkXPWJeQsc46tpkxxqFNqmiMw/Oyy D/3FowUyXbW/RJfesfAcudJpmk906ihAZSAEyE8YgacG4rHzvu0c/CG6XpADD1QIhozMVwo16Ef 52mxTzJe7tKg5tE4fFQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX/YAJOsRlfYwp 0nDeFPiLohEMGnLI9AWEETO6QGUAodBSjQZbylKQULPawFk+bjoXzB0C+L9CH8ASIlicQerh/PP pAEw/DQJbleT1r+v+Ip4w6z6r0u+/NM= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a579506 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=-5uF22sGoL6VU8B926sA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-ORIG-GUID: tGMofbT_KHVkm1DpoNSbAxliCKaOmiI5 X-Proofpoint-GUID: tGMofbT_KHVkm1DpoNSbAxliCKaOmiI5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 On platforms with two video codec cores, select the hardware core for a new session based on the current Macroblocks Per Frame (MBPF) and Macroblocks Per Second (MBPS) load on each core. The selected core is communicated to the firmware via the HFI_PROP_CORE_ID property at stream-on time. Since both cores share the same clock source, the required clock frequency is the maximum of the aggregated frequencies across both cores. The total session count limit is scaled by the number of cores, since each core independently supports sessions up to its own limit. Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_common.c | 10 ++++ drivers/media/platform/qcom/iris/iris_common.h | 1 + drivers/media/platform/qcom/iris/iris_core.h | 5 ++ drivers/media/platform/qcom/iris/iris_hfi_common.h | 1 + .../platform/qcom/iris/iris_hfi_gen2_command.c | 19 +++++++ .../platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + drivers/media/platform/qcom/iris/iris_instance.h | 2 + drivers/media/platform/qcom/iris/iris_power.c | 20 +++++-- drivers/media/platform/qcom/iris/iris_utils.c | 58 +++++++++++++-----= -- drivers/media/platform/qcom/iris/iris_utils.h | 3 +- drivers/media/platform/qcom/iris/iris_vb2.c | 4 ++ drivers/media/platform/qcom/iris/iris_vidc.c | 6 ++- drivers/media/platform/qcom/iris/iris_vpu3x.c | 63 ++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 2 + 14 files changed, 171 insertions(+), 24 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_common.c b/drivers/media= /platform/qcom/iris/iris_common.c index 25836561bcf3..abea6807a59e 100644 --- a/drivers/media/platform/qcom/iris/iris_common.c +++ b/drivers/media/platform/qcom/iris/iris_common.c @@ -46,6 +46,16 @@ void iris_set_ts_metadata(struct iris_inst *inst, struct= vb2_v4l2_buffer *vbuf) inst->metadata_idx++; } =20 +int iris_set_core_id(struct iris_inst *inst) +{ + const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; + + if (!inst->core_id) + return 0; + + return hfi_ops->session_set_core_id(inst, inst->core_id); +} + int iris_process_streamon_input(struct iris_inst *inst) { const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; diff --git a/drivers/media/platform/qcom/iris/iris_common.h b/drivers/media= /platform/qcom/iris/iris_common.h index b2a27b781c9a..34e32c60f768 100644 --- a/drivers/media/platform/qcom/iris/iris_common.h +++ b/drivers/media/platform/qcom/iris/iris_common.h @@ -11,6 +11,7 @@ struct iris_buffer; =20 int iris_vb2_buffer_to_driver(struct vb2_buffer *vb2, struct iris_buffer *= buf); void iris_set_ts_metadata(struct iris_inst *inst, struct vb2_v4l2_buffer *= vbuf); +int iris_set_core_id(struct iris_inst *inst); int iris_process_streamon_input(struct iris_inst *inst); int iris_process_streamon_output(struct iris_inst *inst); int iris_session_streamoff(struct iris_inst *inst, u32 plane); diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index f528f53f20fc..cf75e53524b0 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -37,6 +37,11 @@ enum domain_type { DECODER =3D BIT(1), }; =20 +enum iris_vcodec_core_id { + IRIS_VCODEC0 =3D 1, + IRIS_VCODEC1, +}; + struct qcom_ubwc_cfg_data; =20 /** diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.h b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.h index a27447eb2519..47786529998d 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.h @@ -131,6 +131,7 @@ struct iris_hfi_session_ops { int (*session_drain)(struct iris_inst *inst, u32 plane); int (*session_resume_drain)(struct iris_inst *inst, u32 plane); int (*session_close)(struct iris_inst *inst); + int (*session_set_core_id)(struct iris_inst *inst, u32 core_id); }; =20 struct hfi_subscription_params { diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_command.c index ca2954f8bd3a..e73743a391e0 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -1360,6 +1360,24 @@ static int iris_hfi_gen2_session_release_buffer(stru= ct iris_inst *inst, struct i inst_hfi_gen2->packet->size); } =20 +static int iris_hfi_gen2_set_core_id(struct iris_inst *inst, u32 core_id) +{ + struct iris_inst_hfi_gen2 *inst_hfi_gen2 =3D to_iris_inst_hfi_gen2(inst); + u32 payload =3D core_id; + + iris_hfi_gen2_packet_session_command(inst, + HFI_PROP_CORE_ID, + HFI_HOST_FLAGS_NONE, + HFI_PORT_NONE, + inst->session_id, + HFI_PAYLOAD_U32, + &payload, + sizeof(u32)); + + return iris_hfi_queue_cmd_write(inst->core, inst_hfi_gen2->packet, + inst_hfi_gen2->packet->size); +} + static const struct iris_hfi_session_ops iris_hfi_gen2_session_ops =3D { .session_open =3D iris_hfi_gen2_session_open, .session_set_config_params =3D iris_hfi_gen2_session_set_config_params, @@ -1373,6 +1391,7 @@ static const struct iris_hfi_session_ops iris_hfi_gen= 2_session_ops =3D { .session_drain =3D iris_hfi_gen2_session_drain, .session_resume_drain =3D iris_hfi_gen2_session_resume_drain, .session_close =3D iris_hfi_gen2_session_close, + .session_set_core_id =3D iris_hfi_gen2_set_core_id, }; =20 static struct iris_inst *iris_hfi_gen2_get_instance(void) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 776b21cd11b2..2e374c2005ef 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -56,6 +56,7 @@ #define HFI_PROP_BUFFER_HOST_MAX_COUNT 0x03000123 #define HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT 0x03000124 #define HFI_PROP_PIC_ORDER_CNT_TYPE 0x03000128 +#define HFI_PROP_CORE_ID 0x030001a9 =20 enum hfi_rate_control { HFI_RC_VBR_CFR =3D 0x00000000, diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/med= ia/platform/qcom/iris/iris_instance.h index a770331d1675..585aa7c51fb0 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -36,6 +36,7 @@ enum iris_fmt_type_cap { * * @list: used for attach an instance to the core * @core: pointer to core structure + * @core_id: specifies the hardware core on which the session runs * @session_id: id of current video session * @hfi_session_ops: iris HFI session ops * @ctx_q_lock: lock to serialize queues related ioctls @@ -83,6 +84,7 @@ enum iris_fmt_type_cap { struct iris_inst { struct list_head list; struct iris_core *core; + u32 core_id; u32 session_id; const struct iris_hfi_session_ops *hfi_session_ops; struct mutex ctx_q_lock;/* lock to serialize queues related ioctls */ diff --git a/drivers/media/platform/qcom/iris/iris_power.c b/drivers/media/= platform/qcom/iris/iris_power.c index 91aa21d4070e..a875647b3162 100644 --- a/drivers/media/platform/qcom/iris/iris_power.c +++ b/drivers/media/platform/qcom/iris/iris_power.c @@ -75,14 +75,12 @@ static int iris_vote_interconnects(struct iris_inst *in= st) return iris_set_interconnects(inst); } =20 -static int iris_set_clocks(struct iris_inst *inst) +static u64 iris_get_required_freq(struct iris_inst *inst) { struct iris_core *core =3D inst->core; struct iris_inst *instance; u64 freq =3D 0; - int ret; =20 - mutex_lock(&core->lock); list_for_each_entry(instance, &core->instances, list) { if (!instance->max_input_data_size) continue; @@ -90,6 +88,22 @@ static int iris_set_clocks(struct iris_inst *inst) freq +=3D instance->power.min_freq; } =20 + return freq; +} + +static int iris_set_clocks(struct iris_inst *inst) +{ + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; + struct iris_core *core =3D inst->core; + u64 freq; + int ret; + + mutex_lock(&core->lock); + if (vpu_ops->get_required_freq) + freq =3D vpu_ops->get_required_freq(inst); + else + freq =3D iris_get_required_freq(inst); + core->power.clk_freq =3D freq; ret =3D iris_opp_set_rate(core->dev, freq); mutex_unlock(&core->lock); diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index ba5c8dc1280c..4608e3f28832 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.c +++ b/drivers/media/platform/qcom/iris/iris_utils.c @@ -7,6 +7,7 @@ #include =20 #include "iris_instance.h" +#include "iris_vpu_common.h" #include "iris_utils.h" =20 bool iris_res_is_less_than(u32 width, u32 height, @@ -23,7 +24,7 @@ bool iris_res_is_less_than(u32 width, u32 height, return false; } =20 -int iris_get_mbpf(struct iris_inst *inst) +u32 iris_get_mbpf(struct iris_inst *inst) { struct v4l2_format *inp_f =3D inst->fmt_src; u32 height =3D max(inp_f->fmt.pix_mp.height, inst->crop.height); @@ -32,6 +33,13 @@ int iris_get_mbpf(struct iris_inst *inst) return NUM_MBS_PER_FRAME(height, width); } =20 +u32 iris_get_mbps(struct iris_inst *inst) +{ + u32 fps =3D max(inst->frame_rate, inst->operating_rate); + + return iris_get_mbpf(inst) * fps; +} + bool iris_split_mode_enabled(struct iris_inst *inst) { return inst->fmt_dst->fmt.pix_mp.pixelformat =3D=3D V4L2_PIX_FMT_NV12 || @@ -101,40 +109,52 @@ struct iris_inst *iris_get_instance(struct iris_core = *core, u32 session_id) return NULL; } =20 -int iris_check_core_mbpf(struct iris_inst *inst) +static int iris_check_core_load(struct iris_inst *inst, bool mbpf) { - struct iris_core *core =3D inst->core; + const struct iris_platform_data *platform_data =3D inst->core->iris_platf= orm_data; + u32 max_load =3D mbpf ? platform_data->max_core_mbpf : platform_data->max= _core_mbps; struct iris_inst *instance; - u32 total_mbpf =3D 0; + u32 total_load =3D 0; =20 - mutex_lock(&core->lock); - list_for_each_entry(instance, &core->instances, list) - total_mbpf +=3D iris_get_mbpf(instance); - mutex_unlock(&core->lock); + list_for_each_entry(instance, &inst->core->instances, list) + total_load +=3D mbpf ? iris_get_mbpf(instance) : iris_get_mbps(instance); =20 - if (total_mbpf > core->iris_platform_data->max_core_mbpf) + if (total_load > max_load) return -ENOMEM; =20 return 0; } =20 -int iris_check_core_mbps(struct iris_inst *inst) +int iris_check_core_mbpf(struct iris_inst *inst) { + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; struct iris_core *core =3D inst->core; - struct iris_inst *instance; - u32 total_mbps =3D 0, fps =3D 0; + int ret; =20 mutex_lock(&core->lock); - list_for_each_entry(instance, &core->instances, list) { - fps =3D max(instance->frame_rate, instance->operating_rate); - total_mbps +=3D iris_get_mbpf(instance) * fps; - } + if (vpu_ops->check_core_load) + ret =3D vpu_ops->check_core_load(inst, true); + else + ret =3D iris_check_core_load(inst, true); mutex_unlock(&core->lock); =20 - if (total_mbps > core->iris_platform_data->max_core_mbps) - return -ENOMEM; + return ret; +} =20 - return 0; +int iris_check_core_mbps(struct iris_inst *inst) +{ + const struct vpu_ops *vpu_ops =3D inst->core->iris_platform_data->vpu_ops; + struct iris_core *core =3D inst->core; + int ret; + + mutex_lock(&core->lock); + if (vpu_ops->check_core_load) + ret =3D vpu_ops->check_core_load(inst, false); + else + ret =3D iris_check_core_load(inst, false); + mutex_unlock(&core->lock); + + return ret; } =20 bool is_rotation_90_or_270(struct iris_inst *inst) diff --git a/drivers/media/platform/qcom/iris/iris_utils.h b/drivers/media/= platform/qcom/iris/iris_utils.h index 228a5f963812..c36ac494f461 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.h +++ b/drivers/media/platform/qcom/iris/iris_utils.h @@ -43,7 +43,8 @@ static inline enum iris_buffer_type iris_v4l2_type_to_dri= ver(u32 type) =20 bool iris_res_is_less_than(u32 width, u32 height, u32 ref_width, u32 ref_height); -int iris_get_mbpf(struct iris_inst *inst); +u32 iris_get_mbpf(struct iris_inst *inst); +u32 iris_get_mbps(struct iris_inst *inst); bool iris_split_mode_enabled(struct iris_inst *inst); bool iris_fmt_is_8bit(u32 pixelformat); bool iris_fmt_is_10bit(u32 pixelformat); diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/pl= atform/qcom/iris/iris_vb2.c index a2ea2d67f60d..dbb89396e651 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -176,6 +176,10 @@ int iris_vb2_start_streaming(struct vb2_queue *q, unsi= gned int count) if (ret) goto error; =20 + ret =3D iris_set_core_id(inst); + if (ret) + goto error; + if (V4L2_TYPE_IS_OUTPUT(q->type)) { if (inst->domain =3D=3D DECODER) ret =3D iris_vdec_streamon_input(inst); diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index 26df872fb4fa..52855f6c7dea 100644 --- a/drivers/media/platform/qcom/iris/iris_vidc.c +++ b/drivers/media/platform/qcom/iris/iris_vidc.c @@ -41,16 +41,20 @@ static void iris_v4l2_fh_deinit(struct iris_inst *inst,= struct file *filp) =20 static void iris_add_session(struct iris_inst *inst) { + const struct iris_platform_data *plat =3D inst->core->iris_platform_data; + u32 max_session_count =3D plat->max_session_count; struct iris_core *core =3D inst->core; struct iris_inst *iter; u32 count =3D 0; =20 + max_session_count *=3D max(plat->num_cores, 1); + mutex_lock(&core->lock); =20 list_for_each_entry(iter, &core->instances, list) count++; =20 - if (count < core->iris_platform_data->max_session_count) + if (count < max_session_count) list_add_tail(&inst->list, &core->instances); =20 mutex_unlock(&core->lock); diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 7d5007abaded..97563bf89939 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -338,6 +338,67 @@ static void iris_vpu36_program_bootup_registers(struct= iris_core *core) writel(0x0, core->reg_base + CPU_CS_SCIACMDARG3); } =20 +static int iris_vpu36_check_core_load(struct iris_inst *inst, bool mbpf) +{ + const struct iris_platform_data *platform_data =3D inst->core->iris_platf= orm_data; + u32 max_load =3D mbpf ? platform_data->max_core_mbpf : platform_data->max= _core_mbps; + u32 max_session_cnt =3D platform_data->max_session_count; + u32 core0_session_cnt =3D 0, core1_session_cnt =3D 0; + u32 core0_load =3D 0, core1_load =3D 0; + bool select_core0, select_core1; + struct iris_inst *instance; + u32 load, new_load; + + inst->core_id =3D 0; + + list_for_each_entry(instance, &inst->core->instances, list) { + load =3D mbpf ? iris_get_mbpf(instance) : iris_get_mbps(instance); + + if (instance->core_id =3D=3D IRIS_VCODEC0) { + core0_load +=3D load; + core0_session_cnt++; + } else if (instance->core_id =3D=3D IRIS_VCODEC1) { + core1_load +=3D load; + core1_session_cnt++; + } + } + + new_load =3D mbpf ? iris_get_mbpf(inst) : iris_get_mbps(inst); + + select_core0 =3D core0_load + new_load <=3D max_load && core0_session_cnt= < max_session_cnt; + select_core1 =3D core1_load + new_load <=3D max_load && core1_session_cnt= < max_session_cnt; + + if (select_core0 && select_core1) + inst->core_id =3D (core0_load <=3D core1_load) ? IRIS_VCODEC0 : IRIS_VCO= DEC1; + else if (select_core0) + inst->core_id =3D IRIS_VCODEC0; + else if (select_core1) + inst->core_id =3D IRIS_VCODEC1; + else + return -ENOMEM; + + return 0; +} + +static u64 iris_vpu36_get_required_freq(struct iris_inst *inst) +{ + u64 vcodec0_freq =3D 0, vcodec1_freq =3D 0; + struct iris_core *core =3D inst->core; + struct iris_inst *instance; + + list_for_each_entry(instance, &core->instances, list) { + if (!instance->max_input_data_size) + continue; + + if (instance->core_id =3D=3D IRIS_VCODEC0) + vcodec0_freq +=3D instance->power.min_freq; + else + vcodec1_freq +=3D instance->power.min_freq; + } + + return max(vcodec0_freq, vcodec1_freq); +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -374,4 +435,6 @@ const struct vpu_ops iris_vpu36_ops =3D { .program_bootup_registers =3D iris_vpu36_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, .set_hwmode =3D iris_vpu36_set_hwmode, + .check_core_load =3D iris_vpu36_check_core_load, + .get_required_freq =3D iris_vpu36_get_required_freq, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 34ecb18aefb3..f3048b7cca21 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -25,6 +25,8 @@ struct vpu_ops { int (*set_hwmode)(struct iris_core *core); int (*init_cb_devs)(struct iris_core *core); void (*deinit_cb_devs)(struct iris_core *core); + int (*check_core_load)(struct iris_inst *inst, bool mbpf); + u64 (*get_required_freq)(struct iris_inst *inst); }; =20 int iris_vpu_boot_firmware(struct iris_core *core); --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F39CE3793B4 for ; Wed, 15 Jul 2026 14:11:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124687; cv=none; b=WiR/HK9nP4uoKN77ctds23jwZ/eSC5j5BxgwELwAcg4OafHyG2ZPGG/W5b7hn+zbY+HJ/HEKMt9qvDI5g+uw6q9zM2c78062GPM4w227hLAyjI/xTzKLCR+MpkAC4veOBJ6UNC8Dr72rvCWdw0bR1/wlFKlzrulweyxoqyt3kAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124687; c=relaxed/simple; bh=Os8dAYcamOJnzmJwoFzvqrtNqrNmAEwuEyi9dkHQWvo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qg2/3ZmgRQVN+x8baz5c9+rpQsalvY5+XgHsU4B7yqTcsdb2o7AHy/AalEFvp+9q/xamrFmY7oHoI9NRl/m1iF81+EXW/SJ2YdCqJOPsXlxQHUKssYFHyF48WfeG4svOQbOMgZGqnGSIv0sqBMqZt19MUHdvHyWq7maOAtbRTaI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=XR4554go; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cyhTl/yJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="XR4554go"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cyhTl/yJ" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3P8r4006708 for ; Wed, 15 Jul 2026 14:11:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= XEG8f3Kfr2qhIFwiOsUL7RgFXaPXEOjds0oQ+2XH17o=; b=XR4554gozXNl4XXk 0h60A5r8VAJ9hknUhtKQVwaY0r4thiDXypH+ok0OXpm/+RlCkphTBJLdu7N/hAf4 ZDfk4awK3vwNBErdsGXRJJX192OahlGUyrUgCaUi7FlyRHayrpBPh6IY7jpLWX43 Nq13s2PE5ZmR0RIRbV8smpOFqc4Eq3mrR3BJktCmuor6xK8wrHDLKOvI/6Uufyb6 ZRLPjn9pSek6eR+u/gBiFDvEGBggqEI06u8wYEvbYXV1hcMItrGEWy6AawmiEc7E j8MUcigUPr/sGOzE2lnoWdkohxf5OeopJzEy7f4BB1QOXaE3rTXb8EFSsbqDmaQQ lYL6tA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529gf7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:25 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cee894b3d8so40547175ad.2 for ; Wed, 15 Jul 2026 07:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124685; x=1784729485; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=XEG8f3Kfr2qhIFwiOsUL7RgFXaPXEOjds0oQ+2XH17o=; b=cyhTl/yJqBXUTx6sdg34tp9rVzfi0/71nxH52RtVPiwP53ekBr1dtGAAt5S1La6MM5 WxC9Jse0o+Q4xTA/Rb3rRgMhK6YMZTkqH4CnmQQcRseqGsn9Go2diI+A52SSpWdilK0q LVKY64CJwvBafJ8dfv2UKpcD674ePl45+Y1+LO/BTyYJbr4mOTbuNHhY9weTuNe6Lwbc JIQocKiC+S0xaF4tLiHCUlE6qvXfvEYcgpJ89hY+2QHyUVSYt9UjotkDUKT6xcbQ2DeS lENS9BMPVHexveDyQztA+YBj6WMFKNq/sDR6mdlJCeSQdGQBbwM/zoICSQDpQoQFoAQ/ Yjbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124685; x=1784729485; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XEG8f3Kfr2qhIFwiOsUL7RgFXaPXEOjds0oQ+2XH17o=; b=UoXsuvowRFimuVwL6kpAk3Z2mKlvzUnQ9gIVjsKSyauNFrk4ZjM+nwcpU/r2oxU8OJ /fQOa9StB/mIACqYwIQTWHFr40yLhm/mOH4rznGAP3f8odB3tDmCQsVwUuDSX57OI42h gruFH/4NtXiq2QMBIPS6tmUp3Ys4OmCpgt257N42Ocla9L0Pk4vCEVF2oS/rVlIUWETy Mvb/0QiLCYWDEpFdC/fPjvbxkOkMd+ks2S7wl962LpJMMLIBvc2n0TP0XbwZ6locdT4r XUJXztUiRbvoJDKEQnY4U3A0w4qmy2Eebj4as8IF24n0xGjmi5oJbK0/SCSTlYO0VJ0N qQ6Q== X-Gm-Message-State: AOJu0YwbMrfGjEqstokKEspl64qR/C4pTCWoFrMa392qmmdOEr4oMMpi Z6UHtrQx4+ZEs5+qEsbRkd+TzYek0wTuNX1SiI5jA5rb3tSOpoF/eSt67Lo65+bmpSEHj3VfnfP i7azQ0Oka2cRZNSmdWrZM/BIa/PI0DeZ78AR+FZk1wuKqJycsZxI25xCrE8YMmnwh5VB2bX0DEQ 8= X-Gm-Gg: AfdE7cnQy+K3f6NaUCEVreSkXd4e0p2qHK5QDHbGWz9a/1fAytAnCZDxcdeYZlUi/dO 2Cnjj/14p9cnw2G2CHCtxwmrAygMRFqjFgylR4D1qkYcZclPKiGuvMXKjFLDoae988drjcB4Mxt v6Hwv8pyeE+bmeGeGsMDgqPJfNbv8M0cylgqVRezh3AnH+zQjhJ/Oh2X9AkC8JrNlpKi79gj83N qddPZCjqS8ihJYlsGfYf5kb3DumEdMuI48z7IHcNF6OLneMAfiSRbbFb4DJLcmQKXCHKp+SY8Jw 0C31uJZwFzr07PCdnZ62d83BL14b2KFe1/KSA+3ix2KX+3fpcCFhAY96TH0idsfOpsrzzbV3zDO yTZ8V4M3LJ6Vv2IzM8GzvY9TqABbuMc2l51uSSG3oVSwg X-Received: by 2002:a17:903:32c8:b0:2cc:9179:325 with SMTP id d9443c01a7336-2cf03c10898mr26403535ad.13.1784124684005; Wed, 15 Jul 2026 07:11:24 -0700 (PDT) X-Received: by 2002:a17:903:32c8:b0:2cc:9179:325 with SMTP id d9443c01a7336-2cf03c10898mr26403205ad.13.1784124683532; Wed, 15 Jul 2026 07:11:23 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:23 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:05 +0530 Subject: [PATCH v9 11/14] media: iris: Add hooks for pixel and non-pixel context banks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-11-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy , Daniel J Blueman X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=2481; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=eGnX+6v9T5zpKul/tvLceKVXAucGjQ/Ox0wKkhH16hE=; b=XTUm0A5+WBQQvrJ7bH3a7F4TVZFJ1E+maaDXdHezHIWQ8ibMU6bR/hhxP9jrLE6Vv74l9t2oQ 1tAzf8XbjHrCLajDgBrdQEjQDPrTzAVmlzxoiPx2PFNIOZfVNEss1iS X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX4TOMZUWdsawD uigbB0V7GI4nkuEgKmLWSb/I5xSWNdyzislNfa6hcfbMvZreuxvLaVNpP1tfFufhq9hNp3InZJw RqKAaT0w7iWrHPxnipjAhQghkZK7GqpWcgJjR43iLSE87a3A07A6AMlgsWoPq+f1ezPmpggE+L8 ycY/ffsRsaScYYbshAcfWbpG45U+Sq34fUwgh7KOKodF5qIKLSiKiBtf/6HcmKNie+EKXikhn0c zq+pyzLdS9dwBkXInDpuLTPpGMnQI9t8JiTx6XyXHya4aZKSMUdGMY0vkRZcrF4pcdMkn+yqcfC Hv+eFPqSzvVGKvPOyEUWvnV9LFGuzAOHSN0TtWHs1Lm2kqFL0MpuzR9QZ+KzLptPFgNXFCKJGIB Rkyekn7QtnGqaBKYlmcmKFdLRhEui9oOF57PCUcrbYIlVOAl98Igy09iFa+rFMJ31Bf8mKoaPRq CiwJHE/NAJTKg/Q8T6g== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXzl4IlnHT3eU9 63cwh5DhBy30VjOjMEbsbmnxqeJtQiSuzNIFTAhsLUJ8uFcWBwiFxNNDZvAv1Tjv+j7RZHGqlgt kvT/Kd1xTVqvFoQBM0ftXd37SG54WlE= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a57950d cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=t9ty7G3lAAAA:8 a=Ysd7Cdeu6pd1DDnCSN4A:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: VUIGDWWOc_Ac58YTibw64V3KPaHEw1lK X-Proofpoint-GUID: VUIGDWWOc_Ac58YTibw64V3KPaHEw1lK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 From: Vikash Garodia Iris platforms use separate context-bank devices for the pixel, non-pixel firmware domains. Add platform hooks to create and destroy those subdevices, and wire them up for the affected platforms. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia Tested-by: Daniel J Blueman --- drivers/media/platform/qcom/iris/iris_vpu3x.c | 48 +++++++++++++++++++++++= ++++ 1 file changed, 48 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 97563bf89939..7d9d67baf22a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -399,6 +399,52 @@ static u64 iris_vpu36_get_required_freq(struct iris_in= st *inst) return max(vcodec0_freq, vcodec1_freq); } =20 +static int iris_vpu3x_init_cb_devs(struct iris_core *core) +{ + struct device *dev; + + dev =3D iris_create_cb_dev(core, "non-pixel"); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + core->np_dev =3D dev; + + dev =3D iris_create_cb_dev(core, "pixel"); + if (IS_ERR(dev)) + goto unreg_np_dev; + + core->p_dev =3D dev; + + dev =3D iris_create_cb_dev(core, "firmware"); + if (IS_ERR(dev)) + goto unreg_p_dev; + + core->fw_dev =3D dev; + + return 0; + +unreg_p_dev: + if (core->p_dev) + platform_device_unregister(to_platform_device(core->p_dev)); + core->p_dev =3D NULL; +unreg_np_dev: + if (core->np_dev) + platform_device_unregister(to_platform_device(core->np_dev)); + core->np_dev =3D NULL; + + return PTR_ERR(dev); +} + +static void iris_vpu3x_deinit_cb_devs(struct iris_core *core) +{ + if (core->fw_dev) + platform_device_unregister(to_platform_device(core->fw_dev)); + if (core->p_dev) + platform_device_unregister(to_platform_device(core->p_dev)); + if (core->np_dev) + platform_device_unregister(to_platform_device(core->np_dev)); +} + const struct vpu_ops iris_vpu3_ops =3D { .power_off_hw =3D iris_vpu3_power_off_hardware, .power_on_hw =3D iris_vpu_power_on_hw, @@ -437,4 +483,6 @@ const struct vpu_ops iris_vpu36_ops =3D { .set_hwmode =3D iris_vpu36_set_hwmode, .check_core_load =3D iris_vpu36_check_core_load, .get_required_freq =3D iris_vpu36_get_required_freq, + .init_cb_devs =3D iris_vpu3x_init_cb_devs, + .deinit_cb_devs =3D iris_vpu3x_deinit_cb_devs, }; --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0908C379982 for ; Wed, 15 Jul 2026 14:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124694; cv=none; b=kek3p/NcCJ6rjGEVnDEAp3bqG+6zZVnSv97cu6cotc7YjFfKXa8ztOKsp0sYovg8Vom8Ni1UB+tPqgbqnnFC3y20mEyKzYrqr7pzEjWfjcEkFWCzRusDB94acug+ezjLJgWeFApIND7XylAry+6Tr0wudbBt0jLAmgYN7LsG+gQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124694; c=relaxed/simple; bh=1w4CgMY6hqW0RscoW+I4KpJUnvg/6sO9akTSyFxDnD0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HLb3rRbdzguf6tpKQH1Vv7IeNXA5PRuXDzfulYVcZoOQV1joNF+ePl0wVSEvTGqu+GkRD+K/2mBwVoS1cxeJYVsiS4+5jdYwW16A1y6QSWtHl+r/7dDAr+0tq4aZnsx5DRO8oGpPtecKFlkYaxtbRNRKCVjWDhqw/fOWlWjfIt8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=WFGbFU5E; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UFpRY1pQ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="WFGbFU5E"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UFpRY1pQ" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3WEP4006890 for ; Wed, 15 Jul 2026 14:11:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= etB4FVaixj6pjK5WgAj9fa3+p1eiXpv7Kfpsfz5keYg=; b=WFGbFU5E/T6Vss8N ol1kJDo1d9jSMHvwYK7ICKd/2KfaCcxeU5idiOBSPXTt4evn6wS4EUyIjyFb4RLs eE7adkS/BRKfqjN3vkaXLQdv+1xkcfaxY/Cm7Ykh9K7T8YrkYz9hq+k7UhEAcaGX j3yzI9HWD+zKOjj/C+w9cSPU2gdZxJoOur8doP0gB0dIP3DfWNPWVvrbKbsloS5b qoUobmCxRZ0xkpU5fTh/ihvIu9xtifKeAxhsmX2/KA/o0t5f/D+ZYzyjpa9i7xPg A317YMqMloKZ98RWYiWvTh4cGQlvhUXSl68qgJXr3ssLfzJzOfQ32Cpe3TT50unT RhyPTg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529gh8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:32 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2cce870a060so101628965ad.2 for ; Wed, 15 Jul 2026 07:11:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124691; x=1784729491; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=etB4FVaixj6pjK5WgAj9fa3+p1eiXpv7Kfpsfz5keYg=; b=UFpRY1pQv80w75W/v5EEOCcmPnZ7IhanjMbZJ9pxidQo1Bzv3FsvSu+tmZsJxIHAfN bndjJFZf6u95UPvPH1+t0WrqY0P2IcF294zJSSMt6DWj2k9XPHZ9QhyMXUYL8B3ORNGv rjHaBWt0ky9mczgwut/fjT4NEpu/FpdKNHuG43BLwEgGOYTEE7FP19OGoqiFCbuS/ea+ 5UR8v856MbZIidwC69MB/V0ACMyOfiern3qcvm9GSBVaWyVvFYulk2ppJ4cjURi6Ta0D 7lxR9DIYDCjwOUUMVL7f1+ZWuXZvPeUdpdw1eO7z5TskjPJ06i/aVMyVrpbhvf1scOhn 6x/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124691; x=1784729491; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=etB4FVaixj6pjK5WgAj9fa3+p1eiXpv7Kfpsfz5keYg=; b=l1ZQa99IbS/tlnYi+siHuURVLWzHQRE+WWPpN5Q9kIJK+EHpFzoAHtjc/ljtfvmr8E SctyIbOLUMQtOePjlDI6ao/XRQirPJvupA85ZYMbzOT20qxUvH905tsy2ElVQPX/Jn4o wGV3E/XFSFM+e95hx4/QXVQZL+wE2N/7uPvl6knnH5TEKoxk5NjhbZZhoGauUjUkjNLS 6QmbI6yIiWsQu97R/8ANq6jOnS71jiG18LaCMEPfSpmPgMlx/oRQwbJOVTb40ivm38L6 YtiStiomt13YlH2lMGnBATuHKrjwcnJegp89tZdFR7a3rCDC4bDp+mI9J2KdMFJrHQRs fJLA== X-Gm-Message-State: AOJu0Yzf25lJcLTon0oawo+z6Mha8Jv35Gvzttq9rAA2y8fzLK2dlz0U UR3eHFvf5V55XqrDFLHZjOElPDYwhhh3xbYCeOeg7eH+fYiTlbS8yK2f9p4hRh5u0TslmPaTa7k iU51MhqHYukBjvHH3tJZWrZBghmNkqm0Wor3HA4ZjGSGK6npeaT1Ca5Q/m0Uk6CKjXzQjaaPdX5 Q= X-Gm-Gg: AfdE7clCYvEzm4iP4S/buExA8I/QNiFyM8yVt8MDExGToVXFzCc5CnP6g6F9UcRSt1w JPI0D8w8/ikK6cogG7AB0y0Etgwhzl4Vu234b7Ef29kZRwkBnw7Td3Bd0Z1Mo3cdkfs4NywbWbY kSn2ec5t5qj16o5zMo2odu7FnH+WcUJhuR+L7PbXGZExp/AqEoAyb7UjRfO65QrGg5kA+xRepAx 3Nt05A8XMWZUQToYGWS3ps4NS6BcgkOChCUNjKvYgJNSFk6Z5aZZEPfuiVus5vSqC1XxloHeusu R/Pbtt/59u+LR0MBb13aQv+JHpWqD6o2rOkWQKn+ZtiOPOSi5/03925MQ/f9t+2pypVqG97HrJg 6uj74kN7vmYtImvA9o/R2OfBKj7xNErqMKTY0yHbGKPnJ X-Received: by 2002:a17:902:d48e:b0:2c6:8d95:fd6d with SMTP id d9443c01a7336-2cef136496amr67063555ad.21.1784124691273; Wed, 15 Jul 2026 07:11:31 -0700 (PDT) X-Received: by 2002:a17:902:d48e:b0:2c6:8d95:fd6d with SMTP id d9443c01a7336-2cef136496amr67062995ad.21.1784124690562; Wed, 15 Jul 2026 07:11:30 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:29 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:06 +0530 Subject: [PATCH v9 12/14] media: iris: Add platform data for glymur Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-12-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=8204; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=1w4CgMY6hqW0RscoW+I4KpJUnvg/6sO9akTSyFxDnD0=; b=R5qk/6RNBdmvHYruD91KzWcpoIqOK2ct7dMvrRVi7BraHvG6bqrP5XrTV47f690jYHqUBGLLU LNlO9T7qsybB8gnZSDlWcFdCFr3PEw3A2O58UYHiv8BvHRz7Lqc0cGr X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX1cwtef0CdHxI 1FZBczDuUd0/R2tHuo3CoJpt8TEMaDyKzYwzIXH+zngo6PvCycdaEfrnldh9NFdksCnt0D1nzSK f8ndwu8aLTl5RXRKoP/pVMEH5Er/3QJjrwJ0hr2Fp8jqvJl1B95mnVtyhqTC/n/sTjsKuwNu9cz YY4WxZzL920sbZoJ0fR06JaL7LAhdnehUxua/bR/uZ6whX+Zdy7Q4yBdIhojUIAlNvLVoHMNIsN pXtJrwpy+Wk4VlUASSL1/Uy2GqUUSAUtRNzYShBfEC6zySjACPbghrDpdkvt2ZEzdHeQ25FvJir /cHXbYQyvRwJXvBxQNgWottx/bYKIzsG9FjrtIfZU8zkBDCSrRF6jspc6F35iutThT6SQwx9G4u Q7F1XCaviM0xQcb7WexBYyyNJ+gk61NON1QtlESrcwX0RIJwlhjjqeTBlRBYa+Htid55/65UBcO 1QqCPm8ftKbpezhwffg== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXwr/fJHinsWxe qc/RdzYXoO0vVX58Ru8hMIKAXf2HnqO1cv7hic8tNY/p41T+dFjnl147YZ2QET60PVESg0SucqR grnYiEsepSDpMum/RyBrKKXIUOHJ3pY= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a579514 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=0Xn_3AH55rwbdtokavwA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-ORIG-GUID: TPr1-EaPs8QmDLN66nHMjZ1ZpggCvxbT X-Proofpoint-GUID: TPr1-EaPs8QmDLN66nHMjZ1ZpggCvxbT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 On glymur platform, the iris core shares most properties with the iris core on the SM8550 platform. The major difference is that glymur integrates two codec cores (vcodec0 and vcodec1), while SM8550 has only one. Add glymur specific platform data, reusing SM8550 definitions wherever applicable. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 5 ++ .../platform/qcom/iris/iris_platform_glymur.c | 78 ++++++++++++++++++= ++++ .../platform/qcom/iris/iris_platform_glymur.h | 15 +++++ .../media/platform/qcom/iris/iris_platform_vpu3x.c | 35 ++++++++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 ++ 6 files changed, 138 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 48e415cbc439..48570da56aa0 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -12,6 +12,7 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_hfi_gen2_packet.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ + iris_platform_glymur.o \ iris_platform_vpu2.o \ iris_platform_vpu3x.o \ iris_power.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 99f59b64f853..e182030bd537 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -39,6 +39,10 @@ struct iris_inst; #define MAX_HEVC_VBR_LAYER_HP_SLIDING_WINDOW 5 #define MAX_HIER_CODING_LAYER_GEN1 6 =20 +#define VIDEO_REGION_SECURE_FW_REGION_ID 0 +#define VIDEO_REGION_VM0_SECURE_NP_ID 1 +#define VIDEO_REGION_VM0_NONSECURE_NP_ID 5 + enum stage_type { STAGE_1 =3D 1, STAGE_2 =3D 2, @@ -53,6 +57,7 @@ enum pipe_type { extern const struct iris_firmware_data iris_hfi_gen1_data; extern const struct iris_firmware_data iris_hfi_gen2_data; =20 +extern const struct iris_platform_data glymur_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_glymur.c b/driv= ers/media/platform/qcom/iris/iris_platform_glymur.c new file mode 100644 index 000000000000..49edae8120fe --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.c @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include "iris_core.h" +#include "iris_platform_common.h" + +const struct iris_power_domain_data iris_glymur_ctrl_data =3D { + .pd_names =3D (const char *[]) { + "venus", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "core_iface", "core_freerun", "core", + }, + .clk_cnt =3D 3, +}; + +const struct iris_power_domain_data iris_glymur_vcodec_data[] =3D { + { + .pd_names =3D (const char *[]) { + "vcodec0", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec0_iface", "vcodec0_core_freerun", "vcodec0_core", + }, + .clk_cnt =3D 3, + }, + { + .pd_names =3D (const char *[]) { + "vcodec1", + }, + .pd_cnt =3D 1, + .clk_names =3D (const char *[]) { + "vcodec1_iface", "vcodec1_core_freerun", "vcodec1_core", + }, + .clk_cnt =3D 3, + }, +}; + +const char * const iris_glymur_clk_reset_table[] =3D { + "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core", +}; + +const char * const iris_glymur_opp_clk_table[] =3D { + "vcodec0_core", + "vcodec1_core", + "core", + NULL, +}; + +const struct tz_cp_config iris_glymur_tz_cp_config[] =3D { + { + .cp_start =3D VIDEO_REGION_SECURE_FW_REGION_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0, + .cp_nonpixel_size =3D 0x1000000, + }, + { + .cp_start =3D VIDEO_REGION_VM0_SECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x1000000, + .cp_nonpixel_size =3D 0x24800000, + }, + { + .cp_start =3D VIDEO_REGION_VM0_NONSECURE_NP_ID, + .cp_size =3D 0, + .cp_nonpixel_start =3D 0x25800000, + .cp_nonpixel_size =3D 0xda600000, + }, +}; diff --git a/drivers/media/platform/qcom/iris/iris_platform_glymur.h b/driv= ers/media/platform/qcom/iris/iris_platform_glymur.h new file mode 100644 index 000000000000..9f2877ec9901 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef __IRIS_PLATFORM_GLYMUR_H__ +#define __IRIS_PLATFORM_GLYMUR_H__ + +extern const struct iris_power_domain_data iris_glymur_ctrl_data; +extern const struct iris_power_domain_data iris_glymur_vcodec_data[2]; +extern const char * const iris_glymur_clk_reset_table[6]; +extern const char * const iris_glymur_opp_clk_table[4]; +extern const struct tz_cp_config iris_glymur_tz_cp_config[3]; + +#endif /* __IRIS_PLATFORM_GLYMUR_H__ */ diff --git a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c b/drive= rs/media/platform/qcom/iris/iris_platform_vpu3x.c index 72dd23dbe02a..4049e134c3f0 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_platform_vpu3x.c @@ -12,6 +12,7 @@ #include "iris_vpu_buffer.h" #include "iris_vpu_common.h" =20 +#include "iris_platform_glymur.h" #include "iris_platform_qcs8300.h" #include "iris_platform_sm8550.h" #include "iris_platform_sm8650.h" @@ -48,6 +49,12 @@ static const struct iris_firmware_desc iris_vpu35_p4_gen= 2_desc =3D { .fwname =3D "qcom/vpu/vpu35_p4.mbn", }; =20 +static const struct iris_firmware_desc iris_vpu36_p4_s7_gen2_desc =3D { + .firmware_data =3D &iris_hfi_gen2_data, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .fwname =3D "qcom/vpu/vpu36_p4_s7.mbn", +}; + static const u32 iris_fmts_vpu3x_dec[] =3D { [IRIS_FMT_H264] =3D V4L2_PIX_FMT_H264, [IRIS_FMT_HEVC] =3D V4L2_PIX_FMT_HEVC, @@ -83,6 +90,34 @@ static const struct tz_cp_config tz_cp_config_vpu3[] =3D= { }, }; =20 +const struct iris_platform_data glymur_data =3D { + .firmware_desc =3D &iris_vpu36_p4_s7_gen2_desc, + .vpu_ops =3D &iris_vpu36_ops, + .icc_tbl =3D iris_icc_info_vpu3x, + .icc_tbl_size =3D ARRAY_SIZE(iris_icc_info_vpu3x), + .clk_rst_tbl =3D iris_glymur_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(iris_glymur_clk_reset_table), + .bw_tbl_dec =3D iris_bw_table_dec_vpu3x, + .bw_tbl_dec_size =3D ARRAY_SIZE(iris_bw_table_dec_vpu3x), + .ctrl_data =3D &iris_glymur_ctrl_data, + .vcodec_data =3D iris_glymur_vcodec_data, + .opp_pd_tbl =3D iris_opp_pd_table_vpu3x, + .opp_pd_tbl_size =3D ARRAY_SIZE(iris_opp_pd_table_vpu3x), + .opp_clk_tbl =3D iris_glymur_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xffe00000 - 1, + .inst_iris_fmts =3D iris_fmts_vpu3x_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(iris_fmts_vpu3x_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .tz_cp_config_data =3D iris_glymur_tz_cp_config, + .tz_cp_config_data_size =3D ARRAY_SIZE(iris_glymur_tz_cp_config), + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .num_cores =3D 2, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((8192 * 4320) / 256) * 60, +}; + /* * Shares most of SM8550 data except: * - inst_caps to platform_inst_cap_qcs8300 diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 9e96fa218dea..6ad553990c89 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -493,6 +493,10 @@ static const struct dev_pm_ops iris_pm_ops =3D { }; =20 static const struct of_device_id iris_dt_match[] =3D { + { + .compatible =3D "qcom,glymur-iris", + .data =3D &glymur_data, + }, { .compatible =3D "qcom,qcs8300-iris", .data =3D &qcs8300_data, --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2897045BD78 for ; Wed, 15 Jul 2026 14:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124701; cv=none; b=Ws56EsaQcW+KQaliIx+uPr+G4iupSmbwGz71SXy0Gs0SvLyzl04aQtlEafo86BXfLPK8o3KFjbJnC6tpH+0+w5oJZMAYD81hviUOxJrqA2qHZ7/DNVHUnCalhpXL3nbU1oxoP6xMQu9z1EypDIa4QUqSQVw2U3W8TBAvmJkNh6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124701; c=relaxed/simple; bh=ThEpJZbAgvG9pFpNsommlTVzoWTwpScz9NRkCoa7E7A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DQwCIpyamEotc8ohgA24OokJKVWXnIkGwqH30/bt2f/WzVhLGO1Ry7Hjw+zSqpOKRZz5zb4mTGPSKJwDV0cUoEIPmAxWteOc0ug0XnFobOF81L+Ofw7l78lcpI7a6RpW5GMOZVz4kOeV+cBvPgDGLml5KhXJrZ4R/o9QzaDzcwM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lqlTzEc8; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KBSERJR4; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lqlTzEc8"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KBSERJR4" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3Pjl4006731 for ; Wed, 15 Jul 2026 14:11:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= vvV4pvswORAcEQzKnup026bCMWgfqp/zeG31LYavPqE=; b=lqlTzEc8uu+6lhsR p0PT64rERBqTMNOoaJ29a6OamYGcs15P0W1NSl5jmBE+oHGAuy8whoMotkIcVCLc sSLOiGyW7XYvwbNFsQ3G/Sf79WQivb4xRCMEdVHKzVdBfIRJDiRxX2m4LMBPXptr cYDuSJj8QUQ7N69uGtcVMQ+PjjdmFqg51rjRsf3CiE5X3mWY02BxVbsPtMf1Ce1/ hkOXNPCtxk8eOPhqDbG6ChlI+02IUqWdO0ytswLBGtEFWYIkPOw0F3bD/ZLTFH0T 8tGN8QEdcfwEm+N7ucXDUu5sOq/wAogG2UTBylrv8Zd2d+gYlByf4I4Ohbq0aaB6 NB0bxA== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe6529gj3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:38 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cceabd70f5so50740555ad.1 for ; Wed, 15 Jul 2026 07:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124698; x=1784729498; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=vvV4pvswORAcEQzKnup026bCMWgfqp/zeG31LYavPqE=; b=KBSERJR4EibAhG5nqLAnNzfc8GZ/luHnRWfrz7dZH++ftYHBw2FU08Epx2jOT9ENa4 Cpw3R7CBrgI9u5P1Lc5S8tFEn9gbK9vVfYLGG9Y/9fNTkVCdfmO9v+L7RZ9aNBi67Fy8 nyM20QHGuxcknKmpp7slied6ET+SYFz11Q3lZhWaJwpaD4T0Kt3Jcjje47tVfa4AuMIk u5D74Z4DkZqWjWx1YzChJzwYTjvU6dHBPCX/AxG0eHGMOzzI0ENF/hWk6daAZzMxRd47 Schef8Qd91F8nfXLFcP6BFWSsYb6yq/XA3DQhZ4DQpbNymm9le+123HKbh/X0d8MCrAP n/wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124698; x=1784729498; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vvV4pvswORAcEQzKnup026bCMWgfqp/zeG31LYavPqE=; b=R3JqcFWrohRsdaa8nP1yTXrW08fZeYDK+OM9ePqOKGOmOiVYg9LZrbAAoF2u93LhjQ 0/2zOWhSJ2WbUYNZ7EghCiIMsITj8U5n+gtv3gxemVyqTQ1LsfDLUd8S/okem+Yh8IbL EzHBkRF1uNh7g5tz4WUkYUoLkJkuGv4oI4tuOqAI50XnQOnb31UF31X/EL7rG7vLahqf 9uiS8avLSFHQF65UURI8D7cEajEXg2B3v+SZVM4kUWq3TwooMXmtqsIXVvDlHFuaMHeY rCxAIYfTcoLxS3pZIImrxoEtn6nxUUK3R9/vNxyKh9UvFcIXUoITBAUm91wtvk9U580W Qvew== X-Gm-Message-State: AOJu0YxFHdro5E6Qc8sYk5laIyiQ4gL45jAkBOdMu+gP7ZvexIuxnJHQ tukl/aBlGQcBJajqserdnbJFuq452yRRs+3fdGsqVAMz+0dycCZJFiR1xQUT90+WisIHO91vMgp Prhc4bS7uq9/Hv8TxSsb2/6CWx67FR3oB69wls95kc5dPVGJLBlQ5lidkEemb4l9N8s26EASqsj c= X-Gm-Gg: AfdE7clf3z3xaUaejZ9gxTIfudA0mfcfbr5C5t7V7UIrKPlJRbo7gPS5Z2mZVx3KMXk mjTwXCoC+uICBiWmWEO7r/8Q0HddtR1les8laGzulEG491PynxNAkiVYocZTAALk5JQeVJ6KqsQ Mdp7+uEze8DpyQpYrOGn5e4WqQW7xXoYPOVvsLbmVTaCwaInkATSLAItOs0b0MeStXauqhAKiMD YOC5PL/ATAgje2lqci9vrppcLc7/2DMCRnViiKnw/C8xnLN9PlU3CbqeGA38GtgXH/KVWfC+nOr pouaT7icMfQYIfq7/V9aLc5MUiW76PZtCJBf7Dh61slUYL2swxBdV3cQkKJ7wRR7D6SAjHBVKZG wuAdx6Ld3BJIyNCZY46iMELKCdm4ePYc1zRyBsOOLwyxZ X-Received: by 2002:a17:903:2347:b0:2c9:e961:d256 with SMTP id d9443c01a7336-2ce9ec0f113mr171957785ad.27.1784124697716; Wed, 15 Jul 2026 07:11:37 -0700 (PDT) X-Received: by 2002:a17:903:2347:b0:2c9:e961:d256 with SMTP id d9443c01a7336-2ce9ec0f113mr171957285ad.27.1784124697088; Wed, 15 Jul 2026 07:11:37 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:36 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:07 +0530 Subject: [PATCH v9 13/14] arm64: dts: qcom: glymur: Add iris video node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-13-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=4709; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=ThEpJZbAgvG9pFpNsommlTVzoWTwpScz9NRkCoa7E7A=; b=9ujYTpL9Bpg/XiFkL/oBYJbhhOvFR9zlKPdFHI1S6pIGQONr89kga4PtLHFj0EE4yrzDsfSGf vZClSs2ZlvwB4pDrCWWJ2drTRWol8wh8HdgdZllJG6oDbuMKh9gvFac X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX/q3ERfNqTKUR Fhqj4JHgcUa+A2quNLfHtQtd/iKJ6GbgJgUgqKUpqoZMsH9EQnFJc/tL1MvMwtO+tjuMuEkm9zv xIVdMz0qKvx+XIZHp3ijYMKpyOATjHwodglud4JS+8vRbFJM+of+V3D6HxT50JXCS0plhOt57kv jKVYDRCI7DEHs6c1H7Xd8lclcJrGB6MTYk7pS6xyCTDIVMz9w9CMS8gjSJKDQNxlYnVNxVaxRHo dOlTi5Kl9Fea6GyTjzFUXvshTNKU3Yhj6hyzSHln1I9qsvzHyh+xTKxw59JS0A7prbtfVFUducF I6YYvhPCFnFiFZPySgfFqeoWwfz5Mfc7qa7nD1v/ZtcCQ0iya+eXbMKbz8DZWkgykrSatV03ZiG 79ZGcs/lFbMEvlq5Sclk8ux9Evv8H2h4HC3+gYzY6jqHENpsjtC3ddTaE5eidBMWDQz3nj6y49x QB3EuJc1GHERDIuhYaA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX4JVsquA9eN/L vlXF6waZaeg7w7nBUvtEcErM7q8mWD2YLL7pLtt4Sic9M7yUsmKbAhnukVMmWgMvYXHNUuHIP/o tP/OFG5MlnAP++1yDtGLd+oUDprnuRk= X-Authority-Analysis: v=2.4 cv=bKcm5v+Z c=1 sm=1 tr=0 ts=6a57951a cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=6gKgyGQvtKUNEtbwe4YA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-ORIG-GUID: n6dP9lVufIRTRpgDg16Gmb_hykqw2xdG X-Proofpoint-GUID: n6dP9lVufIRTRpgDg16Gmb_hykqw2xdG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 Add iris video codec to glymur SoC, which comes with significantly different powering up sequence than previous platforms, thus different clocks and resets. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy Reviewed-by: Konrad Dybcio Tested-by: Konrad Dybcio # X2E94100 Asus Z= enbook A16 --- arch/arm64/boot/dts/qcom/glymur.dtsi | 128 +++++++++++++++++++++++++++++++= ++++ 1 file changed, 128 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/glymur.dtsi b/arch/arm64/boot/dts/qco= m/glymur.dtsi index 55d91c696a3a..0c09e700f6b5 100644 --- a/arch/arm64/boot/dts/qcom/glymur.dtsi +++ b/arch/arm64/boot/dts/qcom/glymur.dtsi @@ -695,6 +695,10 @@ adsp_rpc_remote_heap_mem: adsp-rpc-remote-heap { alignment =3D <0x0 0x400000>; size =3D <0x0 0x800000>; }; + + iris_resv: reservation-iris { + iommu-addresses =3D <&iris_non_pixel 0x0 0x0 0x0 0x25800000>; + }; }; =20 smp2p-adsp { @@ -5321,6 +5325,130 @@ mdss_dp3_out: endpoint { }; }; =20 + iris: video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0 0x0aa00000 0x0 0xf0000>; + + clocks =3D <&gcc GCC_VIDEO_AXI0C_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK>, + <&gcc GCC_VIDEO_AXI1_CLK>, + <&videocc VIDEO_CC_MVS1_CLK>, + <&videocc VIDEO_CC_MVS1_FREERUN_CLK>; + clock-names =3D "core_iface", + "core", + "vcodec0_core", + "vcodec0_iface", + "core_freerun", + "vcodec0_core_freerun", + "vcodec1_iface", + "vcodec1_core", + "vcodec1_core_freerun"; + + dma-coherent; + + interconnects =3D <&hsc_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY + &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY>, + <&mmss_noc MASTER_VIDEO QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + interrupts =3D ; + + memory-region =3D <&video_mem>; + + operating-points-v2 =3D <&iris_opp_table>; + + power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>, + <&videocc VIDEO_CC_MVS1_GDSC>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx", + "vcodec1"; + + resets =3D <&gcc GCC_VIDEO_AXI0C_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&videocc VIDEO_CC_MVS0C_FREERUN_CLK_ARES>, + <&videocc VIDEO_CC_MVS0_FREERUN_CLK_ARES>, + <&gcc GCC_VIDEO_AXI1_CLK_ARES>, + <&videocc VIDEO_CC_MVS1_FREERUN_CLK_ARES>; + reset-names =3D "core_bus", + "vcodec0_bus", + "core", + "vcodec0_core", + "vcodec1_bus", + "vcodec1_core"; + + #address-cells =3D <2>; + #size-cells =3D <2>; + + /* + * IRIS firmware is signed by vendors, only + * enable on boards where the proper signed firmware + * is available. + */ + status =3D "disabled"; + + iris_non_pixel: non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>, + <&apps_smmu 0x1944 0x0>, + <&apps_smmu 0x19e0 0x0>; + memory-region =3D <&iris_resv>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1943 0x0>; + }; + + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000 240000000 360000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000 338000000 507000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz =3D /bits/ 64 <366000000 366000000 549000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000 444000000 666000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_nom>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334 533333334 800000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_turbo>; + }; + + opp-655000000 { + opp-hz =3D /bits/ 64 <655000000 655000000 982000000>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_turbo_l1>; + }; + }; + }; + videocc: clock-controller@aaf0000 { compatible =3D "qcom,glymur-videocc"; reg =3D <0x0 0x0aaf0000 0x0 0x10000>; --=20 2.34.1 From nobody Sat Jul 25 17:34:03 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E97537C0ED for ; Wed, 15 Jul 2026 14:11:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124707; cv=none; b=c/VQPDd96lY80ds5mBxDQyMpq+3xXArsQlg53gRzDmKVMeJ0DfCuEeBCPlZCt4jvWQsIoNIXk0J6oIM27BaXojKWK767P7zw557MZkvZPwbSsnM2o/UYAJUkvT6fIOevSkS6NVHKrZCfnl/QwcLuWPFeDqqXBWfr3ReDfP6gUmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784124707; c=relaxed/simple; bh=HKovxLVfXVSwQAXngyNlJki7rLoRBolhkZVsnfCS6gI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ej53ati3CKUgt09Y/MV8sTStikWyubH0+5D2AGDFdHEIAL9aNGDGC1IRB5KB7+pxGiFi557EbvwtHs6vL2GNcDkKYaJTyPzlgVOWaR0g6FijXhoSeW/GobQ4v86OgeS4NiGsdV1zY4nK3aLhNLg0kt55Hnc5dJt4xlyWX21xHX4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=dCXW4hbx; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=b0kopuXM; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="dCXW4hbx"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="b0kopuXM" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66FE3c773806288 for ; Wed, 15 Jul 2026 14:11:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= DQ47DDAfNPWgexHv1Ma19CgalnyaHgiZ1WcVnWQbsZw=; b=dCXW4hbxx4hC4ym3 o2dppgNycVguLGhSpLiu8d4Th1o8MDTqko7B46IsiaQ2v3VxJj6p0Otj2oRbOZdt rYTKS0ZlbU9hOebV5QF49IlVgQBqKFIwio4vEgd7bg+QdkyvUBw51RlL83jAHfVC l6lOUhrivXTA2aqv2Nh2gj1B8/Jthmfk1w5lw/++zRwQtuZZsYioITf1piBBhKhN Op8sMZOrT2UfJwDD/82VMT/kYTSfFu5TnNihEGK6fQZmB6ATqPcZDjzdXRzJTv86 InRyoyKnrkDE/cxtXd4SShaUqk2Ykae9LCwZmc8RYfoYXW0XX6KQ72XLgCq+1f3i sm6Dvg== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fe56h9q0e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 15 Jul 2026 14:11:44 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cacf17c7e0so31386075ad.0 for ; Wed, 15 Jul 2026 07:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784124704; x=1784729504; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DQ47DDAfNPWgexHv1Ma19CgalnyaHgiZ1WcVnWQbsZw=; b=b0kopuXMWh/qqcvsBMjkB94x4dGvZn8lYLxeT1Hqp/QeO+exz2K/Oczps2KwyE+C9v 42Ert5wk9ZHDsYhr6bbZXfwGGtDlNgC1XiC0pzQyz56MokYgrZP9ucNQ1T5V41rNLIxL IQ82uVWXATwkcI9EZHs6gudxJdwHBjwniDf273J7tHdGLWqWiDKBafppovjh9Lj/W+4m uEMTT5TShkTEXtsDbhV2oVnMuDzHuvqhrXntpI0qf3jDKHKFtcXFZDSZ7RBuJt8dEzUB Iou5S9BFAjD9t0I+fYnHFz7GpXfTOqSLBeSMPNMa0vnsNJmkOHRGNU6I+rPoajylleCC 1xPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784124704; x=1784729504; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DQ47DDAfNPWgexHv1Ma19CgalnyaHgiZ1WcVnWQbsZw=; b=TpsXGbf21ESnUlpcdHTjSpVdxndlqMzYK5lDBzqvTSpnIm5kSlkh2UNpNlpuwTodMq rVgib+ak3Qb8dwoD9tVdPYbE686tp8uvDylI9SOHu1ivX90Qndj+DDUQgi1wKc2MzwMT CrkzA7rgkprxoNugME/Z2gvTZvr+OV44AEgApNyzhshXph7f2Un886OXQLSQBJMeGLAj 3mG8Nk25CtqepR7DUgB2zrEpmnxKhc92oeTHslNtI8u8xyvj8E3z6RKtJvFg6M7oEPHE 21y7/aLriXK3wmdStw7JKo5iBjJ7FD5Xu5WTyn8vVrO+S+toy3IZ0drYpwPbTqVq/I8Y LWeA== X-Gm-Message-State: AOJu0Yx27XSzj8lhJiUt1baPBqo+JfK0aQ81ws+5FhX1WHFKgpdmSwGh 5QdgJDOgOk0HqBHxVAKY6Ldb3580JbfImCzB4bvtRVRlQVOwv5La3TV1SKVwy/vZHA+lTrHfbGM wWANo06wuqIrOcSY+8m1TELujNooZynDe7lvD6Wr6lflnE/Z2TZ+r/0wcAxPQ1p2UWNXU3G8Q1d o= X-Gm-Gg: AfdE7cnskcskDaJ6FsqPYtXciyJjep7hHlnXs4hpK3TOS+DgH4gRSXhT+Xlly6jc+Bs ualQO4tNxSxokZRP/hqAUcDw0TWv0uYWAI9IqC0DgbcdRCBSO+5nFtPhBSnRs6UVaguJbsF9Sax 1B/O2w7F5mTN0Q+t2Jr3HMVhJjYeMEk+jm8P5NnhlhS8E+m09NAzPECZE2Tqcx3CZ8Qj4t8U2zV bbJxQ7CZD/j5jEWvtTxXOalvtIkva0I436GoCCBv5vFvBNowDSVnnKpgSeGkWDO1pSEM/fa0wx6 cO6Lj7VjkI7TsfDBhy/OP7veyOWb3MtiPS3uH4Os6W/j8crXgZkF4Qwd2hFt8O/4ehl/zPEcOlv b95lsgHVtR/z6KJGaYfDhe75/zdbu9ShhCp0s+VDwuXVR X-Received: by 2002:a17:902:db0b:b0:2cc:6b7a:dfcb with SMTP id d9443c01a7336-2ce9f028b80mr162598835ad.33.1784124703947; Wed, 15 Jul 2026 07:11:43 -0700 (PDT) X-Received: by 2002:a17:902:db0b:b0:2cc:6b7a:dfcb with SMTP id d9443c01a7336-2ce9f028b80mr162598645ad.33.1784124703496; Wed, 15 Jul 2026 07:11:43 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf1070b68dsm2913215ad.79.2026.07.15.07.11.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 07:11:43 -0700 (PDT) From: Vishnu Reddy Date: Wed, 15 Jul 2026 19:40:08 +0530 Subject: [PATCH v9 14/14] arm64: dts: qcom: glymur-crd: Enable iris video codec node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260715-glymur-v9-14-8cf2cbe12a07@oss.qualcomm.com> References: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> In-Reply-To: <20260715-glymur-v9-0-8cf2cbe12a07@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Dmitry Baryshkov , Mauro Carvalho Chehab , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Bjorn Andersson , Konrad Dybcio Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Vishnu Reddy X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784124602; l=1011; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=HKovxLVfXVSwQAXngyNlJki7rLoRBolhkZVsnfCS6gI=; b=Yj06tNo9W4Sz5F9Y8NffrAmj+GAbIKN79t2NNC+0Y4uOLP55xyUcSy6bwfJTvc7P1yLclr8us u1O80vjjnzBAU1bFxQc8ueCpHZwWR0/+xWybbd3MF9B/1V6E7Pb58UY X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Info: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfX6HykYe7NA2yv 3uAM9dyf4JtqJvMdBEJC+870TNQ/UGOm2DywW50eabvV0yYsriGTsAieWWEEA2OmCsZmBjdUTnW u6Oo4CPZtpJZkaVrh76+ctl2b5vtPVA= X-Proofpoint-ORIG-GUID: wPyPEmsgeBY9UVN3BqB-buIlu7RYUHUm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzE1MDE0MSBTYWx0ZWRfXzKr4UulPuPS0 JEFLF7yuadf47yIGub7h4q3YO4kIN/zSLD9Ctc6yy5jyCrjuFcGWHnXg3lp0uJcWqkr+YCloM5m +c8nsL0V1QvxH+LyOmhjsJcUxHkKG3oZ168WaC0Imu90lr6wGKCugpC4AA+IS3Vh7H4alRa49Zz o1MtxY4vN3ODGv+um91R9u3YDneb2i1MYK1L/iiutDZL9oT7sm8DB3pTIhtUsR9BN4kEMOzdYiY EQleevZPUxsEK7BwOi3Fu85vapSSchoUa5PMbinGtm/FglRTKgvrPhX8o1ygPeoc52pBTs8fy8T 1I/GfyzKG1ULYlQl6FVbE+S/xyZhxC9Ma9EjKZ9LUrO6vRFO3dg5m3dH4jmy4fZLzujmAFOUs5a XDJyE6BgxCYb2kEECFg3vdnlHk4OzZOiRyxGRpUKHzVDeJqvvBqjtUU8Q1bFdUhZb9ZBRWSNT4A BQbdeNsFpa3janCPNxg== X-Authority-Analysis: v=2.4 cv=LpKiDHdc c=1 sm=1 tr=0 ts=6a579520 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=Dn0IJEph4XI5J7oltBAA:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: wPyPEmsgeBY9UVN3BqB-buIlu7RYUHUm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-15_03,2026-07-15_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607150141 The iris hardware block is described in the glymur SoC DTSI, and enabling it here allows the media iris driver to probe and use the video codec functionality. Reviewed-by: Vikash Garodia Reviewed-by: Dmitry Baryshkov Signed-off-by: Vishnu Reddy --- arch/arm64/boot/dts/qcom/glymur-crd.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/glymur-crd.dtsi b/arch/arm64/boot/dts= /qcom/glymur-crd.dtsi index b314c6dd423c..3ade94220667 100644 --- a/arch/arm64/boot/dts/qcom/glymur-crd.dtsi +++ b/arch/arm64/boot/dts/qcom/glymur-crd.dtsi @@ -695,6 +695,16 @@ touchscreen@38 { }; }; =20 +&iris { + firmware-name =3D "qcom/vpu/vpu36_p4_s7.mbn"; + + status =3D "okay"; + + firmware { + iommus =3D <&apps_smmu 0x19e2 0x0>; + }; +}; + &lpass_vamacro { pinctrl-0 =3D <&dmic01_default>, <&dmic23_default>; pinctrl-names =3D "default"; --=20 2.34.1