From nobody Wed Oct 8 12:36:06 2025 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 F1F462E9EBD; Fri, 27 Jun 2025 15:48:30 +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=1751039313; cv=none; b=PtImh8+rowdGZo5I0VYbcATpJr6o4NAEwsO065AquqEXSB0iBjssv8WGfxF46aRrmypyU0R0MHQPpGwEIDoiFejbh+HwhiW7ZlZI7dGWaD5ldkm2u6GtZypIOk4CmLVhSz4oaIcFTFo3IHCvpVVx5t1hYPlcnWFmW1J30XSFH+E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039313; c=relaxed/simple; bh=lPUj0ZS+JIjR93Ymz5Wr75qm8fLJvAWE3vvsWceS7Ao=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=oeLjCYP7ybtoL75GkqwmpJe8M8kSAIRWyFO4y4bfZFSCWeLr2OFhqgr8imCpwW4hV0fkbkq8UHcxjFAUXdRP8TzfVyN+tF1pjrIU+iAIsdT8vPCmyfyO3aVu6f2BxdEVtCpB/8QUYgRP8qAnsteiYcSufZhoiQziXx6AkK+c2TU= 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=YoQkjlmX; arc=none smtp.client-ip=205.220.180.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="YoQkjlmX" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55RCTJOb011462; Fri, 27 Jun 2025 15:48:25 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= 9zBTx9oEg56qxof1puCCB00RBEOC/lpooworXFFdO3w=; b=YoQkjlmX1XbbUuTu BsSc6hn3kmhO+w1VqNouCR9qrtkXGELIH9la1Z3f6fEbgB1iewVE0vyyAQeh4W1r Ffvg/TZE4pQs8PUPJ4q+gKNVQzVN6bDcHThKenHH5rEjXICnhvdH6iQTrUshaRLc e/dFtUJWBLoDekZwl9hWVyYq9VUlQ/Cs1v8m5SMAxMd2fn4bxgsLP9Zv1kgy7T7O WNVWaceOXN+vH68QCLtzvijBeuhgsV7K76LEXbOUXgmf+5x/xTrTW/Sysk2uTFrh 4+ZLfRAElcTUbzRNd2wbsgQ8SJ146LqBAxyTADI5tkdJjS/1/5GS324NSnZTtCm7 KdLqcQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47f3bgq9sj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:25 +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 55RFmOl1022557 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:24 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; Fri, 27 Jun 2025 08:48:20 -0700 From: Vikash Garodia Date: Fri, 27 Jun 2025 21:18:07 +0530 Subject: [PATCH v3 1/5] media: dt-bindings: add non-pixel property in iris schema 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: <20250627-video_cb-v3-1-51e18c0ffbce@quicinc.com> References: <20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com> In-Reply-To: <20250627-video_cb-v3-0-51e18c0ffbce@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=1751039297; l=3746; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=lPUj0ZS+JIjR93Ymz5Wr75qm8fLJvAWE3vvsWceS7Ao=; b=qv1JV4/yGm94GN/Av5lIyghac4QwpqsSd+JDtH97+ySJhbJgD2WYQo+WN1DHUwvejfDnogdtc 51P0HQKDlfyBSVTjUB2cizDhK2wgpYwpbxUsLnbTNwV82dXNQDLBZVc X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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-ORIG-GUID: A-VbURgTUPMeX_4YeEVveaJomZZ2J-1J X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI3MDEyOCBTYWx0ZWRfXwhkHUr5DnHyl 9Y/N/ht3WOe9fZXFX+AspxVWepm3tya/z7PMs8LTn6hbSqIZAg6LHcFcMwATnfs0r9ep1Sd2h2S fypvsfyvIva8xBIREDPKrLgy1soqk3AtjnYMhXCnUIGJRpQzNNRjJBzGZnjbQq1MPlNoNaeXv/H +ZZdZPem+oY48y6+c6k8CTgnrw5RykYEbeaQopKhVEhf8bparzyMiBi1ps2Bl3fQnvdlr9lXh46 ardauJhDpuCRI1TwfRwuEu1HRkGFTnytdxBhzQfSy92rLzr1fMeGAkKSI8gYGxy8EeloaXl7HPc wEvYgLTgz2nEa7l3mhmrIt5bYuArj5g+ELvPBvc1hkNM5qdkqkV0CTNDPb/e1FnYk/J5nPCCCTB bdsgOkK8ZIlgorn6wIGyMxaStcsQ1vrKlKET1v41mu3iqEQEYtcCuZptFrxQOtJgCkeHFRje X-Authority-Analysis: v=2.4 cv=L4kdQ/T8 c=1 sm=1 tr=0 ts=685ebd49 cx=c_pps a=JYp8KDb2vCoCEuGobkYCKw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=GEpy-HfZoHoA:10 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=COk6AnOGAAAA:8 a=PYxMoiBjk0tJv0C1prkA:9 a=QEXdDO2ut3YA:10 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: A-VbURgTUPMeX_4YeEVveaJomZZ2J-1J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_05,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 bulkscore=0 clxscore=1015 suspectscore=0 adultscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 spamscore=0 phishscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506270128 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 reference to the reserve-memory schema, which defines reserved IOVA regions that are *excluded* from addressable range. Video hardware generates different stream IDs based on the predefined 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. Non-pixel stream-ID can now be part of the new sub-node, hence iommus in iris node can have either 1 entry for pixel stream-id or 2 entries for pixel and non-pixel stream-ids. Signed-off-by: Vikash Garodia Reviewed-by: Bryan O'Donoghue Tested-by: Neil Armstrong --- .../bindings/media/qcom,sm8550-iris.yaml | 40 ++++++++++++++++++= ++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index c79bf2101812d83b99704f38b7348a9f728dff44..4dda2c9ca1293baa7aee3b9ee10= aff38d280fe05 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -65,10 +65,31 @@ properties: - const: core =20 iommus: + minItems: 1 maxItems: 2 =20 dma-coherent: true =20 + non-pixel: + type: object + additionalProperties: false + + description: + Non pixel context bank is needed when video hardware have distinct i= ommus + for non pixel buffers. Non pixel buffers are mainly compressed and + internal buffers. + + properties: + iommus: + maxItems: 1 + + memory-region: + maxItems: 1 + + required: + - iommus + - memory-region + operating-points-v2: true =20 opp-table: @@ -86,6 +107,7 @@ required: =20 allOf: - $ref: qcom,venus-common.yaml# + - $ref: /schemas/reserved-memory/reserved-memory.yaml - if: properties: compatible: @@ -117,6 +139,16 @@ examples: #include #include =20 + reserved-memory { + #address-cells =3D <2>; + #size-cells =3D <2>; + + iris_resv: reservation-iris { + iommu-addresses =3D <&iris_non_pixel 0x0 0x0 0x0 0x25800000>, + <&iris_non_pixel 0x0 0xe0000000 0x0 0x20000000>; + }; + }; + video-codec@aa00000 { compatible =3D "qcom,sm8550-iris"; reg =3D <0x0aa00000 0xf0000>; @@ -144,12 +176,16 @@ examples: resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x1940 0x0000>, - <&apps_smmu 0x1947 0x0000>; + iommus =3D <&apps_smmu 0x1947 0x0000>; dma-coherent; =20 operating-points-v2 =3D <&iris_opp_table>; =20 + iris_non_pixel: non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0000>; + memory-region =3D <&iris_resv>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Wed Oct 8 12:36:06 2025 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 C23062E9EDF; Fri, 27 Jun 2025 15:48:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039315; cv=none; b=OGuCGF4xEyW9Dn/UjTkhiYv21KGFQufOb0AoG7wFqNY25f2Oc3VBHzBnfvA92munVAlOkNn8sPN9UBk4xhJzp3ErUQOw4EO9C/PIRX0vj2W0UsYQpVeE2kYSPqfTPH/waJB6Qidm5hl/J7kPiN7h49BhlxXR6hs46kTzVNDel5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039315; c=relaxed/simple; bh=3N2w2gbNb6zjinpI7X9gyQWnQIkyPQjlVsmeYYz8AEE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=MW+1tnQ2wFNTOHjhjCOwure3an1yPrYHjjDA762yfO3wQ52NElaB75BYw5GMpU2rQlH7YwLI1nAYZKIlJH+k24pBuj6ACxJK2knMBsaN+xilFOaHTE3hMfbmwnh7cmRxgivdYKuZmjseVgTblkn5lTHJx3GCvCGmqqnNzdfp9fI= 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=e62kkSZY; arc=none smtp.client-ip=205.220.180.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="e62kkSZY" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55RBq2Sl028862; Fri, 27 Jun 2025 15:48:29 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=e62kkSZY/rYDejzt 8MOryjgPMfy7X/+siSAiCLW/K2pbs/0tnw7mVMx6NXSwNYI6tWcjoJw1I2JXmkGZ 4IZxEG8xp+uifEFLVXCOqPn3q6swsv6Xi8BqdzTBtnmu+CBdUBGCvpFlBUEWxU17 dniZBtnsJ5EiFk9oFGn/327s9+NShAahkBQvZuGE03XYyyzbVTJ3i/FqFFZaSE+n z25uOiXft6ecT7b9Do6UnyqHbXHU5b7w9+uJIBwSuc2iT8DIS9JKwQOIT+XynZGy 9upWaq8cRZKUJ+PzGdTqHjJjH3A4C3lGXPX2REO2pTOlNljyylNOxaGGmi4q84bO LiPmjA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47hkpbj1mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:28 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 55RFmRnk003070 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48: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; Fri, 27 Jun 2025 08:48:24 -0700 From: Vikash Garodia Date: Fri, 27 Jun 2025 21:18:08 +0530 Subject: [PATCH v3 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: <20250627-video_cb-v3-2-51e18c0ffbce@quicinc.com> References: <20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com> In-Reply-To: <20250627-video_cb-v3-0-51e18c0ffbce@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=1751039297; l=3725; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=3N2w2gbNb6zjinpI7X9gyQWnQIkyPQjlVsmeYYz8AEE=; b=xmCV5T0N4z0UCvN6X+XEFeE1CqZRqzVPQxhnO/kfn4Orx7cGqHGSuifCMhWtuC9TwktH25IPB F3dTToQw0PrCxRa4/Nes4FUb5TdrM3WJG5sjxqGXnkwYyOBj3Tl9qdf X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: AW1haW4tMjUwNjI3MDEyOCBTYWx0ZWRfXzXOXJ5MFq/Hw 9atGRomqU0HOWFVyv+7Kk4ZYEZ15DV9y0z1DG4BTw0qxmEivXn6Ssm/+EPQu8l8NgLm+b4EYbUS Qs7hkTfYAOXffvbUyHV3xNyOZfZaAw7LoK3AaT5a5H1IoDYp8XfWpUqe5GCHpFoWqrU+nT/FdXG 8tCSct100xLqc8sCZ3HGwkzzoJtK1ysJJRGoj2fJc2+/SdbAayccLCYxSwmPpWo9jqv6JpMvI49 c3LuMdB9HO//k5YHd1Q8Kod+vAm+iIySoPeeivF6xd3PgWRMnwFi0KiVxGat82GIe9EJTIkDpIm IcuiBib8UO66qnVCtDJdxVUtkd9Nm7Bhb9GSBnKy370mjNIh9KFtDUxK7cBSq8Yum9L2/GJOwKJ LaTQqg9rUYKIEr/ecv33Tl4olsGJhTVWIDMCgvGk452eLihtZfzXYbBsPiPdtKprefSp7Iuc X-Proofpoint-GUID: 87dMwml7YzLm90fgQ5nLOWCs4z4W_c8s X-Authority-Analysis: v=2.4 cv=AY2xH2XG c=1 sm=1 tr=0 ts=685ebd4c 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-ORIG-GUID: 87dMwml7YzLm90fgQ5nLOWCs4z4W_c8s X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_05,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 adultscore=0 impostorscore=0 clxscore=1015 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-2506270128 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 Reviewed-by: Bryan O'Donoghue Tested-by: Neil Armstrong --- 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 Wed Oct 8 12:36: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 3BD102EA163; Fri, 27 Jun 2025 15:48:38 +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=1751039320; cv=none; b=KZ9o3Aun8OnQ5o+ufJw2/TWCh3ENrhIq/ZByIjeaa6tMLqZ4PxiMsodxZTOpjdSs5wOVa4bW2wLXbPH1ZABTRL4eUHqGCAfn/ZgVmeZkrHPF3QZXRioX/neUDUxEbM4eTwT/2pKHl8YPvArPYEDU81oXoLFWyRp43Q0lW1KGhek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039320; c=relaxed/simple; bh=0fF4DNnpznZooU8ZimQgDbL4koCdAAspFuMZgiiLEDg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=AuHjzhkhSQPvgAPQwQVtYjA1wdt8Ai3QMqq8uTXpCFcXbr63WQFF+H5Lovoz+1p6ApnyBhJD6mmYKXCQiwWWH5ACMzRHNqQ9y4kdEiqxz3Ch8FOpkmN28h4JUd+cX+iM/OWak3he3fZkZCBBlhVnokF4kthtjR+qHEVRHBoesfw= 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=UsY5xk+T; 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="UsY5xk+T" 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 55RC4AVw028843; Fri, 27 Jun 2025 15:48:32 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=UsY5xk+T4jxOS2EZ J70g5n8pfvVsceaWYPRzrmWMmdwM09VmlKRtcpm/EVBBeciQ5RafIkd7XRw8euqA R2O4q57yqorjqDpizLhJTdoxMUnP+99mfsEKt/4lOSlbHcUEAIk28JeX6HpPdF9A O1FOUV9hPfgUd1PqKVYZAAikTIEzgJtlEQco9N63w1Yl3bnlevys8rQJyk4u8vq1 Z10svcAC+MGSh8Pz/nAI4vjSB7E9tccert/6yFKIis61kdpVS4kCYgaT45ExzqKG HLV25QnwJwdQQ5oJ0vtky26vKmoBDK4z/RqnXGA0ha8Kq7LtIEh1+jYLj4E6Auj1 kC24Og== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47esa50nb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:32 +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 55RFmVh3028674 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:31 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; Fri, 27 Jun 2025 08:48:27 -0700 From: Vikash Garodia Date: Fri, 27 Jun 2025 21:18:09 +0530 Subject: [PATCH v3 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: <20250627-video_cb-v3-3-51e18c0ffbce@quicinc.com> References: <20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com> In-Reply-To: <20250627-video_cb-v3-0-51e18c0ffbce@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=1751039297; l=3237; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=0fF4DNnpznZooU8ZimQgDbL4koCdAAspFuMZgiiLEDg=; b=L7OY1+0XhY7D1jcPZIoj9df/I3EqHZMpuYdRP2f3xhKH+505QT/a7xBP8fj2mjEq+rA+is7fH 0mjTPpPZ4mzCcBGOBskObK8ywFu97GTepDtxTEqInl+DNJJ2WpICQ6R X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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=eLYTjGp1 c=1 sm=1 tr=0 ts=685ebd50 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-GUID: GWv83yFt8bnh1poOSplrXDjFHLTeN-C0 X-Proofpoint-ORIG-GUID: GWv83yFt8bnh1poOSplrXDjFHLTeN-C0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI3MDEyOCBTYWx0ZWRfXxd+KPzIHfNlb qhQyjGnJWCLDQjlWtO6GGDT9yUxuW1vYDbuGoUZLiB5MSVTeRKLVIFm4ES0eWkyrgW0zgDUdzeK KE7Uw7M1FAIH6h0/xR2wRxoSS8QyNu3EIo4WxCULhZAZbZaDg0SmbDIjIZNBTkgoKIK9A54n6bd 42s+jFdTKPSGkYfY24VPLBIg90PIUeTc3goJRxr9+iV3xOsg/dN9xBez/v/fqOIasa02QopZmQv mEXR8BoTZlv3cmF+SWKsiH3DwzIAZLvrqads15dxxi/rA7SAN07g+78dIhYoZEr8TKndDhJ+AHp UyYK7nW80rdi2UOqtW2rZ9nGI8OiAFF1zvDOvjVe8bXExVXrl0MLp6jQK4WlpCGKtaSHpkd+Zx7 Cy/JUPiSnilKjx1QYX8YV40QcdqMbeenIiFxdbiAG7X4GLaH/4CwCVI5LyavtIuzwLkVMNsC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_05,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 mlxlogscore=931 suspectscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506270128 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 Reviewed-by: Bryan O'Donoghue Tested-by: Neil Armstrong --- 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 Wed Oct 8 12:36:06 2025 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 764D32EA73C; Fri, 27 Jun 2025 15:48:41 +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=1751039323; cv=none; b=pxTN+1p9D4vYnLj8NkfyiPwOpOxxmXGK+BJLawB66kcJkyiEbybD48Ze/s5W5g0eCdSqVPY8yn3JI2zq/Vg75Z8EP3vSH3I/F7Tnmu7NEurfuLwosDu4Dwn0wF6N8N1XyDP8Ih16R0QBJa0e5snW20dOiJrENtel9E7l8Xr6QAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039323; c=relaxed/simple; bh=HnzC2NXWKuXGG6DwRrGTVEY4cwE6xjAZhcxObvKqsbw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=ICKGAuvIjdvHHP91I+2r0YovzK/S/kwq57eVEaR/rNaguHiYQVzFByK/3HTvdsARk7svdyWI+t4h7w5Ru0M4lOftCT68SSxk3ERoyMorBt5CHWu82zK3gkl+Hwz42JkLr1h1+dy2Kk2VjFjtsnJ6uKWuOyAYlYq/i+AXUXdbzos= 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=YNAjWUHD; arc=none smtp.client-ip=205.220.180.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="YNAjWUHD" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55RCCr55014512; Fri, 27 Jun 2025 15:48:36 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=YNAjWUHDoJjW8o/P jdWpUB873rGl1Nwe+iDVKqswsGfYQsFCNZuHW/beci2eO3godNs6bbpFV/saxjlL E12infumuEqCj2uQeM0ZFO1I88wOZoAdm1oSHkGz364fwsnFmgJ9dSJMmuvMbbn3 LD3RhW6P5WcLwWj7TwkEUnAK48DpzPPH0kzN+IeYZBvjfcWclm7cD28/81i1ryom oY3ZG2U8uKBjttg8rwH8HrS5aRyYvjYDeHsPhr7MThDERYBbcfeG4/q5UsG85GNj 55FJaFI64jUEijd5QNTmIrsGuAQq0mYAbLPT47d8os4zsdS/KKi8sUETZ+3MYTfO cn/scg== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47fbm25x9e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:36 +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 55RFmZcp005676 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:35 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; Fri, 27 Jun 2025 08:48:31 -0700 From: Vikash Garodia Date: Fri, 27 Jun 2025 21:18:10 +0530 Subject: [PATCH v3 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: <20250627-video_cb-v3-4-51e18c0ffbce@quicinc.com> References: <20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com> In-Reply-To: <20250627-video_cb-v3-0-51e18c0ffbce@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=1751039297; l=2223; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=HnzC2NXWKuXGG6DwRrGTVEY4cwE6xjAZhcxObvKqsbw=; b=hhaAoze6JgnM1tpYNFjN6AcsI5+hO3yGXU1pVMOmsRS+zC2wMS5EPpnCIFN2ZXcPQmhl5Kiga 7yQl/20Qd6fCSnn3WWsbx78h9KS6XnuwVHN2kzBRIJREjcb5eGjcTcj X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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=YYu95xRf c=1 sm=1 tr=0 ts=685ebd54 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-GUID: jwh4OgYIF-6yQSa6iCczCgziDUjgaET6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI3MDEyOCBTYWx0ZWRfX9jaRt025K/mn ctlrdtLhv92b+ch3v29IwF7QdCdozUxotyY75ic2h7vRorjyqYm/sXGRAtsGqpc6xCWhFZ3aGM3 gRzUgyEEkZv5brQ9xc6iYm8sOOUGXI07ZU88wPwrw2/gtQO7S9qolL7f3OA0wrQms6nZOy9ffrh OSiCsFMg/vUyoqBRKCDb4Ueqe3+pdwu+qNhlR0GFTqK7uvGqiryfbqqY5t6I2akMOw4B2uKyylJ 7B7xHpq8cSw9T7d3sEWXtmp5/C6HYJWwnCtafh5YshOJT8JUv3Wh4SSettABkHllReUZT3/lV5b +EGFTb3rYeAodSnc/0zSB3bx6BlZVHeWC2iutd8R4n4dcXZyn0jDMMvGCH/ybv2hxl0CMGnk1ju +YdHdYwrF+pd878+zonaGErGftz+RzDhh3xW2WNBXuQJK9+1csVYcXLdnqm2MUfXwYRLLYz1 X-Proofpoint-ORIG-GUID: jwh4OgYIF-6yQSa6iCczCgziDUjgaET6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_05,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=937 clxscore=1015 mlxscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506270128 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 Reviewed-by: Bryan O'Donoghue Tested-by: Neil Armstrong --- 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 Wed Oct 8 12:36: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 E81202EAB8A; Fri, 27 Jun 2025 15:48:43 +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=1751039326; cv=none; b=OvE1NVnhXpO4LygzpjaEZrmtbsZhlY6CODbhf8V89cHDfbguINDGKLX1luDM1/7kVFPbpaD19W0OKBJNBvYRP351riuem7mm4XkcPBo9UClyJ2sN2VhrOiHza107xeY0atp2QzxFWoIE55eRKUALkgZpP/oPNhQB72noqGm2f94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751039326; c=relaxed/simple; bh=7yLqISZi2iOkaYLdO3jaD791BiQle43dMbxx3g6IDjM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=qrvn+0nDUBJyIxnfVkyR3YXYc2xWs4AbclMzxlZNhxceAqJ2mNavsm5gNKUoQqYIVpqn/MAe4lFlUrI43sGpVtflbDlUId2MRPbGxpv9szavo4cRXWdjp7Fh6aW6Lk7vmoWN4DuGqBczZ1g0RF8t2BHTa8i//0yEWyPtOaZCcrk= 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=gRGZSOQC; 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="gRGZSOQC" 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 55RCIo9H028698; Fri, 27 Jun 2025 15:48: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= tv69h5+7Ly9EksC2Tsf+uzCBpppecTtLheLgqclXCFk=; b=gRGZSOQCphYRkqX7 Aq+Hj11aUw7umLbLdqti0LrTYMYwNWu6n4So8v4CmPvIVgWEQ5nie6kgFJHNHePe Yo6mD3NKQTculMsmIuqDoJQPrEy/QQ5lfbeYDG+JDw5iUv+YXuFa5Nk7bIOn4yPr kMMHJBe5qBxPu0bgfmyTbyldbEgbCz8L97SdLSW+ibDWJ6CBAFGF8PJ8ouUiukAU GOjc/alR2xIECvu/qve0QamLKiNDJeBoPIB4GuwLoAQJjfa4BGeWXbfTh/Jrcjok WROZ7MX8252eiywhhrUjXVunmkzRMB5DoM9Oi9Br/rbdQQtLRHB6mk8/vPjTMS65 JkI5Ew== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 47esa50nbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48:39 +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 55RFmcWL025734 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 Jun 2025 15:48: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; Fri, 27 Jun 2025 08:48:35 -0700 From: Vikash Garodia Date: Fri, 27 Jun 2025 21:18:11 +0530 Subject: [PATCH v3 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: <20250627-video_cb-v3-5-51e18c0ffbce@quicinc.com> References: <20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com> In-Reply-To: <20250627-video_cb-v3-0-51e18c0ffbce@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=1751039297; l=1047; i=quic_vgarodia@quicinc.com; s=20241104; h=from:subject:message-id; bh=7yLqISZi2iOkaYLdO3jaD791BiQle43dMbxx3g6IDjM=; b=f/9pnDtfHnKYZSWsnIhQVhw3Q24SY8lTNex1OwDLpmmvJzY10eYJgyezMK5PgAH8Oi5oJTQ+f EwPwIma40bnAsQUBJ/kk7SK9kZsQteDoHZknKQ3nE3NuhZxekcCilhX X-Developer-Key: i=quic_vgarodia@quicinc.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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=eLYTjGp1 c=1 sm=1 tr=0 ts=685ebd57 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-GUID: nTC4a0Avg5fFgynBOdyyHFyLgH15LAaL X-Proofpoint-ORIG-GUID: nTC4a0Avg5fFgynBOdyyHFyLgH15LAaL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjI3MDEyOCBTYWx0ZWRfX4Fi7YTg6ObH1 G5YTCPX62ELbBiBF5T95AJ6cdvNz7AL+M/9kl15PGs7Tm/Ig7NGvAA/wZd73rrafmO9ohLWS2oe c+BnUOepyTGcarcZFaUYET8bJVhS0CBsddfv5toAvdmJXl2T19wAoUqrfoCE7HEWvQTud2ko9pZ bsTWVie4RD8OPd0qzN3po6t5wt6+veZTc00VhvNqtqCy/fUK+P+SBfWqze8bAl+aIeggVTrrtyX x7eGSMd530Lmp0tf4ytek21aBSzJNCiDyPOfj4D1eQcmaoN6IzLyVytUvPJlXJURnzOebffjYFf UVxqZ46bYTOvPSeVD3Bhflw72OfA2LhbkvKyYyw+It6hMc7SyDuVDkgwZRVOz8k3HAylQiKCQP/ YUqOjWQSsJqc17zDNViRgGs7LuALhu7kUyNKFNi9DDMdOOIUife6ue74Z+to+vMlkvsEbZMQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.7,FMLib:17.12.80.40 definitions=2025-06-27_05,2025-06-26_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 spamscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506270128 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 Tested-by: Neil Armstrong --- 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