From nobody Wed Jun 17 05:14:06 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 D016432E6B4 for ; Tue, 28 Apr 2026 03:56: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=1777348568; cv=none; b=ODpM93m0eD9fiVG2Io5BG1K7QAJxC4QDVFksbSkXo8gFhssMDvGEYojEeqLDHjgbbuobDYDcDzaLLuMK2r9au46VtRVmn8q8TtmjmetT7p0AcGR88OgHzAdq0/jTQXvAhbSdNSF6tSkU86oYXNJ6rjh76qeAIw1vZHHumFOLHho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348568; c=relaxed/simple; bh=9ojkIAdTpgdWLJL63T3L3LzXB40PPdXzhWOQLp7Cpgc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ENOeto3w7WYH/aQ10H9xblbgptnTw95xIeh+xky01jwQmEX0w+ohJUbDofH/SkEIF1tTx1wSRc9VPKPW3eQo6ITCjTyK28ikNsBwYCxy6Kye7Nivhj2M1Y0m8aJ7Osk8SB0SBqeIcfBxRfxO9kCIDQ+UyQF9eLdSZYCPeiO/DlY= 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=mzxslg0g; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ChqRgFx6; 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="mzxslg0g"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ChqRgFx6" 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 63RJfPVL2383062 for ; Tue, 28 Apr 2026 03:56:06 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= tdvgFuqYyOWNHAPEPDaWlWX5rBlDjzWDByFTGDon+SU=; b=mzxslg0gP7zoCWL8 HK1m+jk/GCKz0EfmxyinXpZzoW0GwVrVBWb3dCbH7fX9eSQKEifMf0PES3zfNDn/ 5tuL1k1R6zmNzWMSO5Xc8ow40h5IIUCE0GI5HvhcKp8YURwnqK3Ib7iJpAxj54/s GycsCfsj1noxB3KlHZMbUFPErqmGt2RrQ2Q9JUZN7MKqnZWp5W+I5HQYL3F5uv88 j/Z5YH5pHXd9X4S5LHwxNiAshXjO3isBmizvU3qpadfv5M4ijL+OBebeXyjDlZjy KkuU1o8DLzXLP9qVmI2sw/e5OWENrpwWdnx/c8sylXD+tFruEC1A4Lq0fdqZVAwP +eknaA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt85xu472-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:06 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-35842aa350fso20953968a91.0 for ; Mon, 27 Apr 2026 20:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348565; x=1777953365; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tdvgFuqYyOWNHAPEPDaWlWX5rBlDjzWDByFTGDon+SU=; b=ChqRgFx67mEnwnc7ur9CFHND0emiOTwDZY8zHZ4M6BirSia665v6EH83cSb8cMsIb9 aMPs01D7eo6TsuMVOYNbz1AeFVquVbD2DByEz9W5o9jL/3A5rBcJlLmUsVb8ZCZvatTx qL5bzjQ1qdf3Cd/6/cl6W4iTlhWlGdQ7WN4qtg5gbrnbA4r+tkM14A0J2jJulfeuwImK 30Lb85oeViOMSnCgfztJT27Z9NaVgetr8Bz6LbCPVIMm87yQ5WG1wYBzj1urG9Y+aDsf IIRnNQu3h/MgxE4CcTfGzaNH/rj6KRWyGPML3lWMGI4RKFaoTk4wOX/as8zHL5NWKQSZ Y+ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348565; x=1777953365; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tdvgFuqYyOWNHAPEPDaWlWX5rBlDjzWDByFTGDon+SU=; b=amG/3mvvC29u0Fr1XwOrNphQjR+36TVkqEm8tq5jt+f5m2Po5D0WYGdcwRwcJTpmrd KCAr7YL+yFn8kC9R8EFDgBNA8RsC6fg6C7RBJWz0FcYjhUe9GuQsVRjwqOO1ykhzPxmV SsXhXnMlmSB2YTEgj8at7vl7yT+qMshN/NJOGDbrXORq4TfwsyGlvQSit0Cwt+NTPDU3 kOzDJ5u3aNvQn7rz/OTZzLp55vT5kui4CnxtCN5qrJs8axjJungz2Hqfpdo38Nds6efr Z1foNRfaT4gDpvzSSR/+SAhdz8ZV+vsp8TRAtC5lLf3Ry+sw2XYSdWhjgSuF20QnBxav t3MQ== X-Forwarded-Encrypted: i=1; AFNElJ/nVibKdIhOywDd0KqH33HDnwiAG7dgGGeO9NiUq1w+MTtyqquMLsQIfO8/I7Xa/nWudPYh+Zx48+ARC84=@vger.kernel.org X-Gm-Message-State: AOJu0YzA3vMPuViKZnlGr0gV+RIOfZ0qX9qUIEdUtc5qd8QT6WYE++2z oDyuK+Gnd7jxC8YVP84HMw3NzSYq5jY3zMtiJbXYxS1d2CaqFHXoTekPPpGoJ8pMuMa7N8n37or kVLnXa8ZUfeT+lMWp1XsDcfST7bw0Hyeafn5oeMn37KLK4IqU4ibexWfb5Q4mSiUmxZg= X-Gm-Gg: AeBDiev+x9RTF+pERcYkiqUJU13iXBquxQ0YdAf1T6ZnK/teRBfeYWtBWkNqaX7tIFr iOIUreTKeOBa/57vkg5g4L+E+ICB5vWKGPsl90LsWfEiW1oMl0JXmunaapGEJA/2GbSvFVDo61E LoAbMUvzdx5LxdffSyo+G4uYJT4lEoZR0a5pJfL+XhgD6DZwz5Gg9WdRktkzoNRqfqMfKoJW2qP 4jwdqfekSNlhIExfPC474NfkGFrgI9icTN06bVOzUwAuXMLHAHYtmUiow5NylP/D6NEGtT2lszZ XsyA3e61mdW6wKqMgXRY8YHovmh+sPN3vJwjcbGad/6B3U/dT9VdC1XtiQICjZLAiU6lfA2hdAj k21fSIpdjnQS86tRBNN57jaDWQxE5g5Yn4Qo3HesRnbAXhOPcllYCESu2vEDyyz3Z3w== X-Received: by 2002:a17:90a:d646:b0:364:78a5:8d40 with SMTP id 98e67ed59e1d1-364921b0f18mr1617217a91.20.1777348565598; Mon, 27 Apr 2026 20:56:05 -0700 (PDT) X-Received: by 2002:a17:90a:d646:b0:364:78a5:8d40 with SMTP id 98e67ed59e1d1-364921b0f18mr1617163a91.20.1777348565020; Mon, 27 Apr 2026 20:56:05 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:04 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:07 +0530 Subject: [PATCH v3 01/12] media: iris: Fix VM count passed to firmware 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: <20260428-glymur-v3-1-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy , stable@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=1361; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=9ojkIAdTpgdWLJL63T3L3LzXB40PPdXzhWOQLp7Cpgc=; b=ay0dYnshvA44WROZCAGWy4lKalYgcb7yDOo0fRviOiuhVcATuyWxdErrTpNeQbm6pWWNnv4X6 u3mbWherdU6BTtXEW7QFWSFFg8yQ+9jQhUvkN+qqjo9clshZxPEAcC6 X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Zs3d7d7G c=1 sm=1 tr=0 ts=69f02fd6 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=nrYi3PkkErC94SPB-twA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: 5xs8aOrv2uiAkeGDtI6xTPA8bwJVjA0C X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX0RwonJWdiv0g itoxWZDZyKT9Sg51IPbbzhbtYkrxIMTUirNzUyU1kJYgHdhIUAH+dx0uJ+C64Vhqo0ffsvP19RE nNDOh4Jgx7NcnS/RdSCMa2zSAW5/rUyYkjWHCpNu5K6ShooK8tFfK6wZeKzofRUPHCX5f11YU1Z QcoO2D8oPaLDASJN9lDciFVxDTSgVgVoa7IUNt+iXvz4UcsdW27rQ9V4pgFPRZgZ3FJ5N3/TtCI 2Tcs921vn0Upwlc+eup3nuUACiBpxvDCkAEDkZ/5uEBbO8HcIq1jzkWpwL0BVT3HLsksO62Qr54 uleI7HAckLHg5AP2vxd95cWaZ5Ev0as5GTqfmg5hXS1HDw/pHF6wJVvabXe2fkOzq6fxHT+6aQw YFnRoemRkjnyxq52z80TOgYAqvtW9NxSJIpNASF4q5iczOFT5UmDsaCJdO8JBknKDoIIjQs1mWV P9Nwoqi2Ooc+LqKmt0g== X-Proofpoint-GUID: 5xs8aOrv2uiAkeGDtI6xTPA8bwJVjA0C X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 On Glymur, firmware interprets the value written to CPU_CS_SCIACMDARG3 as the number of virtual machines (VMs) and internally adds 1 to it. Writing 1 causes firmware to treat it as 2 VMs. Since only one VM is required, remove this write to leave the register at its reset value of 0. This does not affect other platforms as only Glymur firmware uses this register, earlier platform firmwares ignore it. Fixes: abf5bac63f68a ("media: iris: implement the boot sequence of the firm= ware") Cc: stable@vger.kernel.org Reviewed-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_vpu_common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 548e5f1727fd..bfd1e762c38e 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -78,7 +78,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); --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 3A348329C6D for ; Tue, 28 Apr 2026 03:56:15 +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=1777348576; cv=none; b=ZlFSGJoXBSBWOWCshlm6HhsLbjcw7a59+0PoAOpBvOVN2pu9UM3AxNysalUXqi1iXK/WWEng/pYwcBb2y+fhjRY9+OkTkIMrnpc6ZNECWOsUjdGUXdFDj2bSfHWft4f5cbONMdt6ZjvyQgfvbGrFoZ06tiGs1N1Tcn5DIdqqABQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348576; c=relaxed/simple; bh=AuIMbc0fKqW+ZtVnfeBML3Ai6KXaZ8hBVqiyyzdw++k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tqWrxGfMOAXzIPY+CRGAACmYPHttv1D0E2ss3o5e5daJwQdt5FNoRjtEOfxrPX/XzHcNoBY30VU5Lb2HobkHwU5P4XxSplOHBBzYwnj3U3L3aPL3q81vV96rlonFtL0VFwXQBoPQbR681hUS8Dr1mJSFzNdRAqSOeDeQjdqOqjc= 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=NjosH5/M; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AyqziUhe; 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="NjosH5/M"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AyqziUhe" 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 63RLtqB62913806 for ; Tue, 28 Apr 2026 03:56:14 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= hcMM3x7M6VCbANVsmt0CnWhUSF2Bk1TlLTXZNDVbg9o=; b=NjosH5/MJGbbl3x9 OQwXmmIU1g+q+D8V25zHLygIQz0yFU0vCfQGzqGF8DWFcd+m4p6Uw7eq+CXaqwOj takx1CqCVSJLr3bI2Kyb0SF5UaT6qaFi8ENjAnlTUw36BmPkbKvpL/342Egrps3f 1JtofDaT3pArcpkpakbbZzcBgEnvxLPBNf3PqJcfn6DxzsTQOfEeXIQpJvfgC9RY BXsYDDv2pYRu8EiyR81WH8ddUHns+/znjEzt4wJqgdXQl+rGyYwXa+ZQY4EZQKT9 2hATfttpD9YoGLuwRZtrJ288QacqD+VBFjUtuFkfr9YpxWiCvIHe7sE83xhQTw5k uUuQ6Q== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt26xmmah-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:13 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3594620fe97so24272801a91.1 for ; Mon, 27 Apr 2026 20:56:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348572; x=1777953372; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hcMM3x7M6VCbANVsmt0CnWhUSF2Bk1TlLTXZNDVbg9o=; b=AyqziUheWrllu78QzDbMU8X77DDrWdIqYPLLjr2Dx0qg20tA82qyBz95DKzBlFDUrI Tb1g7ZfiPq4O6OyUgFsIivqkJ7wSaQmaMeSB8uaYimy9KKyiUjX5rEZq0rTPh/CasdDs xdaQrJwPAe0Et9iN3F9w88qJkmViT5Tt3R8g9qpgjULfRc8YO7ZPLV+2JVt5QaJoI9lw +oR8sXD8t7yhMt/pKlW0D+DTAk6q5HncIc+EaslkS+s0/vkAO4utrBqG9D/tlcq8dkeF zxuv0/g0Rnw3aXZOYf7hw76VBCrJStZCh1U0MnwrMFWlzXZUd7Bt5mt/9IIkNNgcXvO8 LN/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348572; x=1777953372; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hcMM3x7M6VCbANVsmt0CnWhUSF2Bk1TlLTXZNDVbg9o=; b=D16uWMpvwS+l9isGv4T8Stq2LWkvO6l2seIAjQSDU/+zO86x0FeB2ME0zxviivxaSP pqbdQyE90Qkv87xT+dmQiauRCWdYQ6d1FXe2D9SOerGBYAfUlTGyp9TzCUvc77cDPRuW 7LwTUK9G3F3gAOdhM74Yka4Os+uKrHVvAAqUO2rl+1/adypnbRHa64FUY0CkgFlqI0cM NZAi32N9Vh86MjJde971s2MGZfWRVx6HrZ7soxyMNqQ3tFxqJZ+EN9huuvVbGCIXdCq+ Fv+wu/te4e59QpD7YprD4PZ1hgF3BPH+6rNoblFIVpN+Xazgs8+wTgm1xdEjhUNAu0pD 1OZg== X-Forwarded-Encrypted: i=1; AFNElJ9EHifT9BJuJea+lrXannKXtTBXiqj825Zm2A1g6J+VSW44U0zqWGFTibHE5WsUvtAX+WyJa3JBwmc0w1A=@vger.kernel.org X-Gm-Message-State: AOJu0Yyw6Q5xNSXc+pAClBh8CTLWpzwt8gXU6t0VsX3H/26JU7S56i26 144GBVXKwEI5WRP1v+ctR6czpRTPnJBp+RttWc1uoPQs68Pw9aK/d5jgW6S4epHCDM1HKHh1z9P TgJcH1yHXIzhOumQ57xvZvHUqg4wqFbD34rJisDS29YKylF0u4+mkjBooxH0eHTCZIpE= X-Gm-Gg: AeBDievAADhDykFQVatEO8+l27uVmfgIyCCgc4bt7sm5Q5eryPZFlsm/5753t2vbtgc xp039SCUrmIExWFwGEuZMqvfiDKWy7XRvlBYAujLk/bz2jVTUZAKcGWmEqy2ttrw5/VQ6AvIxPo 4dCWLRUrUU2/NQorIa3bSzhZpnDPYHwYkES9nOZmSJu+qEMBMeH2gX07yfKv6UYlcoo2s+Zfwxl eNEycnqspmhTb2nnMzg4j22qx0AyByruwtKYvLXf2ipgYDaZCbpIT4O3tTwURYMW8AVa/onD3kz x4x6N4VStCi0RgpL30C2IwEfQ40Br23tyNOZz0vcyOb7Gv932gisAZ/PrQKcUj2C3zRCnRgkBVO NjYHJGmDU9Ql/pZnHNL4bDxkYp1zQwDKM9jfNWC6E3D6SxCOkdCrySM+8Qc5BMwb5Gg== X-Received: by 2002:a17:90b:4a10:b0:35f:b6a1:8d27 with SMTP id 98e67ed59e1d1-364920a614emr1430111a91.18.1777348572298; Mon, 27 Apr 2026 20:56:12 -0700 (PDT) X-Received: by 2002:a17:90b:4a10:b0:35f:b6a1:8d27 with SMTP id 98e67ed59e1d1-364920a614emr1430084a91.18.1777348571760; Mon, 27 Apr 2026 20:56:11 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:11 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:08 +0530 Subject: [PATCH v3 02/12] 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: <20260428-glymur-v3-2-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=8561; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=AuIMbc0fKqW+ZtVnfeBML3Ai6KXaZ8hBVqiyyzdw++k=; b=GH6JDhHcNmOBMTFZwxThhZGKJkeSOwwpbkLX8YoNZDArW9Pkov0k3mbieDUOvnd1NR1a3rLKf 9lyS/xzF2LdBDWm4aun//zKLF89isk1xpTb+k8FihcZQUrbr4bvoo3Y X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: EUq8G5ik-8EOyZWRulPS5iOcv0yDRQzO X-Proofpoint-ORIG-GUID: EUq8G5ik-8EOyZWRulPS5iOcv0yDRQzO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX+S5Uc+5YvJTB 7HtHcIzBp6avrcttZL3+leFTWD5gKpXm3VRMfiwQosoUQStkhNbyjpP+iEt0gTc6PUi1ypwiCmb S+HTaT67HfqXWo1SjgGLkOgiHs64XcOs3gTEauP1Z43v+YNuubjacqR0Hqyi6Sso79N8h9IGFLf 1wDCiIeb3ZE4hzzjH5TcigwbmkNLbwM8aj8Dyzm9GtV72z5tCG573PzTKqHDd40IK2iP2VIgMKm oflClhNvaNPRDOQdZDk+MrAr1rke2lbOfxARjI60cua3oAPoop6Hi3h5/Wjff0+5XhxXAr52bVY uhPdm+iRszfk8nDXfZCj+S9HWjBeDGCBcDvqIZPWONQnRZ3wEZG8LisTccK/oEvDt/G4ooheSss Yxib4TGqhiBRzyelntuTr5lldqrIAhwi1EYyxcWl1/BYQK1w1xxKNPljDszMh7MK+4gDQLIQtBS JX6hUKQUI51pLXIiLnQ== X-Authority-Analysis: v=2.4 cv=FM8rAeos c=1 sm=1 tr=0 ts=69f02fdd cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=gEfo2CItAAAA:8 a=EUspDBNiAAAA:8 a=kWiFqobyyPn0S43oj-cA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=sptkURWiP4Gy88Gu7hUp:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 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. To accommodate glymur clock and power resources requirement, the maxItems constraints in qcom,venus-common.yaml are relaxed. This allows the glymur binding to inherit from the common venus schema without duplicating shared properties. Signed-off-by: Vishnu Reddy --- .../bindings/media/qcom,glymur-iris.yaml | 211 +++++++++++++++++= ++++ .../bindings/media/qcom,venus-common.yaml | 8 +- include/dt-bindings/media/qcom,glymur-iris.h | 11 ++ 3 files changed, 226 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..3c5305b688ec --- /dev/null +++ b/Documentation/devicetree/bindings/media/qcom,glymur-iris.yaml @@ -0,0 +1,211 @@ +# 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: iface + - const: core + - const: vcodec0_core + - const: iface1 + - const: core_freerun + - const: vcodec0_core_freerun + - const: iface2 + - const: vcodec1_core + - const: vcodec1_core_freerun + + dma-coherent: true + + interconnects: + maxItems: 2 + + interconnect-names: + items: + - const: cpu-cfg + - const: video-mem + + iommus: + maxItems: 4 + + iommu-map: + maxItems: 1 + + 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: bus0 + - const: bus1 + - const: core + - const: vcodec0_core + - const: bus2 + - const: vcodec1_core + +required: + - compatible + - reg + - clocks + - clock-names + - dma-coherent + - interconnects + - interconnect-names + - interrupts + - iommus + - memory-region + - power-domains + - power-domain-names + - resets + - reset-names + +allOf: + - $ref: qcom,venus-common.yaml# + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + + video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0aa00000 0xf0000>; + + clocks =3D <&gcc_video_axi0_clk>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc_video_axi0c_clk>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>, + <&gcc_video_axi1_clk>, + <&videocc_mvs1_clk>, + <&videocc_mvs1_freerun_clk>; + clock-names =3D "iface", + "core", + "vcodec0_core", + "iface1", + "core_freerun", + "vcodec0_core_freerun", + "iface2", + "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 ; + + iommus =3D <&apps_smmu 0x1940 0x0>, + <&apps_smmu 0x1943 0x0>, + <&apps_smmu 0x1944 0x0>, + <&apps_smmu 0x19e0 0x0>; + + iommu-map =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_axi0_clk_ares>, + <&gcc_video_axi0c_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 "bus0", + "bus1", + "core", + "vcodec0_core", + "bus2", + "vcodec1_core"; + + 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 3153d91f9d18..bf926c602037 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 video-firmware: type: object diff --git a/include/dt-bindings/media/qcom,glymur-iris.h b/include/dt-bind= ings/media/qcom,glymur-iris.h new file mode 100644 index 000000000000..dcaa2bc21db5 --- /dev/null +++ b/include/dt-bindings/media/qcom,glymur-iris.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#ifndef _DT_BINDINGS_MEDIA_QCOM_GLYMUR_IRIS_H_ +#define _DT_BINDINGS_MEDIA_QCOM_GLYMUR_IRIS_H_ + +#define IOMMU_FID_IRIS_FIRMWARE 0 + +#endif --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 8516133BBC5 for ; Tue, 28 Apr 2026 03:56:20 +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=1777348582; cv=none; b=EhtVxxqFnZ2jzrP4R9G3eyrVQ8uyxdlUaEmdm/hdWTQ6Ydzf8EBkkH29jfTZ4FMibfd0xXSGG/AeW4WjF7WBJEn/1qbWMYoYLM6KGf+3lA6xZn5+rcX/xbxfc/jONeOE+nLTXVPnG76LQno8BFbgvfO2R8175cZMH7ldOBBWxuQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348582; c=relaxed/simple; bh=GBsVTS4l4F18YjaJ/58wFmxWqzuYLY1cBZgZWMYpxjk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FefxnBVmoJH5RkXJungVp5AHCk98myZ+JQVzPuYnaaGBIEMg8DM+nmYWqLw1tat6Bl0wW1WjW9BQnMmaWlil+nadTVRnpf6p4dItFBsyrcdvDbMehRKNovoMp0Kh2gMMlg56wdXRJ/FmFE1iN9yn5BStTTQlDF7X2sgZCKpFuyg= 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=I8+dzt+m; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hm2SdUMa; 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="I8+dzt+m"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hm2SdUMa" 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 63RMTJbw1625047 for ; Tue, 28 Apr 2026 03:56:20 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= 4907GskeGPyGqTJtsNAB5xkShzE2fjp5lObjsv/s6Gg=; b=I8+dzt+mUZA/OFcw Q+UdE+mg5qijzRIiGORe665Zf2gPQQPzusv91eHAoP+QWmxy3uc1vph5Cd+dvGyz B3TtHDihsHsU4d4m+gcJZzOmIs7f37k46HMXueusT7E7znnwnJ2C2IDhBsQJVcpL SIKsifnzFi6WNysU3E0sHXZZfT4qA9aFOJdhUEC7w6qaQI3EfoBOhd+Sy3m58bUz dLVgj5evrLytsG0zLRNFvqirEa8NRb0lQhiZmLLWZjePv5oYPgCybAFuAmw8yfpe r45zoHa/KmADNQTqvGCNintlQ+2ezlWavmPeGDYA1jxIRGZZSQQi5jdio0B9ymJb zWDV0w== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dtgms91h9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:19 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-354c0234c1fso12067592a91.2 for ; Mon, 27 Apr 2026 20:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348579; x=1777953379; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4907GskeGPyGqTJtsNAB5xkShzE2fjp5lObjsv/s6Gg=; b=hm2SdUMafWMjLa+L10VlpMBJxMqUveAPNr1+jAtuyidHmw/UydhBWrrcnB6ezqtZlj s/InLUk7BfRN5GlwP3npnn1ZUJBsEJ3MHyaYHkwkkMsyAItxGvbz4CJ8K56fbs7vxaoq 0LYODQuqnZbEUgnUvAt3YfaVoFDl21ciZpgma5H5nKntauJs8MWYpYPvuuvMFrkLbytr 8naqGF9EA8h01AI+eMrBVJ0AADjSl0Xr0HYjdgQtvIJBzwXkTmFvpFeSvum3siilGb8i bY2mWc/LK/OeAUQG9uElC6EPwcOTcXK4XNipmTjsCSGI3xI2vylPNO1ZS0dxS3dH+RiQ VYPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348579; x=1777953379; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4907GskeGPyGqTJtsNAB5xkShzE2fjp5lObjsv/s6Gg=; b=jR9E3VA2pQ4atdv5kwIQhDsnF5l2HXrhZ3cpDQem1bxfH55i67Us0o4WXRyMsRaKHK cJSPG4uzkHXQ9RQgRJNTctaN5xQl/8+q/X0JXEGabrYOvUKA6QfQVT2vUYM3nNw+Hghy mSv4IBgDEdBdQzMxhPJL/85MkFRyu0HFeHgUU3E3mv+zKOWRIOF0P6Nffv2FR05eWSue ROFZoGN2tTGPNVKISpT6JCZd/KtJmcJPxxreMttP7n3KQ5XGA0iMdz+39j8OGKpTDcY5 4EQMFBOdphP399eZFUPkCpaigIhXPWHoigbavZkHHu2n73BWuPKkFJGbQviI9ul1jgpg P1gw== X-Forwarded-Encrypted: i=1; AFNElJ/LUYsPfHlpXl5trMKTyvaPc0urrakTPJOkcyAw/DUyoRuk5tf1xpU9FoNQrxcV98xiNu5cW7FwSRvonOo=@vger.kernel.org X-Gm-Message-State: AOJu0YwkO0tWqwAK6t1rRjtfm6Gx8Z8SuAiqjEbtnupo3aDFAZL7RQ49 oizFzgIqBAKCoX3Nay/AIclREkPlBOp87pLS3ZbqJo9nhhd12QV3w8UKJ8Wjw9cvhXl0QKv5xt3 /Oa9xswALsA4fczHlImpVeJ33Yn0v2ggqWotShyzKFmpqvBJdkXoiY+lQLzHBRRq3qbY= X-Gm-Gg: AeBDiesIxJcBRRkalZ5VAsuVssHsqhpODplcJs5NcJQduh1I0RYgCXIauViUSzMl+J/ vQzT2/qXcS+SyLwEq4sx0LWpPWfgRn3Bh0xl6emdtqoZ1cIR5nNvLvkrnByqsjNocop+IyujpZS QaY8rmFlNtfN9P9Dj0oT8yiW621Q8fToYjPRhzN7JYEvhkEauFgj0MMYfNE6bAZJZZhk8ZEfqrn YboWeu5cE2ruPM4vElrBEgpcmaNvxBd/Ttz9x1Ygm2hTGq3aEFg3Mtz9BGvIX41DVGjpw2jHcZk h+IKZbuewTJ6YlDrhm/vBJBFIyJtOtdfNUUUwdhSiLR4jhFny8wzRTX3zdsHWaIabf54TS0r89i 9Fby7Ytx8OyO6+j53CAO2y2ExvwLbm36ZaAxMHOCrEaYJbHFVwL/Y90n866N8izIEWg== X-Received: by 2002:a17:90b:56ce:b0:35f:bf23:bd78 with SMTP id 98e67ed59e1d1-3649200cf1amr1423524a91.16.1777348579160; Mon, 27 Apr 2026 20:56:19 -0700 (PDT) X-Received: by 2002:a17:90b:56ce:b0:35f:bf23:bd78 with SMTP id 98e67ed59e1d1-3649200cf1amr1423485a91.16.1777348578663; Mon, 27 Apr 2026 20:56:18 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:18 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:09 +0530 Subject: [PATCH v3 03/12] media: iris: Add iris vpu bus support 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: <20260428-glymur-v3-3-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=4228; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=cziP+P95lYoSiLg+5MW5xEwescL6vgvBBGLLAvVvoEY=; b=bi9dRaFIrDbQfuqXmL+MFazz4osr3HdG1aIehLgn/X1+wUWJ9VgQZej3uqWelBzjJUuiqdOPD sVBIXrgUGn9AkOPJvfaTFhWSfp7j1c9usI9diJ76QnGnbEwsUpL7PWl X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: vQSeqC-51iaaWHv4y4wTB7hqvSok-03z X-Authority-Analysis: v=2.4 cv=R4gz39RX c=1 sm=1 tr=0 ts=69f02fe3 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=rZQGDrx4aKZhb0zF23kA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX11OxcD0BnoLX J7Ag8Dhp1zhZgzCNzBk7AgsOCiIRWDMl51MddyOq5gS61R7aHtDE31wQGthBM1qk9p0UtyWkqD/ lV9kcjgmAwgkW9c+rReBsHl+9qCmMz9IzwxsF9riBxPXRC2CH6ypJ+BrRV0tRffvl/D1SWeo5l6 VHrzlyWG5ahOvG4+VY8VMaIyqSyvRya87bhaFqf6QUDwhgH+KQm0HpfyXM9gLcO3ruCwIijW7Yu oqUUuG4yOx9e7zuZJSEQeLdmJdzZihHKD+5bVgqBNRmUYaxMLeVTmQowqpxzFZ7bpADzz2/LAXH csc1F/mrF/3WAj61GntNLNDAHE4te6obKITSihsrzk0bJ5e9WqKlUWeXW8QVVSEQ7ugCYuY4nEy hU25fujLp26QDqByWi7lN1GiLiIgDqmJAjiRzir/SFrWOl4Iihb8UxnLelFpWvVg6lqVo9wXurh YuQN4ptUwN6rm7GW1dw== X-Proofpoint-ORIG-GUID: vQSeqC-51iaaWHv4y4wTB7hqvSok-03z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 From: Vikash Garodia On glymur platform, firmware loading needs a separate IOMMU mapping with its own stream ID. This stream ID is defined in the device tree with the assosiated firmware function ID in the iommu-map property. To create this mapping, a separate child device is needed so the firmware memory can be isolated in its own IOMMU context. Introduced a new bus called iris-vpu-bus. This creates a dynamic device, and its dma_configure() callback calls of_dma_configure_id() with the function ID provided by the client to map the corresponding stream ID. This sets up a dedicated IOMMU context for the child device. Signed-off-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/Makefile | 4 ++ drivers/media/platform/qcom/iris/iris_vpu_bus.c | 69 +++++++++++++++++++++= ++++ include/linux/iris_vpu_bus.h | 25 +++++++++ 3 files changed, 98 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 2abbd3aeb4af..6f4052b98491 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -31,3 +31,7 @@ qcom-iris-objs +=3D iris_platform_gen1.o endif =20 obj-$(CONFIG_VIDEO_QCOM_IRIS) +=3D qcom-iris.o + +ifdef CONFIG_VIDEO_QCOM_IRIS +obj-y +=3D iris_vpu_bus.o +endif diff --git a/drivers/media/platform/qcom/iris/iris_vpu_bus.c b/drivers/medi= a/platform/qcom/iris/iris_vpu_bus.c new file mode 100644 index 000000000000..15ba4d9c563e --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_vpu_bus.c @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include +#include +#include + +static int iris_vpu_bus_dma_configure(struct device *dev) +{ + const u32 *iommu_fid =3D dev_get_drvdata(dev); + + return of_dma_configure_id(dev, dev->parent->of_node, true, iommu_fid); +} + +const struct bus_type iris_vpu_bus_type =3D { + .name =3D "iris-vpu-bus", + .dma_configure =3D iris_vpu_bus_dma_configure, +}; +EXPORT_SYMBOL_GPL(iris_vpu_bus_type); + +static void release_iris_vpu_bus_device(struct device *dev) +{ + kfree(dev); +} + +struct device *create_iris_vpu_bus_device(struct device *parent_device, co= nst char *name, + u64 dma_mask, const u32 *iommu_fid) +{ + struct device *dev; + int ret; + + dev =3D kzalloc_obj(*dev); + if (!dev) + return ERR_PTR(-ENOMEM); + + dev->release =3D release_iris_vpu_bus_device; + dev->bus =3D &iris_vpu_bus_type; + dev->parent =3D parent_device; + dev->coherent_dma_mask =3D dma_mask; + dev->dma_mask =3D &dev->coherent_dma_mask; + + dev_set_name(dev, "%s", name); + dev_set_drvdata(dev, (void *)iommu_fid); + + ret =3D device_register(dev); + if (ret) { + put_device(dev); + return ERR_PTR(ret); + } + + return dev; +} +EXPORT_SYMBOL_GPL(create_iris_vpu_bus_device); + +static int __init iris_vpu_bus_init(void) +{ + int ret; + + ret =3D bus_register(&iris_vpu_bus_type); + if (ret) { + pr_err("iris-vpu-bus registration failed: %d\n", ret); + return ret; + } + + return 0; +} +postcore_initcall(iris_vpu_bus_init); diff --git a/include/linux/iris_vpu_bus.h b/include/linux/iris_vpu_bus.h new file mode 100644 index 000000000000..750e878e489f --- /dev/null +++ b/include/linux/iris_vpu_bus.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#ifndef _LINUX_IRIS_VPU_BUS_H +#define _LINUX_IRIS_VPU_BUS_H + +#include + +#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS) +extern const struct bus_type iris_vpu_bus_type; + +struct device *create_iris_vpu_bus_device(struct device *parent_device, co= nst char *name, + u64 dma_mask, const u32 *iommu_fid); +#else +static inline struct device *create_iris_vpu_bus_device(struct device *par= ent_device, + const char *name, u64 dma_mask, + const u32 *iommu_fid) +{ + return NULL; +} +#endif + +#endif /* _LINUX_IRIS_VPU_BUS_H */ --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 A3F27332917 for ; Tue, 28 Apr 2026 03:56:27 +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=1777348588; cv=none; b=jb3nxYfxYKopy0UYqR8QxoMo/bFfFazOQxrQygk0frz7a7zzhLeUnlsg2qqhQLxznahBEQLtaSzbP3fjsbKiUm/TSqs+grWtxat1L7Pd7eoPywERcsuuz57wXrJAFZ6SzjvWGc4Z0GDKZTWAaLNaenHYo2P6bLqy9ZW6DG71PVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348588; c=relaxed/simple; bh=B3HL64Au0aEXfS2Kn2bLGfzZAIxzxv1nhUwhmU2OkmU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IGIxLZlATbu7n1HGVlDezfWoqkInhvaIxVbfLifNx2tOXLoqTPUKKhe+H/TVkqq2e4utUgPF9xkrcKzBgtLYIws0NTrZiJMKl3Qq++ac4T89NhX3H4IwXWoUUKenfI7yT3PUvdW4IGquJwAPK/iUQIUvxVk+AJ6BMRJI35zF99Y= 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=bfBqo+VN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=X8bmy1kd; 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="bfBqo+VN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="X8bmy1kd" 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 63S1B3AO3123484 for ; Tue, 28 Apr 2026 03:56:27 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= dRQKBOvpIQQtqM4o6WXiH6tq8ETJefi9sBfIx2EGNi4=; b=bfBqo+VN3FtzyMS8 CbXsV1xSN8HzlZLfin41kpB8HSiV6JXvskknW6u6+LOO0C8hqseecqQ7tFeVAp+K JL+K1rLKVVn13NfqAG9wc/wWb0HtL6kzxfIQX7+7g3fv3f3J/r7HAAGJoO9dZ3bH k1x23WyXop7exHkTgz6BNfe2Jz520uDvlS/Oeg5kxt7ImyzYbKs/zqXAM8gPgip8 G9AZ7tdGQMSloh2HJobcq5BLMZ1RiDeQawAdyY8fAu+9c35Y/1aRn1WGmjS61MBu dejT0rZtKDG/h+QfRsLe0KYip8EYn2KrO4CP3I1O+PYjhsA7sB5pg63NCoECM3x7 BGFmvw== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt5qgkmb8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:26 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-354c44bf176so12846460a91.0 for ; Mon, 27 Apr 2026 20:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348586; x=1777953386; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=dRQKBOvpIQQtqM4o6WXiH6tq8ETJefi9sBfIx2EGNi4=; b=X8bmy1kdDrj6Oi9wBjudkjV2Osc/Qvegkdd3K0dnjmncweAMOiitPiKLVC1d7sU05C 7WtMEZ8U572/Ce0rbLPZsRrpaS06ZY6NDT6OUDPjhtmS1heSQ1dFP/FYRW5fslr3u1gn o++2FrVoirwlZHaV63c4di41szjw3/JccT0jECo4GB7ddrClxe6GcnwDI9KuapSpqiEk xzqvxmaqVuDTn72GtDaEbTxEHV+uAwBcvIeidagnAN672Fy24V82ZVqA4dbYwenGu+oK FPWlV5Ey1+jm2ov7/9lxhkZjVU2dayQ1cJL2R3P/s8JZD01g5xE8mpABo2gfBWynXM5z 4Umg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348586; x=1777953386; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dRQKBOvpIQQtqM4o6WXiH6tq8ETJefi9sBfIx2EGNi4=; b=mSXLQoLYe1kUY4oYZhNoYj5VjvNpIjVCnqiCGDLhi1bbAklSDUYrE1gVbIbaq/PwVl YTXYV4VAv9mrb/WWsMJy7c1rbn5tllXbkm+IE0CQROgpvMYIW9FZIz/eIfRxyFT+CjJx MM1VTDXR2oCGeZeqZDA9GhzHk5oh0G90ZhdK7q4jiqIpvek2FvUZjNkLeRUPeDSjzxmn cGq072tUxKMv/RLK0U2ieQ+oj/1wRZfDyC6jj6WjKYYg1q+YAd41VoPMGn95nj8mimXh nuuPEiezvU062cducWEz55Om0p0PBQtEEv7VRpqlZjtBjsH7WPxXd/n5vY3xcmuF6+IH gN1A== X-Forwarded-Encrypted: i=1; AFNElJ/ab7GLucAsZ5qmWbPnj2r7PUXgtjcXazDOcH6mMwWNWPmElZGGaHgsZUTfDwoBeWIsiaTcP832QGcKzbE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1Gyem72XhQ4od24WvpUWjAj8+1i+LjspxQxtbA9dQrTj7trPj qmix+jeE+8szB0FmXWQQXFHFOiSyITr57F0MSKjRkSWUrQ4fZw9yQdcrFiXjaenE34DtbPiqJck NLSNCuhCCeA/Y0Snwwh47316nhpSRovzN0RcSFOTk1JXzCDC0/ThltHGnFozv2XKQ7AI= X-Gm-Gg: AeBDieuQSn0lhJJkriI8HsP2roVcjETYNhKEo4bXeazOVybkWCgEujngxmFuhEOagRq a785JlqgzqQONobDszy3F6pRXs8SUxbXi78+5psb0WpMe7V/lE2qN4+DA2H9azb765xjie/ZaGj Jj40/q362QEsHWr6MNBdhFJHsOIflJQR+KHtY6A0rVYN5TGG6v7g9ZRcXa1EJA4To7Z/b7e+ozW 1jolzUETpJCrL0Le+QF4HdkvWjFa9JEigJhLr4QgUc6gD3pLwktregFeLUo1DKc9ZafidD9Bb2w UiwrXOvBQkoc1ZISTdnqp2xTeVmVh+6hwLvWFSZ4ff7Q04Tt7sTittnsyBaf1oQfS5BH3xZGXc8 su1MZsYMYc1ReE51jk3StwAlysIfpHiA9HasvLE+Op5MNiXWoxR3N+FTXfY8QK24iAQ== X-Received: by 2002:a17:90b:380f:b0:35b:e51a:ec77 with SMTP id 98e67ed59e1d1-364920307f6mr1308433a91.16.1777348585858; Mon, 27 Apr 2026 20:56:25 -0700 (PDT) X-Received: by 2002:a17:90b:380f:b0:35b:e51a:ec77 with SMTP id 98e67ed59e1d1-364920307f6mr1308394a91.16.1777348585379; Mon, 27 Apr 2026 20:56:25 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:25 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:10 +0530 Subject: [PATCH v3 04/12] iommu: Add iris-vpu-bus to iommu_buses 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: <20260428-glymur-v3-4-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=1065; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=DydqIdia9cmT4zC+axscUwQlMujOYL3SDRWZ2LaadIU=; b=uv7UAzu7sAsuZDPmxAxOCzv9xYKtBDu7s/YBLJf5okHY+Wt6mzYtJY0/tliLYjMr090ZkEP4M nDwoGlXzeIwDq/ZRKXbzxUNySSWceRrt6Bw8UYVepbM2jUG97uOCMTh X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX4lWHq5/xardJ 1Gjcvjr3IzlHrsReOuegMb0Zp1oApJk+oNCN8x1xN3UqEDE20mAS5D/mr9CosO8nxgu2p0mNRYR pHINPgFYsDRaE5d5D22JLwRv4c9stWyHVhrnGfMFWHEMhz65LDlhLzA2gj4q55ED++AyTqgJTSz WP82hiYBVvzbtCJn4hXcTWE9RcFOB3M5blxAxzXpfQx8FVnXkFy0S0+1mbyVPF6s/R1V8khNB/K O/r8NOaqWmOShVdtMqkU5Y6u7M78PqfzqMmLK+1dbVCMcVQRHVz0Lf5U/UqD8sEvL8d1TGNCcME +AfoIDpZIHrv5DxwMiNCeZeEI5Fra7M88hUs1tDT2Rf7S/zNj+Ss3ITZLTkFohz7+bIZ0OX0//R JCSkNlLT+5PaznLA7aGq1JZ+zfMUQJul7g5BE/p3soW1ZBDvm+1Df/7/ZQIi2Cvs7yEvtQVR7pD iIR9pYtxkuRlhDbzVJw== X-Authority-Analysis: v=2.4 cv=V69NF+ni c=1 sm=1 tr=0 ts=69f02fea cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=HQKoClRO7b2jHrqM0cUA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-GUID: 9-PhJZHLRrObBzyNPryoLDp1BY1Gd4f2 X-Proofpoint-ORIG-GUID: 9-PhJZHLRrObBzyNPryoLDp1BY1Gd4f2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 spamscore=0 phishscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 From: Vikash Garodia Add iris-vpu-bus to iommu_buses[] to register the bus notifier callbacks for device add and removal events. This ensures that when a device is registered on iris-vpu-bus, the notifier triggers dma_configure(), which sets up the IOMMU context for that device. Signed-off-by: Vikash Garodia Signed-off-by: Vishnu Reddy --- drivers/iommu/iommu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 61c12ba78206..d8ed6ef70ecd 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -179,6 +180,9 @@ static const struct bus_type * const iommu_buses[] =3D { #ifdef CONFIG_CDX_BUS &cdx_bus_type, #endif +#if IS_ENABLED(CONFIG_VIDEO_QCOM_IRIS) + &iris_vpu_bus_type, +#endif }; =20 /* --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 D71DD33A702 for ; Tue, 28 Apr 2026 03:56:33 +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=1777348595; cv=none; b=ZAad+a6sOWVC4jc6I6JF/s+qjxCLJTEyNdTYcdfClAWIMQaXAeeBYITv/BfyGZHy5lppoV4BBKtDnqFQ71G/1l1NKaHJVGRhtquVeDVawFnNpRWfmw5pmWsmRcbldyCJwOdwR0O5EZlS/Ztf3Af4l+/Vt+tVEZZh1zajramL7s4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348595; c=relaxed/simple; bh=HB+2dN7dauUgdrMwzh7J5kQuRahuzqqEHBqE2I7xdDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lK+eCybeJBx5mboeLy5zf+aq5jfh7/uOGu9BLDRaAKpEh068k+Y0R6OCcbH1imo06US/b6i0AX3wMJ7P1bmOD+K0Db7jAS0+rNpoPTQceW37lQSstGu4uWYyeJ0IqNmCeaMxLP4QonUwj9ezZ+CVkLUWIJmYKufWxpwd6b5LonU= 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=Iz1in51z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iH0g1vC3; 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="Iz1in51z"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iH0g1vC3" 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 63RJXpHi2382817 for ; Tue, 28 Apr 2026 03:56:33 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= yWKLcs6KFXQAtV2FQyw0tlDf/NPaYSspKHLsi0vr58M=; b=Iz1in51zLm2pEO7J F3GoHTsi05CRzvHuzP7z1vlvbcyEav7K5qoMLAfZ2vcxiqq8kj5LDBkOt6lmoyIT y/pMCC+PoinA/UGZizCrVQLTGJ0a4zt+gaLU7smvukYPCBN4+lDTQ5FkRP4sFXZQ C/nnAwl56yw1u9H1ZhlGCQPBC8DTu4+gpNAJGeJcPhSjMCGTS2ncpb3El9wK8deZ 4eG3DmIBtq3RY49RndFd21xQA7cc901yu+a//+9h1V4Bw/M30htf5WQ8Qfu9Y+Bq fDNcOc2U7vrRrkB/5lpY1PzGoC7RdoiiJjoM1OUbrhSyca/Ky47GmrF5STk4GNaQ 16dOcA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt85xu48r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:33 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-35dacc40f92so10953292a91.2 for ; Mon, 27 Apr 2026 20:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348593; x=1777953393; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=yWKLcs6KFXQAtV2FQyw0tlDf/NPaYSspKHLsi0vr58M=; b=iH0g1vC3TtxA8dY9h0F4mtBEZBYzfuIOuHnM0wwmAFuKIW7b+nrxn91Y1HWKJZdzXh BZSVAuzXfP71PrqC4y6gxy7iNSijjqsX+857Li8VuoMfwn5fsA3jgsnndFXCBW1jIIae 7aUZzutuUzi4iUIrcW1HhCnLLtGV+kuXnkTa93JeHuP4K+9l0W5ZnuxaburRPMF4nrU1 tFjvp+466D+zjxz9pdAn5KnhC+YCdF1FOcsJh4DDVMikgNY4WDkx+o67HRGNlF+7R4Op 7nUyPqqjI/3a5eFsSBXdlq5C0zB3W5tXa6piCZrL8/JcIcsg8GF2ukIfH8a0lnfD6RKy NEcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348593; x=1777953393; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=yWKLcs6KFXQAtV2FQyw0tlDf/NPaYSspKHLsi0vr58M=; b=Nkz60Zi0ZyOr/qD5CUXwzp8HvyRyaexMm0vLH3fywEtfwqURTRXAbP1e+b0DbCzPlA HsMbuNvMx9BZieXVP7UreB+XAiIbWp8z8Rlg5n3ls3n+OVa7sKKz2FJ/HR6bWUvygoVn 84RWGglu9pIw8PDaN9IUtNJZbHmMeGGQUYB4BrXFAJwakd32SncPtt7vGS4811hBEJNe mQTEM8u7SwssVjr+16qKf8jir2G3hplDk/9ZPyVV0R9k+62cMHnkGIdN6bUMa6zvRPJE 8Y5gHVtrM590/mtppeJptUMgG1mMie/VPwYiluSeh7Kfnt970+2k64gIvavWVfXfMdBM buGg== X-Forwarded-Encrypted: i=1; AFNElJ9wagBWKxrjFvQv9AhQQdaAvB87QGS4B7Q+3k2uTvLQWMLueiSI7XLOIoHlpLt6Yrj/kzspJxFbvpvOIKM=@vger.kernel.org X-Gm-Message-State: AOJu0YzynD00GriIHgBZlSv8rDusbbyyQ90yuJURsRxBnLN50k2WI5ZJ l6fJxGY4aVccjwIkxu3NZvpye1eDZ5HQzdrq89OO7uqL8b0AOmekQjCKl4uGQBx1ZarVC+mf5OG x/Z1j9HM1/BxHY52cCFdMZ1YTHcFU+8aSd49KT96i94YfrzZBOm0OjVKqyxfByoMoNyo= X-Gm-Gg: AeBDiev0gz03TmFcMn/LDGqcYSSCl7JHO8byE8n0s8UAg6J14dixzHRLZWYBKUn2VzD UOjASuDNMoeTzhuKhTKi1da3EQR9/cvRJvyHXq8hXPEanwX2ssjjnix0pLj+44QOlB0SVDcR3s1 BDXJNeaE3ysheA605/oPxBfQ+8m9qIDP5pRqSzFV19+LMKt+YaJjMV7c+A2V2xPZJR45h5hOzVk iUAGyb2sF3tuOGvUoqMEIG7NW9ATk+9abDKB/wspOdx1OrE3lgx+eJWHDpGRj1XLvBLpTHkH/sX Wj02BH/AjUZY8tvEEYcC5swNEXySeQKzk7Iix/9WUY+J+/602Rc0O2y6dD6ScwR7FJEHG24vhk6 /W8MX0LQbqfnII1VYTtvsvXIMWx8GNyQB48v3cAJah4nJVqYheZVjZvccSHcg7eNxMA== X-Received: by 2002:a17:90b:3ec1:b0:35f:b69d:7292 with SMTP id 98e67ed59e1d1-3649202efc7mr1409561a91.15.1777348592559; Mon, 27 Apr 2026 20:56:32 -0700 (PDT) X-Received: by 2002:a17:90b:3ec1:b0:35f:b69d:7292 with SMTP id 98e67ed59e1d1-3649202efc7mr1409498a91.15.1777348592040; Mon, 27 Apr 2026 20:56:32 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:31 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:11 +0530 Subject: [PATCH v3 05/12] media: iris: Add context bank hooks for platform specific initialization 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: <20260428-glymur-v3-5-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=3016; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=HB+2dN7dauUgdrMwzh7J5kQuRahuzqqEHBqE2I7xdDA=; b=eH0/Yk+y/GIExJ5JU+BKGEQ7AroZObH05OnbDmYhj+LP/8r5nK4poXvcv8o1f0KNc56zIXkbl paiGTgO/pIfDUJMGeIuoxTseODSS+S8kcu2T3U63FwjjNLuGQ4Ug7I/ X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Zs3d7d7G c=1 sm=1 tr=0 ts=69f02ff1 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=hn6c7xJugPWrWid5T_cA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-ORIG-GUID: TVB6oU3r1emZVSaLCP1I4U4qDU7R7ZPn X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX+h9pVu5sAQPI teCuRa3BfsBHR3yg0+3rUduo/0eCexN/RE6VnIotd8M+lKOQjuQsIKnqYHGHF7U3L8wOD5M3HXY e1E1WTcT2WNGRUlWpFZPcTHhxyBDgxFsCMfjpyYCzjWQQ6EzK4VaSg6J89Bk1mSzBjhwVN210n9 y8KqfkpDQ6Rlj1g1zHD3yQ2fnwIIl5IfSRBIlhrFc73azs7LTq/EO9PZbW4m86aeq+E4RXXMR0h iatz9BV1KKDll7vTeNJp7iqhN+A451lcUSwcif5rKe9NsIb1k6jrzpNlYwjQH4CKyfTC7/Eae6I yPZMIYfkUvdmEVRXOyE3rmVikW90cSMtunbnK2e92SYruTZ+VFBAgdvQZhJMnOW/TLgBcsGYYKm dRgRNgVH3WmDSZM3qmRVVnbqw5QjNhxUm6iJtwVnfCVPIBh4N2w2TAD89JihTdUBAjWwgZD1BbC Ji6R8F4qqA1KR2L9l4A== X-Proofpoint-GUID: TVB6oU3r1emZVSaLCP1I4U4qDU7R7ZPn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 The Glymur platform requires a dedicated firmware context bank device which is mapped to the firmware stream ID to load the firmware. Add init and deinit hooks in the platform data for context bank setup. These hooks allow platform specific code to initialize and tear down context banks. Signed-off-by: Vishnu Reddy --- .../platform/qcom/iris/iris_platform_common.h | 2 ++ drivers/media/platform/qcom/iris/iris_probe.c | 23 ++++++++++++++++++= +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 5a489917580e..55ff6137d9a9 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -219,6 +219,8 @@ struct iris_platform_data { u32 (*get_vpu_buffer_size)(struct iris_inst *inst, enum iris_buffer_type = buffer_type); const struct vpu_ops *vpu_ops; void (*set_preset_registers)(struct iris_core *core); + int (*init_cb_devs)(struct iris_core *core); + void (*deinit_cb_devs)(struct iris_core *core); const struct icc_info *icc_tbl; unsigned int icc_tbl_size; const struct bw_info *bw_tbl_dec; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index ddaacda523ec..34751912f871 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -142,6 +142,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->init_cb_devs) + return core->iris_platform_data->init_cb_devs(core); + + return 0; +} + +static void iris_deinit_cb_devs(struct iris_core *core) +{ + if (core->iris_platform_data->deinit_cb_devs) + core->iris_platform_data->deinit_cb_devs(core); +} + static int iris_register_video_device(struct iris_core *core, enum domain_= type type) { struct video_device *vdev; @@ -193,6 +207,7 @@ static void iris_remove(struct platform_device *pdev) return; =20 iris_core_deinit(core); + iris_deinit_cb_devs(core); =20 video_unregister_device(core->vdev_dec); video_unregister_device(core->vdev_enc); @@ -259,11 +274,15 @@ static int iris_probe(struct platform_device *pdev) if (ret) return ret; =20 + ret =3D iris_init_cb_devs(core); + if (ret) + return ret; + iris_session_init_caps(core); =20 ret =3D v4l2_device_register(dev, &core->v4l2_dev); if (ret) - return ret; + goto err_deinit_cb; =20 ret =3D iris_register_video_device(core, DECODER); if (ret) @@ -298,6 +317,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_deinit_cb: + iris_deinit_cb_devs(core); =20 return ret; } --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 314FB33BBD0 for ; Tue, 28 Apr 2026 03:56:41 +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=1777348602; cv=none; b=hhnxwlRFXrdf+xGJDMOEuMV3sIlILKrPTaAMkuzHdt+Em/4klzVrztQosICh6MCzAbqwSQtR228Z/kWKdRn+e3DqfByLq+DSNdtVYOz2lqtrlhEeneo0+Gbs8jkfAKR1uo7k/v1dHxa6tQxC/1e0vstSDuAivRzvD8EFiFupkJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348602; c=relaxed/simple; bh=5XMD1PTwD/LTxgA60yhE1YYtYnYGkszZwhjmWff2fnQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lA1/WZ3fuNzRTJJtspW1RrcO1lTcs8rZm/NfBfQHC+BVryomWS8MHoRssJCC2O2CYe1au6ezGnd0fFlu0FyTzE/IuAhYTU8g+ei68U1lgW4QR7mj8n3dAv9/G8WikSj0QkXta9V0fIzNeXotAsom0KLHqdL0D5pnq2ch4MoUyrU= 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=jt5EHOjO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PeI1P2Fe; 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="jt5EHOjO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PeI1P2Fe" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63S0Ei3k441000 for ; Tue, 28 Apr 2026 03:56:40 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= bTy4Bkwh+gr6ISqDQC1YSZGoQJgQwg2cLAvk32oAfkI=; b=jt5EHOjOmtMzLjTi hvVfhUtmN6v6g7AKAcwYnAfzpHNlpdmIYXmo6uP0LNMEc/+m/nAvHn61k1InATl7 7JKJ/nwW2Qt4Uq4bMY2uYaulZhAuEQb25dnKcCHgB2oRVXNRZQg6jZDCkEIHZMTd lPOdslwn/fFjGgv010aAbKN70AxOnjNJtMzsul6BFSHSx7h2gc5VPAxMf/QrlU2L +QS+zZ2dDxKUKb5QtmQxToTb8cpz5klIRGAKgBDtPJioWOY308NxhNRNCv32uS3t hPrrhqr6Q72gUlhBLqoFhk+jnEFbcjR6IvV1IBj5/icLkJ02Vb034bUO+HHXyQ6K RJIiPQ== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dtac42g80-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:40 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35fbaada2f3so20142790a91.0 for ; Mon, 27 Apr 2026 20:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348600; x=1777953400; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bTy4Bkwh+gr6ISqDQC1YSZGoQJgQwg2cLAvk32oAfkI=; b=PeI1P2FeqWcjvgtie7Eg1oDDIXMAHo04WYxqEXa2hUzuF3g3m59VmF1pOjtfOJVIq2 oS1SJv3AZK+NjLsJZL0Ceoc4DCx7SVvtV2zL83TriBCow/VVktLhPUGk2B4nHS/usAI8 bsCOlbyI53gV5Fnyr1TcFxo0dGQf8g4wlsw7TH+vqENwNR7bTr2KYURHJfYMap93zWws 3hu3NrbLDH7JTj/TklH7+19V/lSbdZx0+AuuussZn+Dtz2YLr1g1vptW2VgSU9lwpHV+ 5o18tLhfFXKNLoeyNAB98XcRoHY95cOxwfckjY+gZ+PYVdsUf2WmIDZcYUQuRLufpOrm 8CzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348600; x=1777953400; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=bTy4Bkwh+gr6ISqDQC1YSZGoQJgQwg2cLAvk32oAfkI=; b=JXrvF9PYqWFpOB7gGgmznv3IHoKCjX3j1L8lx/vVEnkYZFqK4CRgZzrvvH5Cm8fUVo DDAdy7ffLnrudT27FKn1yIFJCX9tQNwz2mWWSW2Di/hKGzR3S5TtW6Oy7EvTIQB8oE++ jUPj0sKsU7tYfki5hFpnTnF3amgOkMulQtP+r2thwuQujtDdFv91ezlCYHyl4VlvnOeB /KrQLLOG9kmhpddRaNLoxk2vg2nsaiwKYK/ZItm1Ef31v/vSNn3JqT7KSpihRm8TLpzp SETl/UrcsVuPkvUTBE36m9vWgjFd5Aggsl1UK2LuxU9hZvq3B6LvDEFFSQl+eLJJ+8Dz rBFg== X-Forwarded-Encrypted: i=1; AFNElJ8EmaypHLKiQgaRbR1VKWk67Igntwl+DkZ7pngJoUq8Nqs9KToBPBk0uEadAc6G+ojmpcy6XF/+iih2DIM=@vger.kernel.org X-Gm-Message-State: AOJu0YyryWYkLdlm/QI4xE9QrfKZJad+jHJ1Yp6flXRAzoJcBf4PT709 uy+abT3NSiXMP5O8lwaVUgOxQd9o+QRVnxp0700H1JmEyHwdC1qNxuWWJktKEXOE2Wz3juK1WGh lBuC99HTYVqTjI1M8NY5SYCu6ahFZoSDIPos3G/Db0ODirqD63BMha+lF4tyjwxUTCDM= X-Gm-Gg: AeBDieuaJGgDSb2y8C8I654QfskO+Kd+tLj0rxITGTSpBbiKBp5nH72N5XhzvptebnN LbsMcUfF36JaRYDB6hs9vKVqmnv+O3xshKCD8ZpWXufyHrk7ZZRRmevTygCFK87A52ZNcw4YdgV +4EVXvgkWw9s3oQP16rEq4WDvomVR6AZqrUR5Wb9KHqhG57eChEqCwRGpTG0PRMMD2oAxY2nkZR AZbi53oNH5Cmy3FGAz0ryFEGWykc1/AstHlO7xin7WbyEqher0Fx3X1jYYUHx/vOOVVSwbwFgH+ Y3wSzl3YQG4hs8j4IUtlGbU1X/0bvDs76IZIAiHoVZmFXGNau6z7zSHnEWhdzeq5cF8WCtoEJFu Ao+fWRgkF9p88r6cRpLvOICL/dA4VbsqupcEYsvY34vrbH+FaGxyaK7rwZANCRoVQiQ== X-Received: by 2002:a17:90a:fc4d:b0:35e:57cf:c0a3 with SMTP id 98e67ed59e1d1-36492077fe8mr1448147a91.26.1777348599681; Mon, 27 Apr 2026 20:56:39 -0700 (PDT) X-Received: by 2002:a17:90a:fc4d:b0:35e:57cf:c0a3 with SMTP id 98e67ed59e1d1-36492077fe8mr1448108a91.26.1777348599180; Mon, 27 Apr 2026 20:56:39 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:38 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:12 +0530 Subject: [PATCH v3 06/12] 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: <20260428-glymur-v3-6-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy , Mukesh Ojha X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=6587; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=+wQbHvxygQq1aTrGxrx3UsURZ3ABehuwxnmcohM5NBw=; b=Le+OHX1qkXM83hmvcoX3+cLYts84Kbt1q+4H7HJtz4T4o/TbiOL1LnwC6P7Aqgq/8ltSpl1oQ jpGgQr298FACq+WA40ceRRYgexnnkDm7KZ7FLcGy49M87sLu0tAacar X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: R1Z-8Vri8K_GGH3wv1RtBFDxIdya3qUX X-Authority-Analysis: v=2.4 cv=D7J37PRj c=1 sm=1 tr=0 ts=69f02ff8 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=gbwaY6mYjfx-u0ET_fsA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-ORIG-GUID: R1Z-8Vri8K_GGH3wv1RtBFDxIdya3qUX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX238MD8e9RfSF +6l2lFwQYMG17mfA/dPuPNE8BbSx23wG9mn20TxpFumLsZDiPaSWMGVmcu6YQrz0KZQMbG16PCF UY+NLBGHbokSvU2Gnin3g6FSRa7Yqcq7o+IuiGwnUegVZjUYsvdFrSsXNDo8akjlPmKW0gpomHE 4CeNO4vnAisfxVh5DZMKLcJQ62g+vqXf8sWmR3cq3m3zPvgUWBusfHmwM/Hh8dyHqIA7wNakrOu zmx/PNK9i06He6eipmw+HvI4fuAuBI3Nilmtp75ZoqLyJT+MUvthvbsQgOSA0AAOOkzxbaYI0Rk EgbCQDy2K6IyK12YEbrbxz7/hlMSQ6ixc87T1t4b0M25+yFJQRyuQEl5bmc4lC10W3gY4ZeeRwr EgvQ1Ovl2fz3iVB1atMyCrvHwooQWLvFJAzstiY7ToNCFXM46C3l1Mh0crVIjvdRn+Jo4VO9CX3 HIzuTa41PTHSR1b8x7w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 From: Mukesh Ojha Most Qualcomm platforms feature a proprietary hypervisor (such as Gunyah or QHEE), which typically handles IOMMU configuration. This includes mapping memory regions and device memory resources for remote processors by intercepting qcom_scm_pas_auth_and_reset() calls. These mappings are later removed during teardown. Additionally, SHM bridge setup is required to enable memory protection for both remoteproc metadata and its memory regions. When the hypervisor is absent, the operating system must perform these configurations instead. Support for handling IOMMU and SHM setup in the absence of a hypervisor is now in place. Extend the Iris driver to enable this functionality on platforms where IOMMU is managed by Linux (i.e., non-Gunyah, non-QHEE). Additionally, the Iris driver must map the firmware and its required resources to the firmware SID, which is now specified via iommu-map in the device tree. Co-developed-by: Vikash Garodia Signed-off-by: Vikash Garodia Signed-off-by: Mukesh Ojha Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/iris_core.h | 4 ++ drivers/media/platform/qcom/iris/iris_firmware.c | 72 ++++++++++++++++++++= ---- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index fb194c967ad4..b396c8cf595e 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -34,6 +34,8 @@ enum domain_type { * struct iris_core - holds core parameters valid for all instances * * @dev: reference to device structure + * @fw_dev: reference to the context bank device used for firmware load + * @pas_ctx: SCM 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 @@ -77,6 +79,8 @@ enum domain_type { =20 struct iris_core { struct device *dev; + struct device *fw_dev; + struct qcom_scm_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 5f408024e967..0085dd7ec052 100644 --- a/drivers/media/platform/qcom/iris/iris_firmware.c +++ b/drivers/media/platform/qcom/iris/iris_firmware.c @@ -5,6 +5,7 @@ =20 #include #include +#include #include #include #include @@ -13,12 +14,15 @@ #include "iris_firmware.h" =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; u32 pas_id =3D core->iris_platform_data->pas_id; const struct firmware *firmware =3D NULL; - struct device *dev =3D core->dev; + struct qcom_scm_pas_context *pas_ctx; + struct iommu_domain *domain; struct resource res; phys_addr_t mem_phys; size_t res_size; @@ -29,14 +33,18 @@ 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); + pas_ctx =3D devm_qcom_scm_pas_context_alloc(fw_dev, pas_id, mem_phys, res= _size); + if (IS_ERR(pas_ctx)) + return PTR_ERR(pas_ctx); + + ret =3D request_firmware(&firmware, fw_name, fw_dev); if (ret) return ret; =20 @@ -52,9 +60,27 @@ 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, - pas_id, mem_virt, mem_phys, res_size, NULL); + pas_ctx->use_tzmem =3D !!core->fw_dev; + ret =3D qcom_mdt_pas_load(pas_ctx, firmware, fw_name, mem_virt, NULL); + if (ret) + goto err_mem_unmap; + + if (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); + if (ret) + goto err_mem_unmap; + } =20 + core->pas_ctx =3D pas_ctx; + +err_mem_unmap: memunmap(mem_virt); err_release_fw: release_firmware(firmware); @@ -62,6 +88,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->pas_ctx->use_tzmem) + 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; @@ -79,10 +117,10 @@ int iris_fw_load(struct iris_core *core) return -ENOMEM; } =20 - ret =3D qcom_scm_pas_auth_and_reset(core->iris_platform_data->pas_id); + ret =3D qcom_scm_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++) { @@ -93,17 +131,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(core->iris_platform_data->pas_id); - return ret; + goto err_pas_shutdown; } } =20 + return 0; + +err_pas_shutdown: + qcom_scm_pas_shutdown(core->pas_ctx->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(core->iris_platform_data->pas_id); + int ret; + + ret =3D qcom_scm_pas_shutdown(core->pas_ctx->pas_id); + if (ret) + return ret; + + iris_fw_iommu_unmap(core); + + return ret; } =20 int iris_set_hw_state(struct iris_core *core, bool resume) --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 05AB433BBC6 for ; Tue, 28 Apr 2026 03:56:47 +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=1777348610; cv=none; b=CGvfqL/AedlJ6/aratAUxueVjQ7wfVUVfD0aN/s3lDWTvwAxCp/I913vhE0kgJWKvAuLGuZtSGrxl9/i76KncG/ZE74HpUzFunIyS9cDwHH3yEInXznU/jQuFVX0yidi6VOm8Ee0evZJiU3uw/l20RgWpToTuuqziSTrzYqDb0c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348610; c=relaxed/simple; bh=m5k//9k2AZqLBLTijFuX7klJ8v4jofc5QHXrTy9WJIk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KAEk1lTu4ZiZ22ihqusLvdDRq5j2Uzan7pG+oUX9RWbT6LNxKCmr+clyH/gUFzjwLBoI83zgLUu6dj9aWcsHliGuQ6T4Fjd5l2RfUusIqbdEVu04JEMQEfumj31J2G6B89dv6CbOfudwsYL4gMLMbsL7QmzxViqmGT74rauKOMY= 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=A5WDb1dq; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iDLLUQ/q; 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="A5WDb1dq"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iDLLUQ/q" 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 63RMTN0T1625526 for ; Tue, 28 Apr 2026 03:56:47 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= 4BuwJDFwl9orRME+wdYyrWEnQLmpCChqNE71P1LyFhI=; b=A5WDb1dqjfbs3wfI 565W9wfNOaPZ0QtU1PfO2BJmEmGTYfNKkZRGRfxsYWChlWjdszhaxkDdH5bOQi74 tNwcvkOFyGgfCp6gaevPvsGEo26ND8sivl5IizQpXcYryLbGY9Np9ayILWc/06a/ /3ID2ntGi831ON+a8fzTKtptywIYQwfqSu2GExVLd8fogldZezgrZFdJ3BNexNQ+ 6VCp+6H6XmbJwHwySmYHvE0/c/8kUDEtNgldae2DDQnrYTdDgBrSNfBI0mwe4Wlt 9g6XWOEzU+MBKZoCxUJ/oU5gtGazlv2S1MQrWyVEnyP/sQ/OhIXGbCIxx2ULmGLi VzxcWA== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dtgms91kf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:47 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-358e95e81aeso15257827a91.0 for ; Mon, 27 Apr 2026 20:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348607; x=1777953407; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4BuwJDFwl9orRME+wdYyrWEnQLmpCChqNE71P1LyFhI=; b=iDLLUQ/qy4tHogO/c5BCCcPBY06+X2Oq1TMtaumZCfO3p5ywtb7hrVahdKB+hb0Z9P gx2Vu1NOg/N5ewd9KUt0aEV/oKR/pFL5We0maLkNt+D1hAs1i6CJo3VE9cWBXFpp1Un7 5dd831M7hXp7/Nn23wjG0oTjuwYAcJhOgRZMgIz/XpOKs1ffmV7OBxF0kRmrM6nNicyv d3nKIIW0vR91B3Dp7TXlUj6AyqDwihRv/UUF5P4MgIp3UDa3oLCPaUoNwNd4AH2wwNfl fo/SqlbUy4PxahaVGU0jr70S7PaOhc0/lwFlfSyK4chn25uYq5EOyI+NCk7SvjvzBVvW f69w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348607; x=1777953407; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4BuwJDFwl9orRME+wdYyrWEnQLmpCChqNE71P1LyFhI=; b=kFqBi8vStr0yskMo2iRYQ7RZD6+M9G4uOMCQ9rqc1TUN8iwF+yDZYZ0A2g1WxEzCC7 nHWijedVHoQEewdJJ5rjeAoHWIVilrVP4ecCcZY8onKjsHdAmvDffBMjKJWFxvjQ8Qu9 bfeopOslHrCaBy/qzAxQQYll8BNu3JMRS+AbjQYMxdrHHbSo3ZKizXL2Ex4ai5QjXTVJ F5PrMvfIhMNCh2h6yiKgHwXVmmosKb0Il4ujCxXVkdaDLqUQRWh+A3p14DREmEfODqJV +tyHGk0n+JujP/GbJa4ewhWQsxzIbMxPZvdurfHPWPVGhsNzUxkmK+gpBjLzT/DW51Ci DaEg== X-Forwarded-Encrypted: i=1; AFNElJ/KusIXA5O3sBZGAKf8CXgqMOE839qF5oUaAALByBPTMsb3zguN6UZMQhGb373OryK6EtV+67aM5M2il9I=@vger.kernel.org X-Gm-Message-State: AOJu0Yyz5ZpxttkRIeBG6c/7fZFEDWzctIAC9T/7TRBjWZmahxIiBgJS K+28Zp1aVHMgfBFfWjXp0O+SpJC9QHxusaahrcW895EHKCJ8Hlo2Pz7sIS7AliGitGUf2z5ranD z4k4iUKPLESGmiXjmeWjTZs3zQRbq5vFLiaO3ElKsAz+5ZE0Xgkh0L97mICzLWgiAwG8= X-Gm-Gg: AeBDievXoF+ijU2zWY/pXWkDGyxS0WVOH098iPsyT6fhWFdiuzgfN8NTJteN/63WUtr x30hKJVBkVE+Hi/vOryCCXK8KqPF9UpXROUwiqLm5PenCKxWxiZNnMB+8c+BetMdTtfxT4ErGtO VnrFM6+8RwOtyFYpf+E2IO5++vf5fuWn+FrLJd2lKk8W2WTtD8UkvuLYLm4cVL7HodfvVGeuAps a5KkGiMkTq0aUnKBovT8If4nd8wKyXHae5q5yONxy/e+Z9bbB607gMun/whYkWfOjrBTo+DWZ39 GCNeKCVIc2nsvNvOmVMPbTn9+lWLxz0LV6PYDh7cnvotrQJyqElHwGRbqs9+iTfIIPJqnilz6x5 XJkJADrTlE/N8a/JNuI1v6+idn0+mlG8B5aWJ+YFdoVIFZSSOf7MUFsqOVElNZaiQ7w== X-Received: by 2002:a17:90b:3909:b0:35b:9b77:d7c with SMTP id 98e67ed59e1d1-36492000bb8mr1425075a91.14.1777348606577; Mon, 27 Apr 2026 20:56:46 -0700 (PDT) X-Received: by 2002:a17:90b:3909:b0:35b:9b77:d7c with SMTP id 98e67ed59e1d1-36492000bb8mr1425043a91.14.1777348606032; Mon, 27 Apr 2026 20:56:46 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:45 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:13 +0530 Subject: [PATCH v3 07/12] media: iris: Rename clock and power domain macros to use vcodec prefix 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: <20260428-glymur-v3-7-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=17094; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=m5k//9k2AZqLBLTijFuX7klJ8v4jofc5QHXrTy9WJIk=; b=biwex0pG6ufpJ3jk0X3dyk6uaSR20CtjD04wy8MM9fZ1FKaeNUCGJz1a5jJezWvt0iOGj6z7+ Fo9n0+d0SUVCS0h9bWpP2YuXCDa+AR+uBZXeaX+Jesz8xnKuadKIjAb X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: V7cBCcs20quEsa4zFRKUwVtGawqWbXcg X-Authority-Analysis: v=2.4 cv=R4gz39RX c=1 sm=1 tr=0 ts=69f02fff cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=kpNcZxiqwdVgWfiEekEA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfXx7s/mNIgAmUc ClGdDgro3fEIrBmiltdqABIUJY55Zo3tFF6Fe7tJ8PELHkqfjJlIR/jdaZ7EVBy5RPLXFs76JfH c0blxWLoCmFUXPV6cB050PEK1nylHvMO1X38ZqYYjpTbgZWP4G+fn0urdLyJed6+NlEQDmTkFnC CW7sSnemc86poSy8BNhHS8QGWCzQcMrArfhGGsAuyecmJvR+6ij4e/slA+Ibixqv4nYGSAXTyJc KMZidycHx9myX2jIZGMl9G/wYSebKGOCpHsz2en5qV+OJTO8BW/m4H1N96xLgzpwFdUaK1wTUoZ lYOA+WleuBuY22ta08R54aFscjgeqaKHhPBR7nU07gN+1oTSPfOTyl4mvUIgW7fPWQofOTRsfxU nK88kA2KXil3z8VotrFfAuPGPUJT/+ZbczKvEX0oaTul36LE+P7e26n7p5//4cOMAFkz5I9Krl4 D1L9/1V+fJvsubfgO+Q== X-Proofpoint-ORIG-GUID: V7cBCcs20quEsa4zFRKUwVtGawqWbXcg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 The current clock and power domain enum names are too generic. Rename them with a vcodec prefix to make the names more meaningful and to easily accommodate vcodec1 enums for the secondary core for glymur platform. No functional changes intended. Signed-off-by: Vishnu Reddy --- .../platform/qcom/iris/iris_platform_common.h | 12 ++++---- .../media/platform/qcom/iris/iris_platform_gen1.c | 6 ++-- .../media/platform/qcom/iris/iris_platform_gen2.c | 6 ++-- .../platform/qcom/iris/iris_platform_sc7280.h | 10 +++---- .../platform/qcom/iris/iris_platform_sm8750.h | 12 ++++---- drivers/media/platform/qcom/iris/iris_vpu3x.c | 25 ++++++++-------- drivers/media/platform/qcom/iris/iris_vpu4x.c | 30 ++++++++++--------- drivers/media/platform/qcom/iris/iris_vpu_common.c | 35 +++++++++++-------= ---- 8 files changed, 70 insertions(+), 66 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 55ff6137d9a9..30e9d4d288c6 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -49,14 +49,14 @@ extern const struct iris_platform_data sm8650_data; extern const struct iris_platform_data sm8750_data; =20 enum platform_clk_type { - IRIS_AXI_CLK, /* AXI0 in case of platforms with multiple AXI clocks */ + IRIS_AXI_VCODEC_CLK, IRIS_CTRL_CLK, IRIS_AHB_CLK, - IRIS_HW_CLK, - IRIS_HW_AHB_CLK, - IRIS_AXI1_CLK, + IRIS_VCODEC_CLK, + IRIS_VCODEC_AHB_CLK, + IRIS_AXI_CTRL_CLK, IRIS_CTRL_FREERUN_CLK, - IRIS_HW_FREERUN_CLK, + IRIS_VCODEC_FREERUN_CLK, IRIS_BSE_HW_CLK, IRIS_VPP0_HW_CLK, IRIS_VPP1_HW_CLK, @@ -206,7 +206,7 @@ struct icc_vote_data { =20 enum platform_pm_domain_type { IRIS_CTRL_POWER_DOMAIN, - IRIS_HW_POWER_DOMAIN, + IRIS_VCODEC_POWER_DOMAIN, IRIS_VPP0_HW_POWER_DOMAIN, IRIS_VPP1_HW_POWER_DOMAIN, IRIS_APV_HW_POWER_DOMAIN, diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/driver= s/media/platform/qcom/iris/iris_platform_gen1.c index df8e6bf9430e..be6a631f8ede 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c @@ -284,9 +284,9 @@ static const char * const sm8250_pmdomain_table[] =3D {= "venus", "vcodec0" }; static const char * const sm8250_opp_pd_table[] =3D { "mx" }; =20 static const struct platform_clk_data sm8250_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, + {IRIS_AXI_VCODEC_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_VCODEC_CLK, "vcodec0_core" }, }; =20 static const char * const sm8250_opp_clk_table[] =3D { diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 5da90d47f9c6..47c6b650f0b4 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -780,9 +780,9 @@ static const char * const sm8550_pmdomain_table[] =3D {= "venus", "vcodec0" }; static const char * const sm8550_opp_pd_table[] =3D { "mxc", "mmcx" }; =20 static const struct platform_clk_data sm8550_clk_table[] =3D { - {IRIS_AXI_CLK, "iface" }, - {IRIS_CTRL_CLK, "core" }, - {IRIS_HW_CLK, "vcodec0_core" }, + {IRIS_AXI_VCODEC_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_VCODEC_CLK, "vcodec0_core" }, }; =20 static const char * const sm8550_opp_clk_table[] =3D { 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..6b783e524b81 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sc7280.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sc7280.h @@ -16,11 +16,11 @@ static const struct bw_info sc7280_bw_table_dec[] =3D { 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" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_AXI_VCODEC_CLK, "iface" }, + {IRIS_AHB_CLK, "bus" }, + {IRIS_VCODEC_CLK, "vcodec_core" }, + {IRIS_VCODEC_AHB_CLK, "vcodec_bus" }, }; =20 static const char * const sc7280_opp_clk_table[] =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..f843f13251c5 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_sm8750.h +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8750.h @@ -11,12 +11,12 @@ static const char * const sm8750_clk_reset_table[] =3D { }; =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" }, + {IRIS_AXI_VCODEC_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_VCODEC_CLK, "vcodec0_core" }, + {IRIS_AXI_CTRL_CLK, "iface1" }, + {IRIS_CTRL_FREERUN_CLK, "core_freerun" }, + {IRIS_VCODEC_FREERUN_CLK, "vcodec0_core_freerun" }, }; =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index fe4423b951b1..1f0a3a47d87f 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -209,7 +209,7 @@ static int iris_vpu33_power_off_controller(struct iris_= core *core) =20 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_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); =20 return 0; } @@ -218,36 +218,37 @@ static int iris_vpu35_power_on_hw(struct iris_core *c= ore) { int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, + core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]); if (ret) return ret; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_AXI_VCODEC_CLK); if (ret) goto err_disable_power; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_FREERUN_CLK); if (ret) goto err_disable_axi_clk; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_CLK); if (ret) goto err_disable_hw_free_clk; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], true); + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_P= OWER_DOMAIN], true); if (ret) goto err_disable_hw_clk; =20 return 0; =20 err_disable_hw_clk: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); err_disable_hw_free_clk: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_FREERUN_CLK); err_disable_axi_clk: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); =20 return ret; } @@ -256,8 +257,8 @@ static void iris_vpu35_power_off_hw(struct iris_core *c= ore) { iris_vpu33_power_off_hardware(core); =20 - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_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 a8db02ce5c5e..4082d331d2f3 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -27,7 +27,8 @@ 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 dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_P= OWER_DOMAIN], + hw_mode); if (ret) return ret; =20 @@ -63,7 +64,7 @@ static int iris_vpu4x_genpd_set_hwmode(struct iris_core *= core, bool hw_mode, u32 dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VPP0_HW_POWER_D= OMAIN], !hw_mode); restore_hw_domain_mode: - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]= , !hw_mode); + dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOM= AIN], !hw_mode); =20 return ret; } @@ -162,15 +163,15 @@ static int iris_vpu4x_enable_hardware_clocks(struct i= ris_core *core, u32 efuse_v { int ret; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_AXI_VCODEC_CLK); if (ret) return ret; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_FREERUN_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_FREERUN_CLK); if (ret) goto disable_axi_clock; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_CLK); if (ret) goto disable_hw_free_run_clock; =20 @@ -198,11 +199,11 @@ static int iris_vpu4x_enable_hardware_clocks(struct i= ris_core *core, u32 efuse_v disable_bse_hw_clock: iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK); disable_hw_clock: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); disable_hw_free_run_clock: - iris_disable_unprepare_clock(core, IRIS_HW_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_FREERUN_CLK); disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); =20 return ret; } @@ -216,9 +217,9 @@ static void iris_vpu4x_disable_hardware_clocks(struct i= ris_core *core, u32 efuse iris_disable_unprepare_clock(core, IRIS_VPP0_HW_CLK); =20 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); + iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); } =20 static int iris_vpu4x_power_on_hardware(struct iris_core *core) @@ -226,7 +227,8 @@ static int iris_vpu4x_power_on_hardware(struct iris_cor= e *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_domains(core, + core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]); if (ret) return ret; =20 @@ -278,7 +280,7 @@ static int iris_vpu4x_power_on_hardware(struct iris_cor= e *core) iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs [IRIS_VPP0_HW_POWER_DOMAIN]); disable_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); =20 return ret; } @@ -356,7 +358,7 @@ static void iris_vpu4x_power_off_hardware(struct iris_c= ore *core) iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs [IRIS_VPP0_HW_POWER_DOMAIN]); =20 - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); } =20 const struct vpu_ops iris_vpu4x_ops =3D { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index bfd1e762c38e..006fd3ffc752 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -213,7 +213,7 @@ int iris_vpu_power_off_controller(struct iris_core *cor= e) 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_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); =20 return 0; @@ -221,10 +221,10 @@ int iris_vpu_power_off_controller(struct iris_core *c= ore) =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_HW_AHB_CLK); - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOM= AIN], false); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_disable_unprepare_clock(core, IRIS_VCODEC_AHB_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); } =20 void iris_vpu_power_off(struct iris_core *core) @@ -251,7 +251,7 @@ int iris_vpu_power_on_controller(struct iris_core *core) if (ret) goto err_disable_power; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_AXI_VCODEC_CLK); if (ret) goto err_disable_power; =20 @@ -268,7 +268,7 @@ int iris_vpu_power_on_controller(struct iris_core *core) err_disable_ctrl_clock: iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); err_disable_axi_clock: - iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); err_disable_power: iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); =20 @@ -279,30 +279,31 @@ int iris_vpu_power_on_hw(struct iris_core *core) { int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, + core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]); if (ret) return ret; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_CLK); if (ret) goto err_disable_power; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_HW_AHB_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC_AHB_CLK); if (ret && ret !=3D -ENOENT) goto err_disable_hw_clock; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER= _DOMAIN], true); + ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_P= OWER_DOMAIN], true); if (ret) goto err_disable_hw_ahb_clock; =20 return 0; =20 err_disable_hw_ahb_clock: - iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_AHB_CLK); err_disable_hw_clock: - iris_disable_unprepare_clock(core, IRIS_HW_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWE= R_DOMAIN]); + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); =20 return ret; } @@ -362,7 +363,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_c= ore *core) 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_unprepare_clock(core, IRIS_AXI_CTRL_CLK); =20 iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); =20 @@ -379,7 +380,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_co= re *core) if (ret) return ret; =20 - ret =3D iris_prepare_enable_clock(core, IRIS_AXI1_CLK); + ret =3D iris_prepare_enable_clock(core, IRIS_AXI_CTRL_CLK); if (ret) goto err_disable_power; =20 @@ -396,7 +397,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_co= re *core) 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); + iris_disable_unprepare_clock(core, IRIS_AXI_CTRL_CLK); err_disable_power: iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); =20 --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 CD559337B81 for ; Tue, 28 Apr 2026 03:56:54 +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=1777348616; cv=none; b=Q+V+8C3Sfz7jD7WARjdp7pSmh1OyTRluJRvqYtzrl9GB+LWn0tFXm6abPPcyiqZZltr5pTO9oTCxlm4nmDegy0TyuA/Y+ul80AvzlLZ1nLtAKZdZvO1uvd1l1Zbx/b/iVTvJJIbGZ9bphYWawM7s05E8oHR5s9cKoN5Le5UIduo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348616; c=relaxed/simple; bh=snCiGYnE5lR7k11Sd8HZYZBUpIgzZpSwTWZQd9WBf78=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SrF7aZQ+kj8brMzsSoNkytgNpF7Bt2iodXKPOd3xTRv5E8sRSnp6r89mQ8XYkpIN+D1otEvlrAhkrLaFjGnbp48HJaBlbaVJuC1UibO4pe3BmLelQpDfZacAzaz9rOlCsOio4y56EVXYQpO8NTOkjoFLpTOTu+TDuJiZu1NXz5Y= 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=ALUARuu9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VkPuhpMM; 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="ALUARuu9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VkPuhpMM" 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 63RMTN0V1625526 for ; Tue, 28 Apr 2026 03:56:54 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= B78CjQBbuZjRK4uBze+IvM6DTXnaPD6tJ8oMVVcOAus=; b=ALUARuu9jztmqYeA QHQtFcmliuVREQU+RpnhyNfq5CbiKsszAaJ9Z40RKSErktNDffrLgmUXSkWZr890 R/IBk/zC/zOOvknEroopXDeQaVryfB6Xs8gd74+jD4evIrIlIJJZarpEiyW/MS9n njPvySq+yFBYySJclFDBhgs7tqjz4ya1OLDYXTFaGoE1odyho7UOFLrjzubvbd1h dWnC4RUlfeGdrOlt5z1+6D9gjeOawOfkhGGBpY6LHVaQvgpDUZ1hnF7Jx88RSLMv A3EyUzMzABDg/NulgfTQLlkhHRAMvGFhK4EGCF0JEVpBe0NHZT2SEUXRvQr4rAoq CUtRtA== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dtgms91m9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:56:54 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3568090851aso25976865a91.1 for ; Mon, 27 Apr 2026 20:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348614; x=1777953414; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=B78CjQBbuZjRK4uBze+IvM6DTXnaPD6tJ8oMVVcOAus=; b=VkPuhpMMl1ZNy45NbMg85aMxHUEjGg4y9zKsy4TrIPHSfjgUBYH0jMrMVmE7l/ehFu 9jJM78kxRXOpRXLFS9bQzEh8h+H7u6PBtPuoIVy7Kz3YjfgrHLatamb+96V36cN0ynty XxCpL/Ur3FVI1VSTN5RusOe9H3TdnyNgPf7l1KCiUeVYNV/NH5Abb36tmP331CziC3WC N9Je0a6Woj1zTeX8QkNv3fR0htwqFBdGp4GWDzghtzuzFnnwodVkn7Z6BBjqfGBBUjld I0b3EaajXQhhUzHcD9F0kv+8Gbfr2Te7uniUMPz8L4ubl9wIkrcEcPWMgSirvVjFrWYH BM3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348614; x=1777953414; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=B78CjQBbuZjRK4uBze+IvM6DTXnaPD6tJ8oMVVcOAus=; b=MOf5+DvyZYoE6/11ClwcRMVozrlJh19RWoYKtCyVYS/41ohIjgGA8oYM/rvbue9bQd tRBpT3HuuUkD5Fv1j5xkqK3RLOLWhN5cLGPSOM++BwNECEk28jla1E9xxl9hyyaStqWl tgA2beUOLJiMgk+cglIUrDOrz8uT9ubQrCU/VD9ss1JwCKzzrj/E+8SXKEZM18ZkUPQ6 08/SZ26qrHDSqG/wQvH/ViwHj9gqGR6dfKCeE9WZgUBFOqKFGGKCG67QxaJ5dpa61WgP j26xHw8bXhveoqcrPOFvrOGhMmi58o8CaJgh+95FasiXD6Z0v/9wlOBv0CBRHPgxoWjL fuiA== X-Forwarded-Encrypted: i=1; AFNElJ/7dB5/4swHz7Lx/WWgsGGGyXrKTCzYb/S8jfGjvZztma8vW9EI7laYG5m2jPcvNbYAbTEQ/ZLFUaAeNmk=@vger.kernel.org X-Gm-Message-State: AOJu0YwgKf/9uRd8JR0LajU56/FWuUhIkfOtoMIuAMjRZ8BKxpKlZYS7 3Kxoj/L3Pt56wAIyqoD3CP8+6Z8sB8ME0EF/+1itBHaeU5JhFrC7FTE8wiyc/rjE9EJ0f8uRD/r OQZCeEt57B2Cn72djWiZca/KynCNqeWbxIcPkCR/XBVQB7g39h+75+KsFMvamQ0zM+DY= X-Gm-Gg: AeBDietJKx06Y1JaGyOivtlUfpNhGm4HEOrhcjLnKtiSOni8GutqgBa3qPtkQyIz4kh FJV3OCJq+blsiXlswEJk5PRrYykK4VDeYjXrhwr8p0Jvs9G0DRMTn0hQFlPEwQZjdNh+L/k8myr /E8yNd2CyJfCbtcwhktDhcxataC7TVRk/Ot6mTQd07adtgmiS6ez47slvr+XiOjY3/Im6fp4U49 QztOiwhCWyoK5MoUmuKy12wKo0m3UVRGv8Y63FJjqsxomtnw199OQhkHRaA4ZFmvzFS+780cljW e7pCR/qpia7uJyA8lHcSBtdNcxHOL7uK+bk7SU5AtWZczmSRHfi4FqiPXONYokEZeZb6N+Be+Pk KqLanTXEH+XNQePJy1yOTZSD7SqJSHd4lT4aINXIrY070Owct4VHFpQOdQKqk/2bjBA== X-Received: by 2002:a17:90b:17ca:b0:35f:ccf6:69a5 with SMTP id 98e67ed59e1d1-3649205a55emr1476589a91.20.1777348613398; Mon, 27 Apr 2026 20:56:53 -0700 (PDT) X-Received: by 2002:a17:90b:17ca:b0:35f:ccf6:69a5 with SMTP id 98e67ed59e1d1-3649205a55emr1476549a91.20.1777348612837; Mon, 27 Apr 2026 20:56:52 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:52 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:14 +0530 Subject: [PATCH v3 08/12] media: iris: Use power domain type to look up pd_devs index 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: <20260428-glymur-v3-8-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=23045; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=snCiGYnE5lR7k11Sd8HZYZBUpIgzZpSwTWZQd9WBf78=; b=oJjWfLUbgg8n7VTOXJCpIuvTetYxDw3TUBom9Rsz07QuVihPN47ewOcpgjM/QwO2gDcRNKHJ5 gByda4hXj9tBPPecmsJ0ySZQlC/qTa0GlL0Eh7IWOC/c1VkyJLLobf4 X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-GUID: NtERo-20c5fUMrxPDuL7V3J2vNc_k09K X-Authority-Analysis: v=2.4 cv=R4gz39RX c=1 sm=1 tr=0 ts=69f03006 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=3jpyDGP9Yv0p6WhxEk8A:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX8MgJPTCPWfdm bblDWXWWVMkQTKn2ZHmqaMesarvzrjUbqLya6HGphuAt4jOnuEi8CElJI7/Td2dYWnR56hOlOn7 tSqQMM8C13x6DR0UyEWs/wmGMsK/jtxp0lL+efCO3/dSjWbr4gpkiM8hDsFkph1qjNDieUQZzkZ yhxMkuzSjuyd58/xDVz8ZPREQZ+CSlp6LsrElJ9zWKjJn7Z/IB7o7xsK1zCKDhob+CRK5QV7wtn hGjDPNVZmYxXi9HbtBf62pgFyyzsqwn2swIItTg90Fp4KQf3M6jmiprtMQUnPBMWIOsW52sZo/s r2UDPMD2rDAFcylBV0e3x1keLM+m0hYLNYYRDZHDoNwy+SaFCmr/kFhQDhF/CbQX7Z7HTOvcS+7 pEpD5zUWCWv70eiSU/YpagA9ts2R4ibhAwC1f/84k+7jjmSJSFWX3sBjRYzLJooAWHDDIS/U5T9 jPBMCixrhjhT1J0zxYQ== X-Proofpoint-ORIG-GUID: NtERo-20c5fUMrxPDuL7V3J2vNc_k09K X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 The pmdomain_tbl was a array of strings holding only the power domain names. Callers had to pass a pd_devs[] pointer indexed directly by the platform_pm_domain_type enum value to iris_enable_power_domains() and iris_disable_power_domains(). A future platform may need to introduce a new enum value that aliases an existing one (e.g. IRIS_VCODEC1_POWER_DOMAIN aliasing the IRIS_VPP0_HW_POWER_DOMAIN on Glymur), which would break the assumption that enum values map 1:1 to pd_devs[] indices. To fix this, replace the string array with a new struct platform_pd_data that pairs each power domain name with its platform_pm_domain_type. Add a helper iris_get_pd_index_by_type() that walks this table and returns the correct pd_devs[] index for a given type. Update iris_enable_power_domains() and iris_disable_power_domains() to accept a platform_pm_domain_type instead of a struct device pointer. They now call the helper internally to resolve the index, removing the need for callers to do the index lookup themselves. This prepares the driver for adding new platforms where power domain enum values cannot be used directly as pd_devs[] indices. Signed-off-by: Vishnu Reddy --- .../platform/qcom/iris/iris_platform_common.h | 9 +++- .../media/platform/qcom/iris/iris_platform_gen1.c | 18 +++++--- .../media/platform/qcom/iris/iris_platform_gen2.c | 24 ++++++---- drivers/media/platform/qcom/iris/iris_probe.c | 4 +- drivers/media/platform/qcom/iris/iris_resources.c | 44 +++++++++++++++++- drivers/media/platform/qcom/iris/iris_resources.h | 6 ++- drivers/media/platform/qcom/iris/iris_vpu3x.c | 9 ++-- drivers/media/platform/qcom/iris/iris_vpu4x.c | 52 ++++++++----------= ---- drivers/media/platform/qcom/iris/iris_vpu_common.c | 23 +++++----- 9 files changed, 117 insertions(+), 72 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 30e9d4d288c6..7d59e6364e9d 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -212,6 +212,12 @@ enum platform_pm_domain_type { IRIS_APV_HW_POWER_DOMAIN, }; =20 +struct platform_pd_data { + enum platform_pm_domain_type *pd_types; + const char **pd_names; + u32 pd_count; +}; + struct iris_platform_data { void (*init_hfi_command_ops)(struct iris_core *core); void (*init_hfi_response_ops)(struct iris_core *core); @@ -225,8 +231,7 @@ 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 platform_pd_data *pmdomain_tbl; const char * const *opp_pd_tbl; unsigned int opp_pd_tbl_size; const struct platform_clk_data *clk_tbl; diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen1.c b/driver= s/media/platform/qcom/iris/iris_platform_gen1.c index be6a631f8ede..0ec73783bc10 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen1.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen1.c @@ -279,7 +279,17 @@ static const struct bw_info sm8250_bw_table_dec[] =3D { { ((1920 * 1080) / 256) * 30, 416000 }, }; =20 -static const char * const sm8250_pmdomain_table[] =3D { "venus", "vcodec0"= }; +static const struct platform_pd_data sm8250_pmdomain_table =3D { + .pd_types =3D (enum platform_pm_domain_type []) { + IRIS_CTRL_POWER_DOMAIN, + IRIS_VCODEC_POWER_DOMAIN, + }, + .pd_names =3D (const char *[]) { + "venus", + "vcodec0", + }, + .pd_count =3D 2, +}; =20 static const char * const sm8250_opp_pd_table[] =3D { "mx" }; =20 @@ -350,8 +360,7 @@ const struct iris_platform_data sm8250_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8250_clk_reset_table), .bw_tbl_dec =3D sm8250_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8250_bw_table_dec), - .pmdomain_tbl =3D sm8250_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8250_pmdomain_table), + .pmdomain_tbl =3D &sm8250_pmdomain_table, .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, @@ -403,8 +412,7 @@ const struct iris_platform_data sc7280_data =3D { .icc_tbl_size =3D ARRAY_SIZE(sm8250_icc_table), .bw_tbl_dec =3D sc7280_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sc7280_bw_table_dec), - .pmdomain_tbl =3D sm8250_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8250_pmdomain_table), + .pmdomain_tbl =3D &sm8250_pmdomain_table, .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, diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 47c6b650f0b4..5862c89a4971 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -775,7 +775,17 @@ static const struct bw_info sm8550_bw_table_dec[] =3D { { ((1920 * 1080) / 256) * 30, 294000 }, }; =20 -static const char * const sm8550_pmdomain_table[] =3D { "venus", "vcodec0"= }; +static const struct platform_pd_data sm8550_pmdomain_table =3D { + .pd_types =3D (enum platform_pm_domain_type []) { + IRIS_CTRL_POWER_DOMAIN, + IRIS_VCODEC_POWER_DOMAIN, + }, + .pd_names =3D (const char *[]) { + "venus", + "vcodec0", + }, + .pd_count =3D 2, +}; =20 static const char * const sm8550_opp_pd_table[] =3D { "mxc", "mmcx" }; =20 @@ -934,8 +944,7 @@ const struct iris_platform_data sm8550_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D sm8550_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), + .pmdomain_tbl =3D &sm8550_pmdomain_table, .opp_pd_tbl =3D sm8550_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), .clk_tbl =3D sm8550_clk_table, @@ -1039,8 +1048,7 @@ const struct iris_platform_data sm8650_data =3D { .controller_rst_tbl_size =3D ARRAY_SIZE(sm8650_controller_reset_table), .bw_tbl_dec =3D sm8550_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), + .pmdomain_tbl =3D &sm8550_pmdomain_table, .opp_pd_tbl =3D sm8550_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), .clk_tbl =3D sm8550_clk_table, @@ -1135,8 +1143,7 @@ const struct iris_platform_data sm8750_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8750_clk_reset_table), .bw_tbl_dec =3D sm8550_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), + .pmdomain_tbl =3D &sm8550_pmdomain_table, .opp_pd_tbl =3D sm8550_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), .clk_tbl =3D sm8750_clk_table, @@ -1235,8 +1242,7 @@ const struct iris_platform_data qcs8300_data =3D { .clk_rst_tbl_size =3D ARRAY_SIZE(sm8550_clk_reset_table), .bw_tbl_dec =3D sm8550_bw_table_dec, .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), - .pmdomain_tbl =3D sm8550_pmdomain_table, - .pmdomain_tbl_size =3D ARRAY_SIZE(sm8550_pmdomain_table), + .pmdomain_tbl =3D &sm8550_pmdomain_table, .opp_pd_tbl =3D sm8550_opp_pd_table, .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), .clk_tbl =3D sm8550_clk_table, diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 34751912f871..34c981be9bc1 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -43,8 +43,8 @@ static int iris_init_power_domains(struct iris_core *core) int ret; =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_names =3D core->iris_platform_data->pmdomain_tbl->pd_names, + .num_pd_names =3D core->iris_platform_data->pmdomain_tbl->pd_count, .pd_flags =3D PD_FLAG_NO_DEV_LINK, }; =20 diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index 773f6548370a..ae27488579d7 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -70,10 +70,43 @@ 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) +static int iris_get_pd_index_by_type(struct iris_core *core, enum platform= _pm_domain_type pd_type) { + const struct platform_pd_data *pd_tbl; + u32 pd_count, i; + + pd_tbl =3D core->iris_platform_data->pmdomain_tbl; + pd_count =3D core->iris_platform_data->pmdomain_tbl->pd_count; + + for (i =3D 0; i < pd_count; i++) { + if (pd_tbl->pd_types[i] =3D=3D pd_type) + return i; + } + + return -EINVAL; +} + +int iris_genpd_set_hwmode(struct iris_core *core, enum platform_pm_domain_= type pd_type, bool hwmode) +{ + int pd_index =3D iris_get_pd_index_by_type(core, pd_type); + + if (pd_index < 0) + return pd_index; + + return dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[pd_index], hwm= ode); +} + +int iris_enable_power_domains(struct iris_core *core, enum platform_pm_dom= ain_type pd_type) +{ + int pd_index =3D iris_get_pd_index_by_type(core, pd_type); + struct device *pd_dev; int ret; =20 + if (pd_index < 0) + return pd_index; + + pd_dev =3D core->pmdomain_tbl->pd_devs[pd_index]; + ret =3D iris_opp_set_rate(core->dev, ULONG_MAX); if (ret) return ret; @@ -85,10 +118,17 @@ int iris_enable_power_domains(struct iris_core *core, = struct device *pd_dev) return ret; } =20 -int iris_disable_power_domains(struct iris_core *core, struct device *pd_d= ev) +int iris_disable_power_domains(struct iris_core *core, enum platform_pm_do= main_type pd_type) { + int pd_index =3D iris_get_pd_index_by_type(core, pd_type); + struct device *pd_dev; int ret; =20 + if (pd_index < 0) + return pd_index; + + pd_dev =3D core->pmdomain_tbl->pd_devs[pd_index]; + ret =3D iris_opp_set_rate(core->dev, 0); if (ret) return ret; diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index 6bfbd2dc6db0..d5692e4694b1 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.h +++ b/drivers/media/platform/qcom/iris/iris_resources.h @@ -9,11 +9,13 @@ struct iris_core; =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_enable_power_domains(struct iris_core *core, enum platform_pm_dom= ain_type pd_type); +int iris_disable_power_domains(struct iris_core *core, enum platform_pm_do= main_type pd_type); 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); +int iris_genpd_set_hwmode(struct iris_core *core, enum platform_pm_domain_= type pd_type, + bool hwmode); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index 1f0a3a47d87f..a9f43dbfc695 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -208,7 +208,7 @@ static int iris_vpu33_power_off_controller(struct iris_= core *core) iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); =20 disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); =20 return 0; @@ -218,8 +218,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *cor= e) { int ret; =20 - ret =3D iris_enable_power_domains(core, - core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); if (ret) return ret; =20 @@ -235,7 +234,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *cor= e) if (ret) goto err_disable_hw_free_clk; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_P= OWER_DOMAIN], true); + ret =3D iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, true); if (ret) goto err_disable_hw_clk; =20 @@ -248,7 +247,7 @@ static int iris_vpu35_power_on_hw(struct iris_core *cor= e) err_disable_axi_clk: iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); =20 return ret; } diff --git a/drivers/media/platform/qcom/iris/iris_vpu4x.c b/drivers/media/= platform/qcom/iris/iris_vpu4x.c index 4082d331d2f3..7b8922d8aec7 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu4x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu4x.c @@ -27,28 +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_VCODEC_P= OWER_DOMAIN], - hw_mode); + ret =3D iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, 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, IRIS_VPP0_HW_POWER_DOMAIN, 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, IRIS_VPP1_HW_POWER_DOMAIN, 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, IRIS_APV_HW_POWER_DOMAIN, hw_mode); if (ret) goto restore_vpp1_domain_mode; } @@ -57,14 +53,12 @@ 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, IRIS_VPP1_HW_POWER_DOMAIN, !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, IRIS_VPP0_HW_POWER_DOMAIN, !hw_mode); restore_hw_domain_mode: - dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOM= AIN], !hw_mode); + iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, !hw_mode); =20 return ret; } @@ -73,8 +67,7 @@ static int iris_vpu4x_power_on_apv(struct iris_core *core) { int ret; =20 - ret =3D iris_enable_power_domains(core, - core->pmdomain_tbl->pd_devs[IRIS_APV_HW_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, IRIS_APV_HW_POWER_DOMAIN); if (ret) return ret; =20 @@ -85,7 +78,7 @@ static int iris_vpu4x_power_on_apv(struct iris_core *core) return 0; =20 disable_apv_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_APV_HW_= POWER_DOMAIN]); + iris_disable_power_domains(core, IRIS_APV_HW_POWER_DOMAIN); =20 return ret; } @@ -140,7 +133,7 @@ static void iris_vpu4x_power_off_apv(struct iris_core *= core) =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_domains(core, IRIS_APV_HW_POWER_DOMAIN); } =20 static void iris_vpu4x_ahb_sync_reset_apv(struct iris_core *core) @@ -227,21 +220,18 @@ static int iris_vpu4x_power_on_hardware(struct iris_c= ore *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_VCODEC_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); 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_domains(core, IRIS_VPP0_HW_POWER_DOMAIN); 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_domains(core, IRIS_VPP1_HW_POWER_DOMAIN); if (ret) goto disable_vpp0_power_domain; } @@ -273,14 +263,12 @@ static int iris_vpu4x_power_on_hardware(struct iris_c= ore *core) 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_domains(core, IRIS_VPP1_HW_POWER_DOMAIN); 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_domains(core, IRIS_VPP0_HW_POWER_DOMAIN); disable_hw_power_domain: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); =20 return ret; } @@ -351,14 +339,12 @@ static void iris_vpu4x_power_off_hardware(struct iris= _core *core) iris_vpu4x_disable_hardware_clocks(core, efuse_value); =20 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_domains(core, IRIS_VPP1_HW_POWER_DOMAIN); =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_domains(core, IRIS_VPP0_HW_POWER_DOMAIN); =20 - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); } =20 const struct vpu_ops iris_vpu4x_ops =3D { diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index 006fd3ffc752..74b4dccd6a66 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -214,15 +214,15 @@ int iris_vpu_power_off_controller(struct iris_core *c= ore) iris_disable_unprepare_clock(core, IRIS_AHB_CLK); iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); =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_VCODEC_POWER_DOM= AIN], false); - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, false); + iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); iris_disable_unprepare_clock(core, IRIS_VCODEC_AHB_CLK); iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); } @@ -243,7 +243,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_domains(core, IRIS_CTRL_POWER_DOMAIN); if (ret) return ret; =20 @@ -270,7 +270,7 @@ int iris_vpu_power_on_controller(struct iris_core *core) err_disable_axi_clock: iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); =20 return ret; } @@ -279,8 +279,7 @@ int iris_vpu_power_on_hw(struct iris_core *core) { int ret; =20 - ret =3D iris_enable_power_domains(core, - core->pmdomain_tbl->pd_devs[IRIS_VCODEC_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); if (ret) return ret; =20 @@ -292,7 +291,7 @@ int iris_vpu_power_on_hw(struct iris_core *core) if (ret && ret !=3D -ENOENT) goto err_disable_hw_clock; =20 - ret =3D dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_VCODEC_P= OWER_DOMAIN], true); + ret =3D iris_genpd_set_hwmode(core, IRIS_VCODEC_POWER_DOMAIN, true); if (ret) goto err_disable_hw_ahb_clock; =20 @@ -303,7 +302,7 @@ int iris_vpu_power_on_hw(struct iris_core *core) err_disable_hw_clock: iris_disable_unprepare_clock(core, IRIS_VCODEC_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_VCODEC_= POWER_DOMAIN]); + iris_disable_power_domains(core, IRIS_VCODEC_POWER_DOMAIN); =20 return ret; } @@ -365,7 +364,7 @@ int iris_vpu35_vpu4x_power_off_controller(struct iris_c= ore *core) iris_disable_unprepare_clock(core, IRIS_CTRL_FREERUN_CLK); iris_disable_unprepare_clock(core, IRIS_AXI_CTRL_CLK); =20 - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); =20 reset_control_bulk_reset(clk_rst_tbl_size, core->resets); =20 @@ -376,7 +375,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_co= re *core) { int ret; =20 - ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); + ret =3D iris_enable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); if (ret) return ret; =20 @@ -399,7 +398,7 @@ int iris_vpu35_vpu4x_power_on_controller(struct iris_co= re *core) err_disable_axi1_clk: iris_disable_unprepare_clock(core, IRIS_AXI_CTRL_CLK); err_disable_power: - iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_power_domains(core, IRIS_CTRL_POWER_DOMAIN); =20 return ret; } --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 7E59C33030F for ; Tue, 28 Apr 2026 03:57:02 +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=1777348624; cv=none; b=a2663VRXb9IDHtN8A5KHqommKsKslv5EJ5pbbRjeh9/DveZqlYAPWUZZ2hZDLlTiUQWctDb1pnX3xXHeg3wpfUtrzgN7jqV3NSXWBLHsB9vLoJgoDLBQC433QJ95uKzctRKLn3bBG2chn0MUnm8Nx7LCthY4KW8Tb7+02Jglk7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348624; c=relaxed/simple; bh=LCMjOJtIxtHep2v0soQ3sUv2MXiTZMrsIoi3l55k2cY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qCZGGqsW8kSyvo6UkY3J/E/ucxPmudJj72S8MMTeB85hP1YGvWyD5KVw1WDgRgWvoSwvkehZpdhDkHNUtN3T6Zkz5L/84Vudy3xI/GlX3oEwOefIQs4MmqrCOnh4vwkR3nPUo8HrM1K9JG/gtFmy6h9Fo7B/rhIAk1l1rtm/cYQ= 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=J6S9AURY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VgACB+Bu; 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="J6S9AURY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VgACB+Bu" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63S3Gdn01237232 for ; Tue, 28 Apr 2026 03:57:01 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= nayjuY7g5QVFWHFlaeUOOsPyzRCe/yAlG6cR/ITXMU0=; b=J6S9AURYZUukv+Zr gyWrCPTdgcBCVMGUW/dKCj3a+BTfRkxT4PB/7JZwydxo5q4lKeJ/9yG+/8bBouqf C7c5uBYCs65Ni+BQlyB02uh5PeIVRPuwqK0iL2M1qca+s8qAp7gugAT8aJDzMfaK 0wa5lZ0x0+BVgTYK2EQuC906ZBwV+ibG43FnZKCjFp+YREHv5Fa6hjNIdr5sCemt KHhc181lKEAUUVN47C9HSGcXGyY9grVDLMs+nlNpPfFxPxQKiciWvYyGVk5sJbGh hIiL9WiR88B4dU54V+6ZoTJvgM4luA7kOSfDvderK7fLc0egj9js8nYbjXtTb3+j egBXiw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt6n4kejr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:57:01 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-35fbb57764aso12736500a91.1 for ; Mon, 27 Apr 2026 20:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348620; x=1777953420; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nayjuY7g5QVFWHFlaeUOOsPyzRCe/yAlG6cR/ITXMU0=; b=VgACB+Bu2mhs2bBzu0nzWKouo1xe3O/RrRnrTB8zAzotr/FepaTg58EJ8urJnUc8KR XNNAU6soOrnQ0wfZ6RW+rJW3P13qHSDWMbStzJNmPeUBT1yzTz/3U7ZEUCXwUCMeKlne DbcliM4fNGrazOmAtPSFoXyKRydKwX953Pv9YQ32Bb6P+JSBXIvhzN+Gk4+jcVSrouKP BDuB7WSk/pVXM6KzrEQwFexpiAzGvPOxqBsLJNwZHYdzvC216GA3f1fI4XTjrBcEIeqy hyUI/ijPGgclPigUtYs+7gkeiqZlc11WMAHDAUJclEfh9eV8b/fhnFKeglIlOFwwdumI bc0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348620; x=1777953420; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=nayjuY7g5QVFWHFlaeUOOsPyzRCe/yAlG6cR/ITXMU0=; b=rF2ZIWZTmyUWi/pXMsZIzjaNV7ocPgiE3WlVTuKPpWN8bpNINf5r/2OAeyC5WLZTR/ GWj9uCezzeVCAF8DM+dFi7C85SWT+Y0K362yV2hyhAqIeOaYavb8Wa8bVDlPZnB7xg5o udTQOUoriExBNl+1XCJ2hNVo68v17+GC9XY4ZuU6YgNgaNcUt9oXT9kCbzNBs6mYy5wh rNuRoNhcGogAwKsfhkrtwffSwtRQOb2IJn52zh4bBF+bxqNwU2kN5JWzKHtoMKN8krtk 48Q1MvP1XhClhoAazJuEj0iZ514yydWzIpDQZ9r3on6KTl3Ne25i04TK4pAGawZMzMJr QauA== X-Forwarded-Encrypted: i=1; AFNElJ8TM4TfmaHRvmMP0JpBUr2kQEQHbF6ReN4kfwH/wb/7wJT/p9gJml9Gd1gupzrlBi/VFmyp3l7ID4TxAC4=@vger.kernel.org X-Gm-Message-State: AOJu0YyFua0qzgSlMDVrNRfbapnOWhfxDPeY7P/TLJpPZwbdBs4hPoUU 7r8dik8RKH2KyhifpmzVy4rzsRUfTNlvlEf3B8HUebK5lDqJ6SryzzUh4vRuIowQ4K5KNrc0h6H Ymv9X6Kwu/A3/g2JzhiEyxcZJZs6meVjTTRi8lfoSkm3MKoGgrHg5HvXbZRL1j309QLs= X-Gm-Gg: AeBDieuwDU1AKgTAvo9ER/efJ9zOT8Ft5idc2jUisF1reove+U4Os2Gbuyi5QQ/6+Ap 1Hmj3z1/8UeMhCXp01FiskW5lv95N1pFwdmaGOHc3mL3Yu30fnWMofCZbxip+k3nrHIjCwhJsxV KMgWSaHPk74Z4DfCm2C2h3iHM+fyy3XZlg377K5h9n9AWmlBWLOO46teV+kBsAHTczsNxRXI2+X du7cvbichBWi6sIdXvUp1ukc5l5QL+dnAPa+FBqtdXKe2dgPAFUjh0gmy5FWIN4ZIW6ky95gvIN KmStYBR43agKzk21L0LBQyzT7iMi8hp2aGqnPSBMk8lUVvaUuWbaiT5W5kOYBrrhOl0gh2saq5O dMKeTKrwy1PZhijmrcQKpauJOA8hsr2Ha3OomdodqhWX+STKNYeHTC5ajBZx0b6mqWQ== X-Received: by 2002:a17:90b:498d:b0:35f:b4c1:91ea with SMTP id 98e67ed59e1d1-36491f5c2cdmr1037679a91.13.1777348620129; Mon, 27 Apr 2026 20:57:00 -0700 (PDT) X-Received: by 2002:a17:90b:498d:b0:35f:b4c1:91ea with SMTP id 98e67ed59e1d1-36491f5c2cdmr1037657a91.13.1777348619642; Mon, 27 Apr 2026 20:56:59 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:56:59 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:15 +0530 Subject: [PATCH v3 09/12] 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: <20260428-glymur-v3-9-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=8487; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=LCMjOJtIxtHep2v0soQ3sUv2MXiTZMrsIoi3l55k2cY=; b=nfjm7b0evT/f9tkaR+ncTOk65SzCNldv27EHYSiOAFWi+CcZGjjlr0a/dEe7O6QIg4NO/KD2z CZlA/RgPIBiCh+Q/HGDIo2y7yORAcKaK9Qq59D6/UwaXwMfzHGSASt3 X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-ORIG-GUID: T2JO9xFmRczyKFCjG02MRysYC6RVbHyW X-Authority-Analysis: v=2.4 cv=Xba5Co55 c=1 sm=1 tr=0 ts=69f0300d cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=Js87xDwMZ--NYW6i2EgA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: T2JO9xFmRczyKFCjG02MRysYC6RVbHyW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX1JhmA0xoveuZ nhu1xgekTdIqen/lPBaJf79H4LVUoQHIUyEsb06wqGpL1wlm+kiLtjeyxUrviiQA14P83tmmKTv 3BR4q1Eoi8IBSBF1UEQ0EjyWu4b7TwfsZrJ7Me2VE+dTOTHJJH8eFCM4F/0c5g3k3UmG/CHpxbb N8kHnuW0Wjz09z/10xxbnwiwwKuNJ9eh99S9fQ2z5b9hFYOQ61EotVQ1FnxH7mtxdIhDczs/Sdb QSbT6NlbTcmfO6FNIF42GE4WLmKxs8oavWYw0QCYt9+O4n8eCSE/W8oeNA/XIJzJWZ075eqDeRT cuH/JtzRuK1q1lSk0u4N8b9rVb3E3c9K8vJp7B/EBt+8JFNSTzrdKEQQ1L4akiRRLANlbj9RF/y LLrgsQyM9EJ9qJQf31IBVIyoFUkhqlfMn7V2cRE0sWlfc5EPAkSl74PkzkI7eGoAfdP/6p1HOoF Uy9iPljF+1xyUWx+Bag== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 Glymur has a secondary video codec core (vcodec1), equivalent to the primary core (vcodec0), but with independent power domains, clocks, and reset lines. Reuse the existing code wherever possible and add power sequence for vcodec1. Signed-off-by: Vishnu Reddy --- .../platform/qcom/iris/iris_platform_common.h | 4 + drivers/media/platform/qcom/iris/iris_vpu3x.c | 122 +++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + .../platform/qcom/iris/iris_vpu_register_defines.h | 7 ++ 4 files changed, 134 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 7d59e6364e9d..8995136ad29e 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -61,6 +61,9 @@ enum platform_clk_type { IRIS_VPP0_HW_CLK, IRIS_VPP1_HW_CLK, IRIS_APV_HW_CLK, + IRIS_AXI_VCODEC1_CLK, + IRIS_VCODEC1_CLK, + IRIS_VCODEC1_FREERUN_CLK, }; =20 struct platform_clk_data { @@ -210,6 +213,7 @@ enum platform_pm_domain_type { IRIS_VPP0_HW_POWER_DOMAIN, IRIS_VPP1_HW_POWER_DOMAIN, IRIS_APV_HW_POWER_DOMAIN, + IRIS_VCODEC1_POWER_DOMAIN, }; =20 struct platform_pd_data { diff --git a/drivers/media/platform/qcom/iris/iris_vpu3x.c b/drivers/media/= platform/qcom/iris/iris_vpu3x.c index a9f43dbfc695..bd70d1c0ea76 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3x.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3x.c @@ -27,6 +27,16 @@ static bool iris_vpu3x_hw_power_collapsed(struct iris_co= re *core) return pwr_status ? false : true; } =20 +static bool iris_vpu36_hw1_power_collapsed(struct iris_core *core) +{ + u32 value, pwr_status; + + value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); + pwr_status =3D value & BIT(4); + + return !pwr_status; +} + static void iris_vpu3_power_off_hardware(struct iris_core *core) { u32 reg_val =3D 0, value, i; @@ -260,6 +270,110 @@ static void iris_vpu35_power_off_hw(struct iris_core = *core) iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC_CLK); } =20 +static int iris_vpu36_power_on_hw1(struct iris_core *core) +{ + int ret; + + ret =3D iris_enable_power_domains(core, IRIS_VCODEC1_POWER_DOMAIN); + if (ret) + return ret; + + ret =3D iris_prepare_enable_clock(core, IRIS_AXI_VCODEC1_CLK); + if (ret) + goto err_disable_hw1_power; + + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC1_FREERUN_CLK); + if (ret) + goto err_disable_axi1_clk; + + ret =3D iris_prepare_enable_clock(core, IRIS_VCODEC1_CLK); + if (ret) + goto err_disable_hw1_free_clk; + + ret =3D iris_genpd_set_hwmode(core, IRIS_VCODEC1_POWER_DOMAIN, true); + if (ret) + goto err_disable_hw1_clk; + + return 0; + +err_disable_hw1_clk: + iris_disable_unprepare_clock(core, IRIS_VCODEC1_CLK); +err_disable_hw1_free_clk: + iris_disable_unprepare_clock(core, IRIS_VCODEC1_FREERUN_CLK); +err_disable_axi1_clk: + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC1_CLK); +err_disable_hw1_power: + iris_disable_power_domains(core, IRIS_VCODEC1_POWER_DOMAIN); + + return ret; +} + +static int iris_vpu36_power_on_hw(struct iris_core *core) +{ + int ret; + + ret =3D iris_vpu35_power_on_hw(core); + if (ret) + return ret; + + ret =3D iris_vpu36_power_on_hw1(core); + if (ret) + goto err_power_off_hw; + + return 0; + +err_power_off_hw: + iris_vpu35_power_off_hw(core); + + return ret; +} + +static void iris_vpu36_power_off_hw1(struct iris_core *core) +{ + u32 value, i; + int ret; + + if (iris_vpu36_hw1_power_collapsed(core)) + 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 + VCODEC1_SS_IDLE_STATUSN + 4 = * i, + value, value & DMA_NOC_IDLE, 2000, 20000); + if (ret) + goto disable_power; + } + + writel(REQ_VCODEC1_POWER_DOWN_PREP, core->reg_base + AON_WRAPPER_MVP_NOC_= LPI_CONTROL); + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATU= S, + value, value & NOC_LPI_VCODEC1_STATUS_DONE, 2000, 20000); + if (ret) + goto disable_power; + + writel(0, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + writel(VCODEC1_BRIDGE_SW_RESET | VCODEC1_BRIDGE_HW_RESET_DISABLE, core->r= eg_base + + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(VCODEC1_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDG= E_SYNC_RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_power: + iris_genpd_set_hwmode(core, IRIS_VCODEC1_POWER_DOMAIN, false); + iris_disable_unprepare_clock(core, IRIS_VCODEC1_CLK); + iris_disable_unprepare_clock(core, IRIS_VCODEC1_FREERUN_CLK); + iris_disable_unprepare_clock(core, IRIS_AXI_VCODEC1_CLK); + iris_disable_power_domains(core, IRIS_VCODEC1_POWER_DOMAIN); +} + +static void iris_vpu36_power_off_hw(struct iris_core *core) +{ + iris_vpu35_power_off_hw(core); + iris_vpu36_power_off_hw1(core); +} + 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, @@ -284,3 +398,11 @@ const struct vpu_ops iris_vpu35_ops =3D { .program_bootup_registers =3D iris_vpu35_vpu4x_program_bootup_registers, .calc_freq =3D iris_vpu3x_vpu4x_calculate_frequency, }; + +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, +}; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index f6dffc613b82..99e75fb4b10d 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..37f234484f1b 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,11 +57,13 @@ #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) =20 #define WRAPPER_IRIS_VCODEC_VPU_WRAPPER_SPARE_0 (WRAPPER_BASE_OFFS + 0x78) #define WRAPPER_CORE_POWER_STATUS (WRAPPER_BASE_OFFS + 0x80) --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 613AF33C18E for ; Tue, 28 Apr 2026 03:57:08 +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=1777348630; cv=none; b=mBWdZKkJ/QX9D8gcZlyquXxnJZvKfndkryihU/MWou0Cv0aCMyyt/Dfh0q5WCjeHfYqb+USkjM2GfMV7SQoGXp1oKdBkeg1684j32+LjI3wpq38milYNEf0aHHAHr+grBU3nThzrU1FYNI/HwekZdm+TS7hJjni22zsD6jYFNUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348630; c=relaxed/simple; bh=yXxIUMbwRxMABCGjVIR7TpLcAseI+8GQJ4r/4Bl8Qow=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r7aEN5j2BYlemvUSW23/bb1lBr9mfe/MYXcpA8U4chpMQC7PgxY742ldLWR3H0TeuVcEpQzQw9DH6cwRt8yU4//xrH4EM6vas1O+95kB4C3wPMdsn3B4kXM0OigFbpfQTlpmLTIRaYx+SIAH+dSxPY2bTKOd2OU0FLqRPAna8Lo= 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=PMqO6xr9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=SNLPbgum; 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="PMqO6xr9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="SNLPbgum" 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 63RKpwU82383024 for ; Tue, 28 Apr 2026 03:57:08 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= ZWdgJZns+NnF8pzUEhG2MpG4641DiTRaUryPkckm208=; b=PMqO6xr9CPU1Wq8n SJyshVN0O8Xlj9PIl1MwnZbWf7YJ9j90SYr+3MxosFLewO9qZt8ewA5+R2aFKdPc Fu3Sl/HiD4eKeAUlSVGE6S4GXit1cxcYGbYe9qFhvjtYV3dyCqz1THV+ictuHX5u zuhwMbePEJOvd+hHbA3ZoY2CDGeS+vyqJrBZspQFRuFstGxi456f50xowwKY7zJ5 qaoAa/uj4K0y1uKXC3De/S06G8sqEgVwQIIebMg72X0gdlnC2t5Q5C/A3fzQWH6O 8ETeoppdvYL0Z8/7AyTLcEaNSYt16VZsX/qimuzByR4rA1JDtIGiQ73BYvygupJ6 M18UKg== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt85xu4cn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:57:07 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-35845fcf0f5so11965315a91.0 for ; Mon, 27 Apr 2026 20:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348627; x=1777953427; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZWdgJZns+NnF8pzUEhG2MpG4641DiTRaUryPkckm208=; b=SNLPbgumNWRoP5AkJAKklagmKxqpUVSi6zGiIa9+fgNHzHj6JmWW8fg4RETa7eAn3V YpyxRNXl1igZ3JYX8CWKzMawk7WCbkErjnMRcAJ9p2Bbn/zeyTkdo+HbgN3W/TDRyAPB EhTtdkQpWwDFVoEGRve/VZL//mhkl5DDKVz+ZALY8jCbN6h300Y0k/+uNpql62LjFwWD eWOEwUR022a+KVRwQcmlnfjG9UANKI19LMObsqXNCJUtj1QoUsDPlKoMJT02IPrqct28 af8VEmfQ/7YoHHdywj9VRa4LHta8Lyew9tcyVgU+0/3GpactID8FY3+/CKl8E/SVIV8C wGjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348627; x=1777953427; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ZWdgJZns+NnF8pzUEhG2MpG4641DiTRaUryPkckm208=; b=SWHXsHXH9rH9sKoDwM+iQ8Oc7M5kJUNVKXiWlmcUbXZ3jLhTEpW329Pg1z+xTl4ldj ZNO9CjA+CwbJWNW+9kYrMajQE0wvll4h1W+Kv36ESHISvAuhmyBoUF8Ufqj/vb7vvbei gmNO7nLKVe6tZRToxA7enKRVieLORqBrUiBWhFpbqXbXmgJ1t7l6FWahpwaAIIQ7x6dk LrDOQ0xgvq7CsqDQLjYCtxd/YE/tU1Di97Sc7mU5JI6o3xMQB/CMzzTN2jLLFY6pHj1+ 3rY3f+S/OM6J4jS7lpdoyN0bo22ZlA4B4EwtrmkdzxDesq0fw3I+yjYl2Su8dJL1XSG+ X6fg== X-Forwarded-Encrypted: i=1; AFNElJ+QL0DwkXZycDNdL5FDD+KEIa133SK/vTX6y2KRV7/l0vuUJYeN++EJF1wsykphFR3zOoRzFnSWPD/EU7I=@vger.kernel.org X-Gm-Message-State: AOJu0YxQp5nYphxLdWY9cjYi2kIKo73t4QpYCraM9mJFwUfdm9LYs1p5 Ar6qxl1RdYZXBcPL6QYtd93BcJoOz6JsNJhVF21qgdzMJlzO40CGNWdJT9bvTn+k08/UAfYHc+M TsGPth5iCJPYHGq87GP1l5jxEFVGZQrzbeFfhyMQOeK+uhEto/1jV33BwkUGCIWKMgrA= X-Gm-Gg: AeBDievfQvecFhz6fEpE4z8BLTMsL1zI4G0Jui0O1kTeSJyPQ87SUst7aNHGBSQQlRR rL1Z0ZGIhhmCukqxHImHoG0jXTwFy9vrJjXYAY8IiAwFyJWWDlTEmpLnl/CT7tHAM6/fWxpDHQm dhKAy+AMLfNI0DZGGbplwG0/Q6XtnJUNgaEtu0KUcEM9S5fPnTVTtZNswnezEDVKGn2DM9Ergh1 9UMVtkmaP3HcROmr+57jCkGX+E7bUZh/R2Ow403/SEVbFwn/AqQmCF2qRcBh86LNc6jyJBgwdB5 S2GErFQE1J4UdqgOqZxGD9zwV8pNhKnzcVooKY6TJVpH8fxnbWcg+LSjqzs3EIxnnVALczRdLWc m0B/PCBu5alqjl9WUXRYJALj+6R3No6hiz8ReZjiEQxq6p0skFt9PP61kDdUb6TDBbA== X-Received: by 2002:a17:90b:48:b0:35f:c493:cac5 with SMTP id 98e67ed59e1d1-36491af88e9mr1374149a91.16.1777348626976; Mon, 27 Apr 2026 20:57:06 -0700 (PDT) X-Received: by 2002:a17:90b:48:b0:35f:c493:cac5 with SMTP id 98e67ed59e1d1-36491af88e9mr1374115a91.16.1777348626446; Mon, 27 Apr 2026 20:57:06 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:57:06 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:16 +0530 Subject: [PATCH v3 10/12] 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: <20260428-glymur-v3-10-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=13630; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=yXxIUMbwRxMABCGjVIR7TpLcAseI+8GQJ4r/4Bl8Qow=; b=3P81yvcdwmoK+f3EQxNcrrCCNdvVhyfIUuKoqrnY+f+58kFTy830j81tytMW066xRfg9TSaZF RHwx4TWFTJCBXhrxuZsp1hYjbTtBji/1zAILlZEKeGdWZbKyiGp+mmo X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Zs3d7d7G c=1 sm=1 tr=0 ts=69f03013 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=SR9mA3E-jA3Ceylw1tAA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-ORIG-GUID: 6ynn6zTurv-YMbTbw_cOlOZjvC05rxAr X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX8NH55x+dlC8C gpvlxQ25Le2f4vSjWvh1rtWzMbaarnHMXzJW5CDfV+j90Vd0nY8HNEoDtZfFk71dDa/Wht+85Hk BOMpBUXr1t7ypnt/DV6KgWyQoHuGSzK9uNbiohYtE2SpMQvpTsTU9rDJWRBMR2hCTaGHfgOMn07 rbq5hzPjiA28kMHph/lJpNfA+ePceAduxfTWWWRNV3ybxDeo7d0xN8OckqHO1/d+CAVqMYj44Uj pDvaTu/Yhqdt/3Tag7c2pKpnSGLAvhALUv2MSgQYs64bX2uaZ7/nz1Z7Pj42YM0vUrR/7d0jZkM k2admr3QXkXygE6nQCjNccIy3qWRkfK9y1ob1yuZUnIAlPhzrVzed9G24twETetr+a/sVhmUush oJIv7FgqXYkQzVlXeJOCiU84qUjS7jfjdYxHBrovBendIe2dydJM4RIqhWyJc0VO4FgB//Q0rdg 3uCcgr0UGMH6yJOKLcw== X-Proofpoint-GUID: 6ynn6zTurv-YMbTbw_cOlOZjvC05rxAr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 On platforms with dual vcodec cores, select the hardware core for a session based on current load. Assign the session to vcodec0 if its MBPF/MBPS capacity allows it, otherwise assign to vcodec1. Communicate the selected core to firmware using the new HFI_PROP_CORE_ID property. 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 + .../platform/qcom/iris/iris_platform_common.h | 1 + drivers/media/platform/qcom/iris/iris_power.c | 11 ++- drivers/media/platform/qcom/iris/iris_utils.c | 91 +++++++++++++++++-= ---- drivers/media/platform/qcom/iris/iris_vb2.c | 4 + drivers/media/platform/qcom/iris/iris_vidc.c | 6 +- 12 files changed, 129 insertions(+), 23 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_common.c b/drivers/media= /platform/qcom/iris/iris_common.c index 7f1c7fe144f7..3b3fc482e194 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_command_ops *hfi_ops =3D inst->core->hfi_ops; + + if (!inst->core->iris_platform_data->dual_core) + 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_command_ops *hfi_ops =3D inst->core->hfi_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 b396c8cf595e..54a8649841e4 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -30,6 +30,11 @@ enum domain_type { DECODER =3D BIT(1), }; =20 +enum iris_vcodec_core_id { + IRIS_VCODEC0 =3D 1, + IRIS_VCODEC1, +}; + /** * struct iris_core - holds core parameters valid for all instances * diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.h b/drivers/m= edia/platform/qcom/iris/iris_hfi_common.h index 3edb5ae582b4..fbaf852a6b99 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_common.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.h @@ -124,6 +124,7 @@ struct iris_hfi_command_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 iris_hfi_response_ops { 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 30bfd90d423b..9d9fae587297 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c @@ -1300,6 +1300,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_command_ops iris_hfi_gen2_command_ops =3D { .sys_init =3D iris_hfi_gen2_sys_init, .sys_image_version =3D iris_hfi_gen2_sys_image_version, @@ -1317,6 +1335,7 @@ static const struct iris_hfi_command_ops iris_hfi_gen= 2_command_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 void iris_hfi_gen2_command_ops_init(struct iris_core *core) 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 cecf771c55dd..600e9dc07669 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 16965150f427..dd341ca5be57 100644 --- a/drivers/media/platform/qcom/iris/iris_instance.h +++ b/drivers/media/platform/qcom/iris/iris_instance.h @@ -37,6 +37,7 @@ struct iris_fmt { * * @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 * @ctx_q_lock: lock to serialize queues related ioctls * @lock: lock to seralise forward and reverse threads @@ -79,6 +80,7 @@ struct iris_fmt { struct iris_inst { struct list_head list; struct iris_core *core; + u32 core_id; u32 session_id; struct mutex ctx_q_lock;/* lock to serialize queues related ioctls */ struct mutex lock; /* lock to serialize forward and reverse threads */ diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index 8995136ad29e..502d7099085c 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -258,6 +258,7 @@ struct iris_platform_data { const struct tz_cp_config *tz_cp_config_data; u32 tz_cp_config_data_size; u32 core_arch; + bool dual_core; u32 hw_response_timeout; struct ubwc_config_data *ubwc_config; u32 num_vpp_pipe; diff --git a/drivers/media/platform/qcom/iris/iris_power.c b/drivers/media/= platform/qcom/iris/iris_power.c index 91aa21d4070e..0e116c63f529 100644 --- a/drivers/media/platform/qcom/iris/iris_power.c +++ b/drivers/media/platform/qcom/iris/iris_power.c @@ -77,9 +77,9 @@ static int iris_vote_interconnects(struct iris_inst *inst) =20 static int iris_set_clocks(struct iris_inst *inst) { + u64 vcodec0_freq =3D 0, vcodec1_freq =3D 0; struct iris_core *core =3D inst->core; struct iris_inst *instance; - u64 freq =3D 0; int ret; =20 mutex_lock(&core->lock); @@ -87,11 +87,14 @@ static int iris_set_clocks(struct iris_inst *inst) if (!instance->max_input_data_size) continue; =20 - freq +=3D instance->power.min_freq; + if (instance->core_id =3D=3D IRIS_VCODEC0) + vcodec0_freq +=3D instance->power.min_freq; + else if (instance->core_id =3D=3D IRIS_VCODEC1) + vcodec1_freq +=3D instance->power.min_freq; } =20 - core->power.clk_freq =3D freq; - ret =3D iris_opp_set_rate(core->dev, freq); + core->power.clk_freq =3D vcodec0_freq > vcodec1_freq ? vcodec0_freq : vco= dec1_freq; + ret =3D iris_opp_set_rate(core->dev, core->power.clk_freq); mutex_unlock(&core->lock); =20 return ret; diff --git a/drivers/media/platform/qcom/iris/iris_utils.c b/drivers/media/= platform/qcom/iris/iris_utils.c index cfc5b576ec56..add57632fdbf 100644 --- a/drivers/media/platform/qcom/iris/iris_utils.c +++ b/drivers/media/platform/qcom/iris/iris_utils.c @@ -90,40 +90,95 @@ struct iris_inst *iris_get_instance(struct iris_core *c= ore, u32 session_id) return NULL; } =20 +static u32 iris_get_mbps(struct iris_inst *inst) +{ + u32 fps =3D max(inst->frame_rate, inst->operating_rate); + + return iris_get_mbpf(inst) * fps; +} + +static void iris_get_core_load(struct iris_core *core, u32 *core_load, u32= *core_session, bool mbpf) +{ + bool dual_core =3D core->iris_platform_data->dual_core; + struct iris_inst *inst; + u32 load; + + core_load[0] =3D 0; + core_load[1] =3D 0; + core_session[0] =3D 0; + core_session[1] =3D 0; + + list_for_each_entry(inst, &core->instances, list) { + if (mbpf) + load =3D iris_get_mbpf(inst); + else + load =3D iris_get_mbps(inst); + + if (inst->core_id =3D=3D IRIS_VCODEC0) { + core_load[0] +=3D load; + core_session[0]++; + } else if (dual_core && inst->core_id =3D=3D IRIS_VCODEC1) { + core_load[1] +=3D load; + core_session[1]++; + } + } +} + +static int iris_select_core_id(struct iris_inst *inst, u32 *core_load, u32= *core_session, + u32 max_load, u32 new_load) +{ + u32 max_session =3D inst->core->iris_platform_data->max_session_count; + bool dual_core =3D inst->core->iris_platform_data->dual_core; + u32 core_index; + + core_index =3D (core_load[0] > core_load[1] && dual_core) ? 1 : 0; + + if (core_session[core_index] >=3D max_session) + core_index =3D core_index =3D=3D 0 && dual_core ? 1 : 0; + + if (core_session[core_index] >=3D max_session) + return -ENOMEM; + + if (core_load[core_index] + new_load <=3D max_load) + inst->core_id =3D core_index =3D=3D 0 ? IRIS_VCODEC0 : IRIS_VCODEC1; + else + return -ENOMEM; + + return 0; +} + int iris_check_core_mbpf(struct iris_inst *inst) { + u32 max_core_mbpf =3D inst->core->iris_platform_data->max_core_mbpf; + u32 core_mbpf[2], core_session[2], new_mbpf; struct iris_core *core =3D inst->core; - struct iris_inst *instance; - u32 total_mbpf =3D 0; + int ret; =20 mutex_lock(&core->lock); - list_for_each_entry(instance, &core->instances, list) - total_mbpf +=3D iris_get_mbpf(instance); + inst->core_id =3D 0; + iris_get_core_load(inst->core, core_mbpf, core_session, true); + new_mbpf =3D iris_get_mbpf(inst); + ret =3D iris_select_core_id(inst, core_mbpf, core_session, max_core_mbpf,= new_mbpf); mutex_unlock(&core->lock); =20 - if (total_mbpf > core->iris_platform_data->max_core_mbpf) - return -ENOMEM; - - return 0; + return ret; } =20 int iris_check_core_mbps(struct iris_inst *inst) { + u32 max_core_mbps =3D inst->core->iris_platform_data->max_core_mbps; + u32 core_mbps[2] =3D {0, 0}, core_session[2], new_mbps; 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; - } + inst->core_id =3D 0; + iris_get_core_load(inst->core, core_mbps, core_session, false); + new_mbps =3D iris_get_mbps(inst); + ret =3D iris_select_core_id(inst, core_mbps, core_session, max_core_mbps,= new_mbps); mutex_unlock(&core->lock); =20 - if (total_mbps > core->iris_platform_data->max_core_mbps) - return -ENOMEM; - - return 0; + return ret; } =20 bool is_rotation_90_or_270(struct iris_inst *inst) diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/pl= atform/qcom/iris/iris_vb2.c index bf0b8400996e..5a05f7d65501 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 bd38d84c9cc7..eb167cede4c0 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) { + u32 max_session_count =3D inst->core->iris_platform_data->max_session_cou= nt; struct iris_core *core =3D inst->core; struct iris_inst *iter; u32 count =3D 0; =20 + if (inst->core->iris_platform_data->dual_core) + max_session_count *=3D 2; + 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); --=20 2.34.1 From nobody Wed Jun 17 05:14:06 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 6CB8133CE92 for ; Tue, 28 Apr 2026 03:57:15 +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=1777348638; cv=none; b=FJqrFBvCWpT+Da9n8iBYlWhNV5F6PSdUaZIMGZwFe5QORgxXWklZVAYtBh86HFrpNO5eKc4g9CK6SqXKMVUixnP2eM6OKXmWuCLnlYgy89sFI7RGmndNld4JMk11zTR405SzAsE/TeGNgXC4XIHMlt/am3zRkweAatVFwX6i71Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348638; c=relaxed/simple; bh=eBXnQuFL4Y8EjeFKsamwp6cgODxDmmVNs+6QFeP4c0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E4AshC4qOE6gm0ee6PGLxOIR/PthPKUWyry31A4fOs41BTdjGKwGcxCohOI7uehnOpoih43boUu1kDkRNg7iRorA3cLV2X6pxAIgb+SlmWvcvwoHd1b8WvhK0KqM2WU6fqb9D5PepgvAxyqp/eNNo84cWPvHt5jJ7X/H715w9jw= 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=F11WfH9c; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PP5m5NJ5; 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="F11WfH9c"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PP5m5NJ5" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63RNj53R3760682 for ; Tue, 28 Apr 2026 03:57:14 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= XDmw26Q3qyUOQUPkgP4GXTOsJczj9aJju5twJhlyLaw=; b=F11WfH9c4CSvd5Z4 VFO/bNldGitbuv9AS3HWDVgS6fKIHlFYfiy7cIS3feoiUHPufDp54mycIGvaSu3g rh2EpZVyfqRPPhR0kTg0voT/OyX8lIy5hQrZD8FoY4Klgao8iLtW0QsdtMCh16yw X8zYCl7B65dfyQ9fgIpA2w2cFJTaWGYEe0fbfpCCCfvmGYbp5lxtOz7Peoo7irKs YxU7ha/btYOPDYjhJr7qHLClEGdUDxjpTUcyYj7lwb5eH6Z0qiBxnYcRXJ5/Y4mS Jgfs9LFYOo5G+DEsmi9r/pU4qefPwtE319bCik49IshW5GXCHmRPcUw78Dm4PiJ9 KVnEDQ== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dtacdtgjm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:57:14 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-3568090851aso25977246a91.1 for ; Mon, 27 Apr 2026 20:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348634; x=1777953434; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XDmw26Q3qyUOQUPkgP4GXTOsJczj9aJju5twJhlyLaw=; b=PP5m5NJ5hYzZMM5TNt5Bx5p8QCBkIdXIY7P33omK7fql9BoVyuzZshHyjKC4V3i7eX bt4I0dbBHJIOzBAZFzBTaiMR3dbEfvlf/KaMCaFbGo3ReRUx+5wfwJcwr7OcRLGEAGn8 RVe5JpApR2VTfXc6CxiRN/CdYOIhnxdbqkQ+C3axg678tlL4kX2jfOU/QK+6Dj0xCj0h ZSjjyOfLfYoIhEz+4FPdCXMlSAFW7lQy+wCHu4VItFKkAgLlaT43kqOXSsj3EEWJnYkc zFrQ7JU1jEzZvkmv+/wr74HnYoZ4vChABcO94UcrGFN9PDpdQtEN+bIE46+/VYk/GFNw 6/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348634; x=1777953434; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=XDmw26Q3qyUOQUPkgP4GXTOsJczj9aJju5twJhlyLaw=; b=axPZ6WlWIkIjyYw7f25sJxpUX/MgkQYbEOO8geT6a1DiyALsFYdxNX5FIItKfLiWgs cu/wRDp28sz19dQlZ7sw3hTvzW+tjZnYPL5Y4XRytcOAS8QzCoJhHnkZGXpoGgcCj8zB cJpZJPR6cdKUoUQzsPRlFPmDdU2dNW0KgP2PhDWvo1laHOJFyfgdnGRuQ11eSxYn/S9s 496lLHeGUuO/LKihEOZp4sY2rF/rWfv7mbqX9lfVoNwGqEo1Wx/GNk//REbIVR72rcP7 qtivqqStrrCuZXmAwDI5sZqV4NlHVuCO61rQ7mdk3OVMoLnrZqiLXWms8oM+emC9/JCB +M+g== X-Forwarded-Encrypted: i=1; AFNElJ823BalcBliDJtkkUacIlLFE1NZio1g9km/kL4Tegk+6f8nZJL+lQ63oMgEA2F77WuuTRtwb2gD96QZqdg=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4OEjbkihJ5t9/+g9TTEM/FcBEnHIwIILqDvm/qXa2+J8mPSvo cvUdwPBVIEf39zBjz+A4Qxava/oznSe0YsmkCFINekWOLuuXrmPUxjlFWb54WlL4PbocyQ/bHhZ hURBi57xYgEWm1VG9BubMBWbEQNikAdB+9OB5zqdTOGvQ3B98uePzTZuT9yMcJVga2NM= X-Gm-Gg: AeBDietiPDnEEX05gSotZwlUWRJrj9/4B385Bs/t2oF/VczHdlUDex882zJtUL6Yqom HFInUrQeMkMQ68+B8Tsu/KmvcvJFAP4fXRpkU+IElGmS2TLEprOL9JtQgfZQKMO8UuEYG2EZOn7 MhPCQZo9b4Wq1oyaKvHxdj6EmAoKjtIWp7DgOv0idAf1iPWIuJyu+nEq7OcHjCsAWn7IT2D23eW RoXt0OrSm+OG6zZGVjd06PrNoT+b09mNFWnWMM3B/BQ5knvNAHtFckBVjmxex2T4NddXu+LRpKZ tnt6ae1LViQX23De/GxY84pwps1n6trNsUhFI5tdG34G57QMS7Rp0uwXqMYesQF+X3G07Tkpszp EDnDZyjJ149fgPI6FuIN3gnsnVtEoweVoqqik///6ALFW/wABFlbjtTpqM2Y5D6AAGQ== X-Received: by 2002:a17:90a:d88f:b0:35b:8d89:719b with SMTP id 98e67ed59e1d1-36491fad396mr1426500a91.1.1777348633782; Mon, 27 Apr 2026 20:57:13 -0700 (PDT) X-Received: by 2002:a17:90a:d88f:b0:35b:8d89:719b with SMTP id 98e67ed59e1d1-36491fad396mr1426456a91.1.1777348633238; Mon, 27 Apr 2026 20:57:13 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:57:12 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:17 +0530 Subject: [PATCH v3 11/12] 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: <20260428-glymur-v3-11-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=11563; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=eBXnQuFL4Y8EjeFKsamwp6cgODxDmmVNs+6QFeP4c0k=; b=J/5lUfhrVOFCjPrzrjIOfDHK4l/TnX093La9U6v4rDAvNwkvPOv8wkVeVvKpDv3DRV4x54Gbg nWPDNrwMrVBBwD8OBFwROEcvzrirhfJBeIDdHs4cRzz5GAKjTqky5zU X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX/3XDALWz/q1l yn4eTsTmatDLcIOGn2kzMmMNv7I7AzbO8kjl7Y1I+YKeXHEMydxKAtAeSbwdYYBlGNxV5xv6NJp r9yWWiXeipJO+vP6Bd15h62Xl2tLoAxDJtobTtOzjt5qhMJOJ/TH2PVW+QwnBqSd2Z+Uf3zoC04 Pdj+0/3Uyhs+uDDBQsGLWICu+ZSqKbbyPuDvoVMNVST7ItGmp8KdD+4n1Eh3/Aus06/kjNx+kCr az79bCjNUtLf2QGLeDqIweOkQkNwlHzNpOglYOcuBaj7SNBkEFhrtBOQrbw2YLwSTrn4QOGuSGI NeKRqiqVVBgS8sAvIOh9CMzXS6q1Ob/dF75CDSavq9l7VI3l9C8ABlyLtP5V6CiYJHY9BiQyFdu GuuCu05j0ndv5/bKVlHFY5M8sMxaAnLXPBDtd+JCU+vRzCNHBN8q0aHKrDzGDYNUbDfPs+XpwEd rwC4c5zFq1UJ+tK6Eqg== X-Authority-Analysis: v=2.4 cv=QsduG1yd c=1 sm=1 tr=0 ts=69f0301a cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=syK4oCsQgbaUnHKzOKsA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: O0mcPzTzykuY6EVAXZ37rPloYj4rdw4o X-Proofpoint-ORIG-GUID: O0mcPzTzykuY6EVAXZ37rPloYj4rdw4o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 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. Signed-off-by: Vishnu Reddy --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 5 ++ .../media/platform/qcom/iris/iris_platform_gen2.c | 99 ++++++++++++++++++= ++++ .../platform/qcom/iris/iris_platform_glymur.c | 97 ++++++++++++++++++= +++ .../platform/qcom/iris/iris_platform_glymur.h | 17 ++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 + 6 files changed, 223 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 6f4052b98491..677513c7c045 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -11,6 +11,7 @@ qcom-iris-objs +=3D iris_buffer.o \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ iris_platform_gen2.o \ + iris_platform_glymur.o \ iris_power.o \ iris_probe.o \ iris_resources.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 502d7099085c..2003b7186480 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -30,6 +30,10 @@ struct iris_inst; #define DEFAULT_QP 20 #define BITRATE_DEFAULT 20000000 =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, @@ -41,6 +45,7 @@ enum pipe_type { PIPE_4 =3D 4, }; =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_gen2.c b/driver= s/media/platform/qcom/iris/iris_platform_gen2.c index 5862c89a4971..d11c9d1ce6b1 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c @@ -12,6 +12,7 @@ #include "iris_vpu_buffer.h" #include "iris_vpu_common.h" =20 +#include "iris_platform_glymur.h" #include "iris_platform_qcs8300.h" #include "iris_platform_sm8650.h" #include "iris_platform_sm8750.h" @@ -931,6 +932,104 @@ static const u32 sm8550_enc_op_int_buf_tbl[] =3D { BUF_SCRATCH_2, }; =20 +const struct iris_platform_data glymur_data =3D { + .get_instance =3D iris_hfi_gen2_get_instance, + .init_hfi_command_ops =3D iris_hfi_gen2_command_ops_init, + .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, + .get_vpu_buffer_size =3D iris_vpu_buf_size, + .vpu_ops =3D &iris_vpu36_ops, + .set_preset_registers =3D iris_set_sm8550_preset_registers, + .init_cb_devs =3D iris_glymur_init_cb_devs, + .deinit_cb_devs =3D iris_glymur_deinit_cb_devs, + .icc_tbl =3D sm8550_icc_table, + .icc_tbl_size =3D ARRAY_SIZE(sm8550_icc_table), + .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 sm8550_bw_table_dec, + .bw_tbl_dec_size =3D ARRAY_SIZE(sm8550_bw_table_dec), + .pmdomain_tbl =3D &iris_glymur_pmdomain_table, + .opp_pd_tbl =3D sm8550_opp_pd_table, + .opp_pd_tbl_size =3D ARRAY_SIZE(sm8550_opp_pd_table), + .clk_tbl =3D iris_glymur_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(iris_glymur_clk_table), + .opp_clk_tbl =3D iris_glymur_opp_clk_table, + /* Upper bound of DMA address range */ + .dma_mask =3D 0xffe00000 - 1, + .fwname =3D "qcom/vpu/vpu36_p4_s7.mbn", + .pas_id =3D IRIS_PAS_ID, + .dual_core =3D true, + .inst_iris_fmts =3D platform_fmts_sm8550_dec, + .inst_iris_fmts_size =3D ARRAY_SIZE(platform_fmts_sm8550_dec), + .inst_caps =3D &platform_inst_cap_sm8550, + .inst_fw_caps_dec =3D inst_fw_cap_sm8550_dec, + .inst_fw_caps_dec_size =3D ARRAY_SIZE(inst_fw_cap_sm8550_dec), + .inst_fw_caps_enc =3D inst_fw_cap_sm8550_enc, + .inst_fw_caps_enc_size =3D ARRAY_SIZE(inst_fw_cap_sm8550_enc), + .tz_cp_config_data =3D iris_glymur_tz_cp_config, + .tz_cp_config_data_size =3D ARRAY_SIZE(iris_glymur_tz_cp_config), + .core_arch =3D VIDEO_ARCH_LX, + .hw_response_timeout =3D HW_RESPONSE_TIMEOUT_VALUE, + .ubwc_config =3D &ubwc_config_sm8550, + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D NUM_MBS_8K * 2, + .max_core_mbps =3D ((8192 * 4320) / 256) * 60, + .dec_input_config_params_default =3D + sm8550_vdec_input_config_params_default, + .dec_input_config_params_default_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_params_default), + .dec_input_config_params_hevc =3D + sm8550_vdec_input_config_param_hevc, + .dec_input_config_params_hevc_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_param_hevc), + .dec_input_config_params_vp9 =3D + sm8550_vdec_input_config_param_vp9, + .dec_input_config_params_vp9_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_param_vp9), + .dec_input_config_params_av1 =3D + sm8550_vdec_input_config_param_av1, + .dec_input_config_params_av1_size =3D + ARRAY_SIZE(sm8550_vdec_input_config_param_av1), + .dec_output_config_params =3D + sm8550_vdec_output_config_params, + .dec_output_config_params_size =3D + ARRAY_SIZE(sm8550_vdec_output_config_params), + + .enc_input_config_params =3D + sm8550_venc_input_config_params, + .enc_input_config_params_size =3D + ARRAY_SIZE(sm8550_venc_input_config_params), + .enc_output_config_params =3D + sm8550_venc_output_config_params, + .enc_output_config_params_size =3D + ARRAY_SIZE(sm8550_venc_output_config_params), + + .dec_input_prop =3D sm8550_vdec_subscribe_input_properties, + .dec_input_prop_size =3D ARRAY_SIZE(sm8550_vdec_subscribe_input_propertie= s), + .dec_output_prop_avc =3D sm8550_vdec_subscribe_output_properties_avc, + .dec_output_prop_avc_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_avc), + .dec_output_prop_hevc =3D sm8550_vdec_subscribe_output_properties_hevc, + .dec_output_prop_hevc_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_hevc), + .dec_output_prop_vp9 =3D sm8550_vdec_subscribe_output_properties_vp9, + .dec_output_prop_vp9_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9), + .dec_output_prop_av1 =3D sm8550_vdec_subscribe_output_properties_av1, + .dec_output_prop_av1_size =3D + ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_av1), + + .dec_ip_int_buf_tbl =3D sm8550_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl =3D sm8550_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_dec_op_int_buf_tbl), + + .enc_ip_int_buf_tbl =3D sm8550_enc_ip_int_buf_tbl, + .enc_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_enc_ip_int_buf_tbl), + .enc_op_int_buf_tbl =3D sm8550_enc_op_int_buf_tbl, + .enc_op_int_buf_tbl_size =3D ARRAY_SIZE(sm8550_enc_op_int_buf_tbl), +}; + const struct iris_platform_data sm8550_data =3D { .get_instance =3D iris_hfi_gen2_get_instance, .init_hfi_command_ops =3D iris_hfi_gen2_command_ops_init, 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..72a6e3fcfdeb --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.c @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include +#include +#include "iris_core.h" +#include "iris_platform_common.h" +#include "iris_platform_glymur.h" + +const struct platform_clk_data iris_glymur_clk_table[] =3D { + {IRIS_AXI_VCODEC_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_VCODEC_CLK, "vcodec0_core" }, + {IRIS_AXI_CTRL_CLK, "iface1" }, + {IRIS_CTRL_FREERUN_CLK, "core_freerun" }, + {IRIS_VCODEC_FREERUN_CLK, "vcodec0_core_freerun" }, + {IRIS_AXI_VCODEC1_CLK, "iface2" }, + {IRIS_VCODEC1_CLK, "vcodec1_core" }, + {IRIS_VCODEC1_FREERUN_CLK, "vcodec1_core_freerun" }, +}; + +const char * const iris_glymur_clk_reset_table[] =3D { + "bus0", + "bus1", + "core", + "vcodec0_core", + "bus2", + "vcodec1_core", +}; + +const char * const iris_glymur_opp_clk_table[] =3D { + "vcodec0_core", + "vcodec1_core", + "core", + NULL, +}; + +const struct platform_pd_data iris_glymur_pmdomain_table =3D { + .pd_types =3D (enum platform_pm_domain_type []) { + IRIS_CTRL_POWER_DOMAIN, + IRIS_VCODEC_POWER_DOMAIN, + IRIS_VCODEC1_POWER_DOMAIN, + }, + .pd_names =3D (const char *[]) { + "venus", + "vcodec0", + "vcodec1", + }, + .pd_count =3D 3, +}; + +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, + }, +}; + +int iris_glymur_init_cb_devs(struct iris_core *core) +{ + u64 dma_mask =3D core->iris_platform_data->dma_mask; + const u32 f_id =3D IOMMU_FID_IRIS_FIRMWARE; + struct device *dev; + + dev =3D create_iris_vpu_bus_device(core->dev, "iris-firmware", dma_mask, = &f_id); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + if (device_iommu_mapped(dev)) + core->fw_dev =3D dev; + else + device_unregister(dev); + + return 0; +} + +void iris_glymur_deinit_cb_devs(struct iris_core *core) +{ + if (core->fw_dev) + device_unregister(core->fw_dev); +} 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..e0d07ccf658c --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_glymur.h @@ -0,0 +1,17 @@ +/* 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 platform_clk_data iris_glymur_clk_table[9]; +extern const char * const iris_glymur_clk_reset_table[6]; +extern const char * const iris_glymur_opp_clk_table[4]; +extern const struct platform_pd_data iris_glymur_pmdomain_table; +extern const struct tz_cp_config iris_glymur_tz_cp_config[3]; +int iris_glymur_init_cb_devs(struct iris_core *core); +void iris_glymur_deinit_cb_devs(struct iris_core *core); + +#endif /* __IRIS_PLATFORM_GLYMUR_H__ */ diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 34c981be9bc1..78e3627557e9 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -369,6 +369,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 Wed Jun 17 05:14:06 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 ECEC933EB01 for ; Tue, 28 Apr 2026 03:57:21 +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=1777348643; cv=none; b=WP3VRD1mspQWqRxKRONHXLiUC5l3BKpPHy3rMv+bOS7vCaxl3EN9AQpVORhnZOg87uh9TuxqWFff1dvBDfPASgjoyfaQ9bQysJNxOEHZWrkd83Sm2Umzy24vqVd+jYV3V1kyjj7/Z5Ra9/tpJNvC6yC+2Ep5ukQRvkf3oVuLwFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777348643; c=relaxed/simple; bh=AXNNMUqpUBkT37jqrWXRRraxt0+yVQz0nuc5i48FDy0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S16f+H0EDkkfOl2hd+jSjZmhQDdZWiYRDbWkL+SAFozXbpmDvPQc1ysQq6xzUkbHkoZwFN2l6oG2xYYDbtvDQGfg+T+aAiwswUyY5gYZQUrEz7rs/ebrj4xVtkmc+8RZQrp+W0wY3kPJnHOzISdPoglVcueGDybrV1BPvv21F+Y= 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=YA/bPEqT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=APSC8ApT; 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="YA/bPEqT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="APSC8ApT" 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 63RK0mNG2383087 for ; Tue, 28 Apr 2026 03:57:21 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= MZLUyV0TSMl/0FUp0kbCXsS7r5z0r4oRuVSRhSVL+wo=; b=YA/bPEqTPpaqy6z+ L/onEJNoGCRkZAY2mJtVMUPZScgQGh7S9TriNAYK5BnzSn6Lv67oc1gJcVAWAbO5 njI0X09HDSZ8uMSrVYUgV10xsF9kJAoQjntHGi5xKeVd9Zb9UbIOP/q4PD91pxOr I8IkPnUt0PFCS93kc6IY8M5JxCXjkdnndMFSDXJvt11ngNEsjsq8F3B2yJNOo6dA /QbzGH1ux/XkSS9SrcZOsqhZAHrM0gAokerNkQm2eesRkStzusC14BmH8G9YCb/F eCCJIXnA7aUl3q02PgvcIKZhO71QJo+uBLGPnU6KPnvBlOcIdb0+quynKtbJmpX7 C3kvJA== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dt85xu4d7-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 28 Apr 2026 03:57:21 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-35fb969a4c0so11856574a91.3 for ; Mon, 27 Apr 2026 20:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777348640; x=1777953440; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=MZLUyV0TSMl/0FUp0kbCXsS7r5z0r4oRuVSRhSVL+wo=; b=APSC8ApT/WxGYaM41KJj+2rNHLys6aH13mwL2EugL5IpeloKsSk9yaB4c+Eo2Q5AQL K7TnIcNxdkLcF4kUbg7gWSm6Wu96vRIdQokVG715OubdYdwzDRg339vVpNK8DKipkor5 SoGHGvbeZLnRUi1atcWrRzxYcCSEX1NJp+4fVHlzDywA35hovwkzTElMsTL6ji48EvNU EA9HM+HTPObMFbbfhBSD+buvp4o5k6Gu2Ai0+9bJnsRQsR2fC3Kf3oKsXMFqFLxx/b69 37K3omAbMpNk8Q3SLnqwAk4dJ2og7FrvApBq4ZQWLpaJi7+1jKpLEKsiNKlB8GTyMyAR hNQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777348640; x=1777953440; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=MZLUyV0TSMl/0FUp0kbCXsS7r5z0r4oRuVSRhSVL+wo=; b=A22LS4px9/P/Bjo0X4TkxwfiFOI5ACYyp/hhns6pJJCzJDKWIecUMkzyHEX+ezN1NZ QZIbSChbNciXnELvZSlBCod6DPKeESNuM65NW+JeHnVZlRs/VB1RlJVD7q1D0Iva/c12 IfPrBDdxpZ0lt432fJor1zbNZpYceKhc+ZF9iih0AYLeN7LaugFExIWid9CZ9/HcX6IO 6q4WnQBR2JNjmQzNorNyHs88xtjrVrzQiRr+UFcBm3GR0ebcMM13eieCjwPbMzsBy/6k OI3eHyAisPObvp+s2grQdLZWcgBxvgv57nIS34Yhjx9s0fzpt9B6g2VFz8ZDNFFQzxdY cXFw== X-Forwarded-Encrypted: i=1; AFNElJ9OPsN33/jH4n17ZB4leMVFPBiJ0M+JQK2ezLMM7d2VVIm1PQwZTo+H5CY63NrebgAyfFftMpLXdC5gKzg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxw7oZNMFG4SrN5XVTxpu8aTvQwwU/YeVNJsTNBxssF5oyb9k0D 31Ea5Af7VL9eSdqW8c3dt3NTLPJrU5wLnXpJ8E63QKxrTsxyz3NtZzUGGjv/JLBq8yfYOoXOgk2 ntTbnN+FXpXXJD8jEMNFBHeBo7oDb6+pQ7YopkzICynEav8X/Ww6Kb0wKeRdaThTYjhE= X-Gm-Gg: AeBDiesUgFFryTCz88jFbOB7ZAwSDV6mjjtqkRCRGxrQ7ETI1RTRchO2KGBLB/fnsTl rgy19c9kspvnZz/TyM54VALZ6qiH02XFGo9ibcSGyKzpGyJhILzSZjSAVX4Elavhi3jwgHGnx1o Aou+n4KlM/2pPJcgXpvPGkHn0vLOT1daU5F2Jee0SMKBONQFam5F4dczCUism/MAdoYkF12+gDx x6oxq/boIufnyO15BvmhJbs7yHfJVjeUM99C6RJfoD1cPtqTi4rt+JI8Y2Q6h65hHCZQZh7XUTE Tiz1mbXTuThqdTheEA5+AcWHuBaXmE3uhbbJdUUWcZzCKD34jDxBosVsrrLB396eJ5IUbSFXKJ2 10cTbW/7xoIVSFToPnx0pzQ6nsOaus51N2ixsvvQIWL1U4za3alDi5DmfBVv7MWW2XA== X-Received: by 2002:a17:90b:2fc8:b0:35d:a6eb:197f with SMTP id 98e67ed59e1d1-36491c9acd5mr1465235a91.0.1777348640520; Mon, 27 Apr 2026 20:57:20 -0700 (PDT) X-Received: by 2002:a17:90b:2fc8:b0:35d:a6eb:197f with SMTP id 98e67ed59e1d1-36491c9acd5mr1465203a91.0.1777348640047; Mon, 27 Apr 2026 20:57:20 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36490905648sm393888a91.4.2026.04.27.20.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2026 20:57:19 -0700 (PDT) From: Vishnu Reddy Date: Tue, 28 Apr 2026 09:24:18 +0530 Subject: [PATCH v3 12/12] 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: <20260428-glymur-v3-12-8f28930f47d3@oss.qualcomm.com> References: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> In-Reply-To: <20260428-glymur-v3-0-8f28930f47d3@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Joerg Roedel , Will Deacon , Robin Murphy , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vishnu Reddy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777348550; l=5015; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=AXNNMUqpUBkT37jqrWXRRraxt0+yVQz0nuc5i48FDy0=; b=jCv+PEapELXi7ne+BCnuDA2WWT9hw+wlEpU7KBCcLutA434msVkBuNG4JIiYmwnRaklsyFYiH 7yEBqBuPVHSDxOIWwnORTxSU3ljylISTZPXCnybuoM0HVCf/yxNAOyb X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=Zs3d7d7G c=1 sm=1 tr=0 ts=69f03021 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=VYrRtalYO0MCCBblpesA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-ORIG-GUID: rf398nyQDq1u_w-lUSIyccKz8UaR7gv3 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI4MDAzMyBTYWx0ZWRfX3ttvZ/kBnj+T OLlV+E3z/A3yf7WK9UBy/Z5Hj5wFpiWLP2qiV7TyzAazRPLlabvMppdA7p+9FFAzxTfNpD7p73i e7+0+zGhs974NP3KvFlNOhmpL0mmRSXtZ3C29HMZf66ZdTCri5vi1Y4/PFeReQD7Yh7m+v146Sg mTlZaBy8mTnslY3MmnrDMNy3n7RB//27MoQxGjOwBKnnAtJOz9YPr5WQIPF9pprf+bPdDT+5/U/ Ko2Xy9zuwq3+Ba3o6RnjOxJxEyDZpr463G0P2+nHlwBqN2JQuqB8rBoA2Vxr0tB4GXdUrbApzJR 2Y/NEVhTrWQ5iC5vYvAee01zg3gDGfOMWNTBV5kwIJanL6cMVIiAjJ0CS/UebUp4BTMEjg9gInm fPnsdAUYRs7pYR4n+LPjksEVCw/HAbRv3RQZt6Nq3TOk7TU6Di/jQosbzaqMo5lq3gvwyT+8c9O UGXbacGr+tW5LoFNuyg== X-Proofpoint-GUID: rf398nyQDq1u_w-lUSIyccKz8UaR7gv3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-27_04,2026-04-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604280033 Add iris video codec to glymur SoC, which comes with significantly different powering up sequence than previous platforms, thus different clocks and resets. Signed-off-by: Vishnu Reddy --- arch/arm64/boot/dts/qcom/glymur-crd.dts | 4 ++ arch/arm64/boot/dts/qcom/glymur.dtsi | 118 ++++++++++++++++++++++++++++= ++++ 2 files changed, 122 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/glymur-crd.dts b/arch/arm64/boot/dts/= qcom/glymur-crd.dts index 35aaf09e4e2b..cbc9856956ff 100644 --- a/arch/arm64/boot/dts/qcom/glymur-crd.dts +++ b/arch/arm64/boot/dts/qcom/glymur-crd.dts @@ -255,6 +255,10 @@ &mdss_dp3_phy { status =3D "okay"; }; =20 +&iris { + status =3D "okay"; +}; + &pmh0110_f_e0_gpios { misc_3p3_reg_en: misc-3p3-reg-en-state { pins =3D "gpio6"; diff --git a/arch/arm64/boot/dts/qcom/glymur.dtsi b/arch/arm64/boot/dts/qco= m/glymur.dtsi index f23cf81ddb77..c47443174f97 100644 --- a/arch/arm64/boot/dts/qcom/glymur.dtsi +++ b/arch/arm64/boot/dts/qcom/glymur.dtsi @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -4163,6 +4164,123 @@ usb_mp: usb@a400000 { status =3D "disabled"; }; =20 + iris: video-codec@aa00000 { + compatible =3D "qcom,glymur-iris"; + reg =3D <0x0 0xaa00000 0x0 0xf0000>; + + clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>, + <&gcc GCC_VIDEO_AXI0C_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 "iface", + "core", + "vcodec0_core", + "iface1", + "core_freerun", + "vcodec0_core_freerun", + "iface2", + "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 ; + + iommus =3D <&apps_smmu 0x1940 0x0>, + <&apps_smmu 0x1943 0x0>, + <&apps_smmu 0x1944 0x0>, + <&apps_smmu 0x19e0 0x0>; + + iommu-map =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_AXI0_CLK_ARES>, + <&gcc GCC_VIDEO_AXI0C_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 "bus0", + "bus1", + "core", + "vcodec0_core", + "bus2", + "vcodec1_core"; + + /* + * IRIS firmware is signed by vendors, only + * enable on boards where the proper signed firmware + * is available. + */ + status =3D "disabled"; + + 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>; + }; + }; + }; + mdss: display-subsystem@ae00000 { compatible =3D "qcom,glymur-mdss"; reg =3D <0x0 0x0ae00000 0x0 0x1000>; --=20 2.34.1