mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>,
	 Konrad Dybcio <konradybcio@kernel.org>,
	 Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	 Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	 Abhinav Kumar <abhinav.kumar@linux.dev>,
	Bryan O'Donoghue <bod@kernel.org>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-media@vger.kernel.org,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	 Jorge Ramirez-Ortiz <jorge.ramirez@oss.qualcomm.com>,
	 Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com>,
	 Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: [PATCH v2 2/3] media: qcom: Use PAS API for video memory protection
Date: Tue, 27 Oct 2026 18:09:04 +0530	[thread overview]
Message-ID: <20261027-pas-video-v2-2-5b52bca5add6@oss.qualcomm.com> (raw)
In-Reply-To: <20261027-pas-video-v2-0-5b52bca5add6@oss.qualcomm.com>

From: Sumit Garg <sumit.garg@oss.qualcomm.com>

Replace the direct qcom_scm_mem_protect_video_var() calls in venus and
iris with qcom_pas_mem_protect_video_var(), so that the call is only
issued when the active PAS backend needs it. This allows the video
codecs to bring up firmware with the OP-TEE PAS backend as well, with
no functional change for the SCM backend.

As the video drivers no longer call into SCM directly, also drop their
Kconfig selection of QCOM_SCM.

Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
---
 drivers/media/platform/qcom/iris/Kconfig         | 1 -
 drivers/media/platform/qcom/iris/iris_firmware.c | 5 ++---
 drivers/media/platform/qcom/venus/Kconfig        | 1 -
 drivers/media/platform/qcom/venus/firmware.c     | 3 +--
 4 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/qcom/iris/Kconfig b/drivers/media/platform/qcom/iris/Kconfig
index 0996213e71e7..804d8d38341e 100644
--- a/drivers/media/platform/qcom/iris/Kconfig
+++ b/drivers/media/platform/qcom/iris/Kconfig
@@ -5,7 +5,6 @@ config VIDEO_QCOM_IRIS
 	depends on QCOM_SMEM || QCOM_SMEM=n
 	select V4L2_MEM2MEM_DEV
 	select QCOM_MDT_LOADER
-	select QCOM_SCM
 	select QCOM_PAS
 	select QCOM_UBWC_CONFIG if ARCH_QCOM && QCOM_SMEM
 	select VIDEOBUF2_DMA_CONTIG
diff --git a/drivers/media/platform/qcom/iris/iris_firmware.c b/drivers/media/platform/qcom/iris/iris_firmware.c
index ed2bd0e83797..16e19c65c7ba 100644
--- a/drivers/media/platform/qcom/iris/iris_firmware.c
+++ b/drivers/media/platform/qcom/iris/iris_firmware.c
@@ -5,7 +5,6 @@
 
 #include <linux/firmware.h>
 #include <linux/firmware/qcom/qcom_pas.h>
-#include <linux/firmware/qcom/qcom_scm.h>
 #include <linux/of_address.h>
 #include <linux/of_reserved_mem.h>
 #include <linux/soc/qcom/mdt_loader.h>
@@ -241,12 +240,12 @@ int iris_fw_load(struct iris_core *core)
 
 	for (i = 0; i < core->iris_platform_data->tz_cp_config_data_size; i++) {
 		cp_config = &core->iris_platform_data->tz_cp_config_data[i];
-		ret = qcom_scm_mem_protect_video_var(cp_config->cp_start,
+		ret = qcom_pas_mem_protect_video_var(cp_config->cp_start,
 						     cp_config->cp_size,
 						     cp_config->cp_nonpixel_start,
 						     cp_config->cp_nonpixel_size);
 		if (ret) {
-			dev_err(core->dev, "qcom_scm_mem_protect_video_var failed: %d\n", ret);
+			dev_err(core->dev, "qcom_pas_mem_protect_video_var failed: %d\n", ret);
 			qcom_pas_shutdown(IRIS_PAS_ID);
 			return ret;
 		}
diff --git a/drivers/media/platform/qcom/venus/Kconfig b/drivers/media/platform/qcom/venus/Kconfig
index 7997b8aa427a..c4362eff954a 100644
--- a/drivers/media/platform/qcom/venus/Kconfig
+++ b/drivers/media/platform/qcom/venus/Kconfig
@@ -5,7 +5,6 @@ config VIDEO_QCOM_VENUS
 	depends on (ARCH_QCOM && ARM64 && IOMMU_API) || COMPILE_TEST
 	select OF_DYNAMIC if ARCH_QCOM
 	select QCOM_MDT_LOADER
-	select QCOM_SCM
 	select QCOM_PAS
 	select VIDEOBUF2_DMA_CONTIG
 	select V4L2_MEM2MEM_DEV
diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c
index 3c0727ea137d..d232fe5b28b4 100644
--- a/drivers/media/platform/qcom/venus/firmware.c
+++ b/drivers/media/platform/qcom/venus/firmware.c
@@ -13,7 +13,6 @@
 #include <linux/platform_device.h>
 #include <linux/of_device.h>
 #include <linux/firmware/qcom/qcom_pas.h>
-#include <linux/firmware/qcom/qcom_scm.h>
 #include <linux/sizes.h>
 #include <linux/soc/qcom/mdt_loader.h>
 
@@ -255,7 +254,7 @@ int venus_boot(struct venus_core *core)
 		 * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0]
 		 * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1]
 		 */
-		ret = qcom_scm_mem_protect_video_var(res->cp_start,
+		ret = qcom_pas_mem_protect_video_var(res->cp_start,
 						     res->cp_size,
 						     res->cp_nonpixel_start,
 						     res->cp_nonpixel_size);

-- 
2.43.0


  parent reply	other threads:[~2026-10-27 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 12:39 [PATCH v2 0/3] media: qcom: Skip SCM secure memory protection with OP-TEE PAS backend Sumit Garg
2026-10-27 12:39 ` [PATCH v2 1/3] firmware: qcom: pas: Add optional video memory protection op Sumit Garg
2026-10-27 15:58   ` Konrad Dybcio
2026-10-27 12:39 ` Sumit Garg [this message]
2026-10-27 15:59   ` [PATCH v2 2/3] media: qcom: Use PAS API for video memory protection Konrad Dybcio
2026-10-27 12:39 ` [PATCH v2 3/3] firmware: qcom: scm: Drop export of qcom_scm_mem_protect_video_var() Sumit Garg
2026-10-27 15:59   ` Konrad Dybcio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261027-pas-video-v2-2-5b52bca5add6@oss.qualcomm.com \
    --to=sumit.garg@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=andersson@kernel.org \
    --cc=bod@kernel.org \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=jorge.ramirez.ortiz@gmail.com \
    --cc=jorge.ramirez@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®