media: venus: firmware: Leave a clue about obtaining CP VARs
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Tue, 30 May 2023 12:30:39 +0000 (14:30 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 10 Aug 2023 05:58:34 +0000 (07:58 +0200)
The qcom_scm_mem_protect_video_var accepts two sets of <addr size>
pairs as arguments. They describe the virtual address ranges of the
CP (Content Protection) and CP_NONPIXEL regions. It is however not
immediately obvious how to obtain these values.

Leave a comment explaining how one can translate the vendor device
tree properties for use with the mainline driver.

Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/qcom/venus/firmware.c

index cfb11c5..572b649 100644 (file)
@@ -241,6 +241,16 @@ int venus_boot(struct venus_core *core)
                return ret;
 
        if (core->use_tz && res->cp_size) {
+               /*
+                * Clues for porting using downstream data:
+                * cp_start = 0
+                * cp_size = venus_ns/virtual-addr-pool[0] - yes, address and not size!
+                *   This works, as the non-secure context bank is placed
+                *   contiguously right after the Content Protection region.
+                *
+                * 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,
                                                     res->cp_size,
                                                     res->cp_nonpixel_start,