From nobody Thu Oct 9 04:50:06 2025 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 0C82A30E837; Fri, 20 Jun 2025 06:21: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=1750400495; cv=none; b=AYrDo5z7dxf0cYUltOR/f7yL2FgreIexnLjZfwotec8spUngc9wrkDS59641tyQDWqPgRY6kA3oI95E/BFxDop79YMR4k0er92jkfXlvQsZt5S3uynOGIvstXyQe1unzr8F0QglNg7E/9VzvxuABouSXwkc4j5QjdscDnmlodxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400495; c=relaxed/simple; bh=5JbCcV3BJfx/Xm/lqtqP8TEaR7KOehOa40rnp0JfL0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=XnFWK3zZORHSb2RZv7nGnFUbM4dQ+4g1gGvPDjVkAN94iW2dxjpUWSfnPQDMDFCVQ9zMnaxdfnluvSKd95Pra8jDmRLDUEzHx6I3T9M9Hal4NsM+g6DYLanAlpXzzPIz5WITKKsv+WLXqWSZ8nspmqc2bnAZx7tA5dRbO8FdRRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=CGj/q9KR; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CGj/q9KR" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55JIeZuc004996; Fri, 20 Jun 2025 06:21:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= FpS12xtYv1+mzQnpBw3E4RKi7Ow2hqKC9fSjBZd+U7Y=; b=CGj/q9KRyWmElOfK BDTJ951vMGMGmNDhr11fTnNmvQVwJmEF2VyOsollbPJQBckIbDCdiQjxHcqLY2Y+ NqmYWSv1NbDQjobfOrVMqINOe/8dQXUSFKLAZIfNvB1RXzCNVd3tF43jOo/CBsJm aI/Ti7d7CplVghIfHFSbUvuOqqWN/hifGRyRf58rhOTQdwyag8f+bhLM/yXJkBsV jORm9Kpse01crW1SR1wuxjxIwy/NDDON4aEDWOAtRriWOwXswv3ooZMVox1pffqI cTVkIce+uXj4pGQHcNRWcO0lyA+ij016SEzlMlLVSHeu6WoVd4OWK5CK6y+m9yQK SHbmaw== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47928mt531-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:27 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55K6LRQu023522 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:27 GMT Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 19 Jun 2025 23:21:23 -0700 From: Vikash Garodia Date: Fri, 20 Jun 2025 11:50:51 +0530 Subject: [PATCH 1/5] dt-bindings: media: qcom,sm8550-iris: add non_pixel and resv_region properties 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: <20250620-video_cb-v1-1-9bcac1c8800c@quicinc.com> References: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> In-Reply-To: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750400480; l=2464; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=5JbCcV3BJfx/Xm/lqtqP8TEaR7KOehOa40rnp0JfL0k=; b=q8bTU1cmV7cHC4aZKOregDo5bnsC6xAHV26I0Fce6aGwN9WsyZHNRwY4oAO47vFBuDtr22+hX ZtMTyf052ZGBvuZKYDy5V1dr1vHurquPQ6pKXOKVDIfJeG1sY+NxQVi X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDA0NiBTYWx0ZWRfX49W1uohd05Y1 sXLYDcWS+W0o9raiigjnasYNeqdWgIpduzq7U7eLDebMoi80i1kEJUcGM2HZt3Zp9SNb4tJPPek ZxR1gDC6w0ZNHe2sSZlqxJAx3Qg82r5WxdH4leptDT6j2nvTIzPTbttDAaYkkpNr9CB5NuMiMQ+ FcrwLWhdJVcXgSGGxOTw4RftwRgmTyEnuAMHYCdr7KIR9tFrmzeSK+9a5Pduk4iOZLUhBiZgn/J RybIhe7PZhSyOMUdh010TwYBDOocmEC6FKXIG6C9OzTeTzp4r2itGnTnUd8WfHjyNgCocZFt352 1yuq5EraNIfU7pv2mucHhJ/RXH/VLOtMIenBLk+7ManpJx0jbL2euISu1OLKXgSn9IQjl0eeMFP L+9X6o+xfEK89BU7m2mtEkx3uZ1g6ZHADXjIXmDQPaKHmWBqnCXxnFdSgtNiPWVMNX53uvsC X-Authority-Analysis: v=2.4 cv=fvbcZE4f c=1 sm=1 tr=0 ts=6854fde7 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=E6x5WMc5iwfpEpjNtQEA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: JicO9dGdIASamUJxz-KHbUlU7m28mdEV X-Proofpoint-ORIG-GUID: JicO9dGdIASamUJxz-KHbUlU7m28mdEV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_02,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=658 phishscore=0 clxscore=1011 mlxscore=0 impostorscore=0 adultscore=0 spamscore=0 suspectscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506200046 Existing definition limits the IOVA to an addressable range of 4GiB, and even within that range, some of the space is used by IO registers, thereby limiting the available IOVA to even lesser. Video hardware is designed to emit different stream-ID for pixel and non_pixel buffers, thereby introduce a non_pixel sub node to handle non_pixel stream-ID. With this, both iris and non_pixel device can have IOVA range of 0-4GiB individually. Certain video usecases like higher video concurrency needs IOVA higher than 4GiB. Add the "resv_region" property, which defines reserved IOVA regions that are *excluded* from addressable range. Video hardware generates different stream IDs based on the range of IOVA addresses. Thereby IOVA addresses for firmware and data buffers need to be non overlapping. For ex. 0x0-0x25800000 address range is reserved for firmware stream-ID, while non_pixel (bitstream ) stream-ID can be generated by hardware only when bitstream buffers IOVA address is from 0x25800000-0xe0000000. Signed-off-by: Vikash Garodia --- .../bindings/media/qcom,sm8550-iris.yaml | 35 ++++++++++++++++++= ++++ 1 file changed, 35 insertions(+) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index c79bf2101812d83b99704f38b7348a9f728dff44..a1e83bae3c36f3a4c58b212ef45= 7905e38091b97 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -65,10 +65,45 @@ properties: - const: core =20 iommus: + minItems: 1 maxItems: 2 =20 dma-coherent: true =20 + resv_region: + type: object + additionalProperties: false + + description: + Reserve region specifies regions which should be excluded from IOVA. + + properties: + iommu-addresses: + minItems: 1 + maxItems: 4 + + required: + - iommu-addresses + + non_pixel: + type: object + additionalProperties: false + + description: + Non pixel context bank is needed when video hardware have distinct i= ommus + for non pixel buffers. + + properties: + iommus: + maxItems: 1 + + memory-region: + maxItems: 1 + + required: + - iommus + - memory-region + operating-points-v2: true =20 opp-table: --=20 2.34.1 From nobody Thu Oct 9 04:50:06 2025 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 6938E221715; Fri, 20 Jun 2025 06:21:37 +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=1750400499; cv=none; b=f68CwnmePo/pEDHWCQJe2JessahLX8VGF5JlUbbgIKMGLxJOmQj2QpET3dA1EKzdh1+GbB7/qmU5fwNj/u5EEWAGIE6SOoIZP4zukgyu6DhS2PLv1OiBFcIlT3y0yQh/2R7cCr/aJeRhbdLei2X7m3MUVmMERZl2WUAEs3IrCCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400499; c=relaxed/simple; bh=3N2w2gbNb6zjinpI7X9gyQWnQIkyPQjlVsmeYYz8AEE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=JUWW8RWd4RIpHuyTc9Rs68LMVALTy1PzD7jRh5RxWVVrkkxT08UFSq0PZGH3o6rQyuf3VGLC7e4Ui99zkewR+bYOHDt03BqP1mp23E7EBaJyvnTUxYnM0h/+LMx7hTkcq77afu3pZOUN2lyP/WjD9bsr/GKboEsxfH3gN9ERXaU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=gLtQc5Nh; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gLtQc5Nh" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55JFeTc3024471; Fri, 20 Jun 2025 06:21:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= SaBNQXheq/2f4YnX2sKogMfPUBJSxPPiA6XRcPj7Ab4=; b=gLtQc5Nhoor0AUg7 iscTB4td8aKXm8HRMoNT/kdInoVdXR7MH+RMsx+aGnhU2Kwdx/3jCubuGZ6uYWSw 3+g/F1+ncN3dvW9HiGPG9+KXxrWpWTprfeNGQhJGKYhRLUY0josXsWuCVXhbziCS SIyS12TI5ZgJaD7ezrclvnBETgePjoEJ3HN12LGgWTMi7rNkvKLlTj2fZctT+pB/ gCBiNhAnb2mglOlaZo8NbsJhnTRpvVfdlwA2CKUR6O7giCW5s+i/64BS5X/L2QJN TVQJnZhc/14MWmcRfud1yXjBqurTrch435K4VCXONRCHawfV9hw9jZJVe+Hf1jAv x0OLaA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4792caad3a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:31 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55K6LUp2016867 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:30 GMT Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 19 Jun 2025 23:21:27 -0700 From: Vikash Garodia Date: Fri, 20 Jun 2025 11:50:52 +0530 Subject: [PATCH 2/5] media: iris: register and configure non-pixel node as platform device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <20250620-video_cb-v1-2-9bcac1c8800c@quicinc.com> References: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> In-Reply-To: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750400480; l=3725; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=3N2w2gbNb6zjinpI7X9gyQWnQIkyPQjlVsmeYYz8AEE=; b=f/H7odcotPQjAMuI20lmmXFWjB0hlLvG+sUb93sNAJYyED1sHcMMadiZBei+BA3KgQ+qHT/tT dPJk8gWfSUUCzVcPZQNjjSeP7vIHjcPKEzbtWKGwvh0rHhaVW+VppvG X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: XDhtAjhfsFZsmBdB5ORQEd8GB6AJArXs X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDA0NSBTYWx0ZWRfXzFd81yrNdbBi nuBYhM87OKZefrdACcTRBwgnuJDD0wRmIRSD0S1smza8x7bZ/serlhdZlZsxtK3D6JyvjzETgBw 4xUf3S/XelqdFGm0yzUT71CdRkNzoii1/4La/et4eF/N1/DrXyPqeahI5G2bfRe18WF3uwZEnNj xWCNFkA4RAB9RBUQhZzS6MjAncAch00C4/Cg1qLUkoDO5gVqW13H/0CmxrpsJCT6dH/f9IgJ5IJ 4bhprRKFDzVa1pYTGsTYrNlEtJgWWuMQnmK3XxgjdClTMUgKd9Qyj6t3BMU8Zlp0mxS+fTvwhTy 2ipRiI/3a3LzIHlSGLl1v9EhUwVc07ebd0jT5z7Sflvt/Odrc4hmaScamFEhidJWi+2/xUxBDTG NB2LMzEbd8rSHxUf15GTMCkqrrqPGqrahjZ5v3znPCbG165WTtMN5tbcc/CgFOkss6nxF0qI X-Proofpoint-ORIG-GUID: XDhtAjhfsFZsmBdB5ORQEd8GB6AJArXs X-Authority-Analysis: v=2.4 cv=etffzppX c=1 sm=1 tr=0 ts=6854fdeb cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=fTcLDvV2J6e7RefBZ9UA:9 a=0bXxn9q0MV6snEgNplNhOjQmxlI=:19 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_02,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 spamscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506200045 Register "non_pixel" child node as a platform device, and configure its DMA via of_dma_configure(). This ensures proper IOMMU attachment and DMA setup for the "non_pixel" device. All non pixel memory, i.e bitstream buffers, HFI queues and internal buffers related to bitstream processing, would be managed by non_pixel device. Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_core.h | 2 ++ drivers/media/platform/qcom/iris/iris_probe.c | 50 +++++++++++++++++++++++= +++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index aeeac32a1f6d9a9fa7027e8e3db4d95f021c552e..757efd16870876bd2b1d5b1e410= 3b2d2326b5f49 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -65,6 +65,7 @@ struct icc_info { * @sys_error_handler: a delayed work for handling system fatal error * @instances: a list_head of all instances * @inst_fw_caps: an array of supported instance capabilities + * @np_dev: device to represent non pixel node */ =20 struct iris_core { @@ -105,6 +106,7 @@ struct iris_core { struct delayed_work sys_error_handler; struct list_head instances; struct platform_inst_fw_cap inst_fw_caps[INST_FW_CAP_MAX]; + struct device *np_dev; }; =20 int iris_core_init(struct iris_core *core); diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index 9a7ce142f7007ffcda0bd422c1983f2374bb0d92..8fe87e30bd40f3c67ec41305c7d= 73520fbc9db7b 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include #include @@ -127,6 +129,46 @@ static int iris_init_resets(struct iris_core *core) core->iris_platform_data->controller_rst_tbl_size); } =20 +static int iris_init_non_pixel_node(struct iris_core *core) +{ + struct platform_device_info info; + struct platform_device *pdev; + struct device_node *np_node; + int ret; + + np_node =3D of_get_child_by_name(core->dev->of_node, "non_pixel"); + if (!np_node) + return 0; + + memset(&info, 0, sizeof(info)); + info.fwnode =3D &np_node->fwnode; + info.parent =3D core->dev; + info.name =3D np_node->name; + info.dma_mask =3D DMA_BIT_MASK(32); + + pdev =3D platform_device_register_full(&info); + if (IS_ERR(pdev)) { + of_node_put(np_node); + return PTR_ERR(pdev); + } + pdev->dev.of_node =3D np_node; + + ret =3D of_dma_configure(&pdev->dev, np_node, true); + if (ret) + goto err_unregister; + + core->np_dev =3D &pdev->dev; + + of_node_put(np_node); + + return 0; + +err_unregister: + platform_device_unregister(pdev); + of_node_put(np_node); + return ret; +} + static int iris_init_resources(struct iris_core *core) { int ret; @@ -143,7 +185,11 @@ static int iris_init_resources(struct iris_core *core) if (ret) return ret; =20 - return iris_init_resets(core); + ret =3D iris_init_resets(core); + if (ret) + return ret; + + return iris_init_non_pixel_node(core); } =20 static int iris_register_video_device(struct iris_core *core) @@ -188,6 +234,8 @@ static void iris_remove(struct platform_device *pdev) =20 iris_core_deinit(core); =20 + platform_device_unregister(to_platform_device(core->np_dev)); + video_unregister_device(core->vdev_dec); =20 v4l2_device_unregister(&core->v4l2_dev); --=20 2.34.1 From nobody Thu Oct 9 04:50:06 2025 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 12524224B02; Fri, 20 Jun 2025 06:21:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400501; cv=none; b=W368MuJfcWZ9mpm4Gam7KFoOAu5mwFRJ6DeEKuUThwuZTl0wV+X3qhZ7Qk/NrfvyzIV8p6Ee0SPjg2uT6FObPHfOijezMFd/Ia/0T+4Uz61t7UpVCuRfe5Vu/geGv5Tx/qEj8LPc8bcK9rx9N0BY3C3vadlDsL3reJd4Oqpy/u8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400501; c=relaxed/simple; bh=0fF4DNnpznZooU8ZimQgDbL4koCdAAspFuMZgiiLEDg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=jxqey5qSuGoWDLZRFXaLMTp5d7BHJx6ZJHRLZcsGGbqpTmbBMvWMiHUp46TNbggumX5zQ7uKqxo40VVIiAQnmUymyJIDTsaMRHugrz0/TCsX7NN85zKtahiK99T35SCQ5n2pu5Z4AZqB8r6BKFEkgwMHmlmt0uitm8rOrTnGiwE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=CRN+ploE; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CRN+ploE" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55JL1pl5024412; Fri, 20 Jun 2025 06:21:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 1ZpCxuV1i7pnVntekzWVB/5wMZnpky2emnke/YBRFfI=; b=CRN+ploEOEaXtx0B 49U7afXnjB9y3z9CuRwBsJKS6PZomEHSMcvo2iyd/cmlZPnWhe5xwZwd8pz9ixJ7 kY4cPSbLFnnVE3cDErxL2sQP8erHWddFrVEIOgeI9nu9JK3EiDS5lMsJADMjG09N Hoo9x3/aEZaOxSeFcPaAiqiXZxejvnFX2SygiMxGmLUF1SRAtMqWkpTEVDpdsWNe WzU8Ks90CxC3yooaUPhJezTdkAttnfxxH0AVf6dztI7diaCMLC1ye0TqERUJoBFp U+2YIoVRsnUL3rVNrTKHitGDorumT62D25BLvQIfeUp8/V21vEDmIbs3vfIWrzNG TaRCug== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47bw13e90q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:34 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55K6LYvQ023582 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:34 GMT Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 19 Jun 2025 23:21:30 -0700 From: Vikash Garodia Date: Fri, 20 Jun 2025 11:50:53 +0530 Subject: [PATCH 3/5] media: iris: use np_dev as preferred DMA device in HFI queue management 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: <20250620-video_cb-v1-3-9bcac1c8800c@quicinc.com> References: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> In-Reply-To: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750400480; l=3237; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=0fF4DNnpznZooU8ZimQgDbL4koCdAAspFuMZgiiLEDg=; b=sLwzA4SXMpqrKpucLO2ud5f52Ag8N7buOm3thAF15bPt7eLZRqtNyWD8fi+EcsOHTdqK9OrQw JMETGoWcrmkB3PDyDRRTgmBwpx3gTE8h5Jc2KSkI0yUE2igw4OOBk9s X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Authority-Analysis: v=2.4 cv=QbBmvtbv c=1 sm=1 tr=0 ts=6854fdef cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=gd6Ub234OC9brPQr5uUA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: I9ey0FnhOICbxpjx6vUuzw8eFpmGi-gS X-Proofpoint-GUID: I9ey0FnhOICbxpjx6vUuzw8eFpmGi-gS X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDA0NiBTYWx0ZWRfX3jxuwQO+Wp/8 VPrOBKLw/GzWSjJFk+vgdcqQf6x1dNbYv1FwifZcZDHYnokAYkKmXA0LqZnN/rcwB55MGzKB6GO fjoYQh9tVixZhIfQNVmw8RRfNuYbp69lNmFp13+53pPjochiIef7QZeNvFqIi3cIdh6oRusrUhU k8dNF6ayzKz8y5Ed0JlDGjV7ePoJvfIRhCkLN5i9eXGtjOVTS5r0SYi/EIfbCvHASBJ4CLxGvay EGzbAFxmFBx+sIE/Zl1GpRZJCKxfPc0VM+vT0Q1VHBLvfngdYV+0f+yhROiCic1Ch/YsXggS9lE 74gRd1WY8soHKxArqSfc+cRxJfXtJNabV9mhGGfbu7z1VrKvUqkb9jrBGcqbiPOndLCiGV99iLK 6BULn+4bjIkO3gOQFwKEpSykooOcBXIWaFVvVHJgJghIn+ADCj4jcaIPWDwwBCSr1SMUM365 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_02,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 malwarescore=0 mlxlogscore=931 bulkscore=0 adultscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506200046 Update HFI interface queues to use np_dev(preferred non-pixel device) for DMA memory allocation and deallocation if available. This allows platforms with separate DMA domain for non-pixel to use the appropriate device handle when managing HFI queues and SFR regions. Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_hfi_queue.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/me= dia/platform/qcom/iris/iris_hfi_queue.c index fac7df0c4d1aec647aeca275ab19651c9ba23733..a31ebe947f525f0d7c09f8b7869= 39d01b62532c3 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c @@ -247,24 +247,27 @@ static void iris_hfi_queue_deinit(struct iris_iface_q= _info *iface_q) int iris_hfi_queues_init(struct iris_core *core) { struct iris_hfi_queue_table_header *q_tbl_hdr; + struct device *dev; u32 queue_size; =20 + dev =3D core->np_dev ? core->np_dev : core->dev; + /* Iris hardware requires 4K queue alignment */ queue_size =3D ALIGN((sizeof(*q_tbl_hdr) + (IFACEQ_QUEUE_SIZE * IFACEQ_NU= MQ)), SZ_4K); - core->iface_q_table_vaddr =3D dma_alloc_attrs(core->dev, queue_size, + core->iface_q_table_vaddr =3D dma_alloc_attrs(dev, queue_size, &core->iface_q_table_daddr, GFP_KERNEL, DMA_ATTR_WRITE_COMBINE); if (!core->iface_q_table_vaddr) { - dev_err(core->dev, "queues alloc and map failed\n"); + dev_err(dev, "queues alloc and map failed\n"); return -ENOMEM; } =20 - core->sfr_vaddr =3D dma_alloc_attrs(core->dev, SFR_SIZE, + core->sfr_vaddr =3D dma_alloc_attrs(dev, SFR_SIZE, &core->sfr_daddr, GFP_KERNEL, DMA_ATTR_WRITE_COMBINE); if (!core->sfr_vaddr) { - dev_err(core->dev, "sfr alloc and map failed\n"); - dma_free_attrs(core->dev, sizeof(*q_tbl_hdr), core->iface_q_table_vaddr, + dev_err(dev, "sfr alloc and map failed\n"); + dma_free_attrs(dev, sizeof(*q_tbl_hdr), core->iface_q_table_vaddr, core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE); return -ENOMEM; } @@ -292,6 +295,7 @@ int iris_hfi_queues_init(struct iris_core *core) =20 void iris_hfi_queues_deinit(struct iris_core *core) { + struct device *dev; u32 queue_size; =20 if (!core->iface_q_table_vaddr) @@ -301,7 +305,9 @@ void iris_hfi_queues_deinit(struct iris_core *core) iris_hfi_queue_deinit(&core->message_queue); iris_hfi_queue_deinit(&core->command_queue); =20 - dma_free_attrs(core->dev, SFR_SIZE, core->sfr_vaddr, + dev =3D core->np_dev ? core->np_dev : core->dev; + + dma_free_attrs(dev, SFR_SIZE, core->sfr_vaddr, core->sfr_daddr, DMA_ATTR_WRITE_COMBINE); =20 core->sfr_vaddr =3D NULL; @@ -310,7 +316,7 @@ void iris_hfi_queues_deinit(struct iris_core *core) queue_size =3D ALIGN(sizeof(struct iris_hfi_queue_table_header) + (IFACEQ_QUEUE_SIZE * IFACEQ_NUMQ), SZ_4K); =20 - dma_free_attrs(core->dev, queue_size, core->iface_q_table_vaddr, + dma_free_attrs(dev, queue_size, core->iface_q_table_vaddr, core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE); =20 core->iface_q_table_vaddr =3D NULL; --=20 2.34.1 From nobody Thu Oct 9 04:50:06 2025 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 35DD922154F; Fri, 20 Jun 2025 06:21:49 +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=1750400510; cv=none; b=D26W2Q+82PM7E+5b6FBwelsrmr0e8Yzk45CF/1Ev5if9kKdkUCq9nQ8UfFAbYi39pNS+kSrxpRemdVhwVGiNXnjDmz8uOWJFmeeOL/8mnMZgklx0kPuW+T8nVl4T6s0IH8XxfnsN5ilcg9C79EbSMwzVW7HpM0NX3vu89MAWH30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400510; c=relaxed/simple; bh=HnzC2NXWKuXGG6DwRrGTVEY4cwE6xjAZhcxObvKqsbw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=NUgrF2vmdLy3xIz28gY8lSbZlV/MuSQz8HLA5aDNigxvVusifDBQr1N8pYPxRY7mxF7ONJwPkIT9/kyrcjTr848eN3Ojwdap6+/vn1yqi1iACTX4SruFPQGxZ6ghuP7aDBCZjZnHf4xO9q0q5C66jH8NkQKU91tHa1jylS/UTlg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=fbpgnQrt; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="fbpgnQrt" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55JFvx3L027539; Fri, 20 Jun 2025 06:21:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= m9lsuwkEDfzWSPkDeANs5L89I9hXnOx1xQOCrn7r2z4=; b=fbpgnQrtqsWxO2qK zaH0qIfZcmK/F/q2VWxiAqrAj3Z8oui3dKU3prfVPjWPFKHy/vevc2F5hQgp11jL F6du6ngmbEh5NhKuQcIrzuNbKLoDsywNL+24/pzDu853DQ/LIjvSVNfFdfY3W05l bSmLBgGfvNfUSohrypUs1gNj8H/JUGfFmIiWVfORxIANF4N+W5K8HPp96nk77unB z9v8nmFHJdbb26WAdEKzyErZ2gGU7ZNQ8lgL2Wej11hoUUxydyR7auBtae/rPQHX YZQ1OSLQ91UcR7GQteX/bufMavh/pm1CO0L5NUJ8wyHkNeJ0Dd5ErqJ6oKTgW/DZ hfM89A== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4791hdabgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:38 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55K6Lcep009661 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:38 GMT Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 19 Jun 2025 23:21:34 -0700 From: Vikash Garodia Date: Fri, 20 Jun 2025 11:50:54 +0530 Subject: [PATCH 4/5] media: iris: select appropriate DMA device for internal buffers 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: <20250620-video_cb-v1-4-9bcac1c8800c@quicinc.com> References: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> In-Reply-To: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750400480; l=2223; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=HnzC2NXWKuXGG6DwRrGTVEY4cwE6xjAZhcxObvKqsbw=; b=92VFM4w78OjayQqJ5GPo4f6CWLHDfph32vBLpsr2iO3FkXNqKLDRmMOA4X72X3gw8CsHbX6eJ XY+rTSegebFCajSIZm+UZ3KOLYs7NhCsDHLn3C/CKr96TwsO+FU/wkN X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDA0NiBTYWx0ZWRfX6VK7djm27t3E xu8iIRXN7hkJBDFzVbFIdsu00IsEBZb3Oc3sczXXZYjOzoHlkkssGDZUr8oHSwsqKRUmhBw9fsR sxaU1wpjAEOHsW93BUZY0lgQL/y3neIzHu2bJg3B6+8GsHM3f+bAgFpKBD4j+qqnpmX11ZqLDjP IXeouEZEZudpjwutJFxUzJlPqqCC3DB/3rjqM5py6lqrqXrmmg6d5UULF7lLf66tdO///uWcaks OdPuVW6Nir8mnzZe/u05rRmjhP8zbYJzb4sg7IYImo/W/6eEwFKYS7Ojk8hpttCJ+ntBuQb+DKV OBNgypJyijRVu0qqD1oczgvBXnJIC5IfyqecXOhBFmwTAoDRsnqT6bXsTJRWMEM1EA7s/fGnD30 xHVx8lOWdpsE9c6V+q849zd2nuRsNGTR+jGXJC2kpEId0bTl3YaxJKdclHWgpzoIbWlcBWjq X-Authority-Analysis: v=2.4 cv=PtaTbxM3 c=1 sm=1 tr=0 ts=6854fdf2 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=Jl8zK0-8wVe6xbTnPs0A:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: 8jHWboUsAQhgtXAzIfnJDqVM_S_RmIs6 X-Proofpoint-GUID: 8jHWboUsAQhgtXAzIfnJDqVM_S_RmIs6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_02,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 mlxlogscore=939 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 spamscore=0 priorityscore=1501 phishscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506200046 When a non-pixel device (np_dev) exists, it is preferred for DMA operations for internal buffers which are specific to bitstream data processing. DPB(decoded picture buffer) buffers are internal buffers associated with pixel buffers, hence they are not part of "non_pixel" device. Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_buffer.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media= /platform/qcom/iris/iris_buffer.c index e5c5a564fcb81e77746df8c4797a10a07f2ae946..0bf6041936175d03a51985be148= e78894fc3e990 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -265,6 +265,7 @@ static int iris_create_internal_buffer(struct iris_inst= *inst, struct iris_buffers *buffers =3D &inst->buffers[buffer_type]; struct iris_core *core =3D inst->core; struct iris_buffer *buffer; + struct device *dev; =20 if (!buffers->size) return 0; @@ -280,7 +281,11 @@ static int iris_create_internal_buffer(struct iris_ins= t *inst, buffer->dma_attrs =3D DMA_ATTR_WRITE_COMBINE | DMA_ATTR_NO_KERNEL_MAPPING; list_add_tail(&buffer->list, &buffers->list); =20 - buffer->kvaddr =3D dma_alloc_attrs(core->dev, buffer->buffer_size, + dev =3D core->np_dev ? core->np_dev : core->dev; + if (buffer->type =3D=3D BUF_DPB) + dev =3D core->dev; + + buffer->kvaddr =3D dma_alloc_attrs(dev, buffer->buffer_size, &buffer->device_addr, GFP_KERNEL, buffer->dma_attrs); if (!buffer->kvaddr) return -ENOMEM; @@ -367,9 +372,15 @@ int iris_queue_internal_buffers(struct iris_inst *inst= , u32 plane) int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffe= r *buffer) { struct iris_core *core =3D inst->core; + struct device *dev; + + dev =3D core->np_dev ? core->np_dev : core->dev; + + if (buffer->type =3D=3D BUF_DPB) + dev =3D core->dev; =20 list_del(&buffer->list); - dma_free_attrs(core->dev, buffer->buffer_size, buffer->kvaddr, + dma_free_attrs(dev, buffer->buffer_size, buffer->kvaddr, buffer->device_addr, buffer->dma_attrs); kfree(buffer); =20 --=20 2.34.1 From nobody Thu Oct 9 04:50:06 2025 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 2C850221281; Fri, 20 Jun 2025 06:21:46 +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=1750400508; cv=none; b=sftCVBb66JofMWHk20NIDng/hFDMXi7qqKAtTJzj3Y9lprrzN/h5aWOEawZ+g+6VMRJrQu0eVza/DuhhH922t+2qQRZnt/q18G93of4q6c3Jegx7//j56Yd3aWQNJH6sQAf6sNNGJ8NdAW34WEvEr0QV+ksxBOPNf31pUoRCH0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750400508; c=relaxed/simple; bh=7yLqISZi2iOkaYLdO3jaD791BiQle43dMbxx3g6IDjM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=g/9VL+RefcOIydcz+24QIajB234shibfWnbQkobQoiJH95eYrVI7eGV0ajE2eb4tn51CvbQCyBPKu/zx9Jo7AW6HagQTY4qMrRw2p2tpB8Oc458Xn0tqDbNeU0uz/0v5JIonfqe6zl0eZidmSugHbDbnQiJ/LZxVTejIjL3xSZg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=e4ReLmde; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="e4ReLmde" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55JFeTc5024471; Fri, 20 Jun 2025 06:21:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= tv69h5+7Ly9EksC2Tsf+uzCBpppecTtLheLgqclXCFk=; b=e4ReLmdeLx7bjypR 60e8TaJ2+OAkWksErbwrMTRFlIKkNRU5zxTxr+xvpnpixbOBqeb8WM1pOVhcGpo/ ZCmsEYqdGDl7geKB18uZcTzw6D9oymDbNx6z5cK1UpK0rIHXRh86h4h1AFx8t5gS 5PYbBKZN2MHlIAku7PDQKQP3gAfMXEjvEl5p7GYjuPoCwxBACESLgMB7msAABC6J 9kGSXOh9b4PRENCxUwQ/c7gZRPbn2CjclYy7usCkzfEdTUq99Pw8Lb0seWmmDLcF s0CfGryVLLjEZH+ZhO/mwxRejFrJnUgnwv2b1YtPFefchHHDdR4w471CVmbwwvSH Z1MG8w== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4792caad3q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:42 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55K6LfJi032172 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jun 2025 06:21:41 GMT Received: from hu-vgarodia-hyd.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 19 Jun 2025 23:21:38 -0700 From: Vikash Garodia Date: Fri, 20 Jun 2025 11:50:55 +0530 Subject: [PATCH 5/5] media: iris: configure DMA device for vb2 queue on OUTPUT plane 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: <20250620-video_cb-v1-5-9bcac1c8800c@quicinc.com> References: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> In-Reply-To: <20250620-video_cb-v1-0-9bcac1c8800c@quicinc.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: , , , , Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1750400480; l=1047; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=7yLqISZi2iOkaYLdO3jaD791BiQle43dMbxx3g6IDjM=; b=ImbgSpYiEs9xk00RdFh8SJ7TLQu3dgodnogThKGLS1vi0czi7n02MC7Wst+Q9O/1/9YJqPv+x Do8NvlMd0J4Dv/N4i9bVNM+zsP11kCQLowyDX0l9Z+phNsFXddyWwwJ X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: CVd8M26JK9lmEvmR1FHGqWzp6EIPuFS6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDA0NSBTYWx0ZWRfX/dzq0DEt1NZq Uu/zS4GWCSjeJ5viOyitQjhayXENIiJLQoPo6Ahr1BOWpkYREvrV3ECI2CyxVVvhnWXpIw70f2+ zGpw/0uFwVQPkP5HeuW3iI0gYYx3oWS7sEb1vB7eIMZxvIj5a7MbZVBr9ePXiS2wxLDEcs5EHou x5eN4NQOjZCiUCFmtpPwTyOJ8s4tGgedLipWlXReLUB9LRRH8yvwpKTD/HfdAHjFItzRXcAWZ92 WSOjYl8AR8i6r9Zjpnkt1vjNywsjS/Jtyr787pOjCyQ+SHWEmFUBAV3zzcoZZGpNd5uZt7s9Z3e YipFSwjNWd06YS/z3f0kazwV9X4a1yMKYGAqV4oMuI6Wc0CS+KNkcoMEV2Nu3o9+Utq4KSbTIjO hoeb4k7SM+EdPHrdHmy9OMjwtkcsMtRAt43sbVABd7voXB7f4rfLXJZYpggShXl+PB+4aiNk X-Proofpoint-ORIG-GUID: CVd8M26JK9lmEvmR1FHGqWzp6EIPuFS6 X-Authority-Analysis: v=2.4 cv=etffzppX c=1 sm=1 tr=0 ts=6854fdf6 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=9NI5Io21HBJBbxBAymgA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_02,2025-06-18_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 adultscore=0 spamscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 mlxscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506200045 While setting up the vb2 queues, assign "non_pixel" device to manage OUTPUT plane buffers i.e bitstream buffers incase of decoder. It prefers the non_pixel device(np_dev) when available, falling back to core->dev otherwise. Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_vb2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/pl= atform/qcom/iris/iris_vb2.c index cdf11feb590b5cb7804db3fcde7282fb1f9f1a1e..01cc337970400d48063c558c1ac= 039539dbcbaba 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -159,6 +159,10 @@ int iris_vb2_queue_setup(struct vb2_queue *q, *num_planes =3D 1; sizes[0] =3D f->fmt.pix_mp.plane_fmt[0].sizeimage; =20 + if (q->type =3D=3D V4L2_BUF_TYPE_VIDEO_OUTPUT || + q->type =3D=3D V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + q->dev =3D core->np_dev ? core->np_dev : core->dev; + unlock: mutex_unlock(&inst->lock); =20 --=20 2.34.1