Skip to contentSkip to conversation

Venus QoL / maintainability fixes

PATCH Superseded Konrad Dybcio 4 participants 49 messages May 4, 2023 – May 17, 2023

Subsystems (5)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover Venus QoL / maintainability fixes

v1 -> v2:
- Move "Write to VIDC_CTRL_INIT after unmasking interrupts" up and add a Fixes tag & Cc stable
- Reword the comment in "Correct IS_V6() checks"
- Move up "media: venus: Remap bufreq fields on HFI6XX", add Fixes and Cc stable
- Use better English in "Use newly-introduced hfi_buffer_requirements accessors" commit message
- Mention "Restrict writing SCIACMDARG3 to Venus V1/V2" doesn't seem to regress SM8250 in the commit message
- Pick up tags (note: I capitalized the R in Dikshita's 'reviewed-by' and removed one occurrence of random '**' to make sure review tools like b4 don't go crazy)
- Handle AR50_LITE in "Assign registers based on VPU version"
- Drop /* VPUn */ comments, they're invalid as explained by Vikash
- Take a different approach to the sys_idle problem in patch 1

v1: https://lore.kernel.org/r/[email protected]

Currently upstream assumes all (well, almost all - see 7280 or CrOS specific checks) Venus implementations using the same version of the Hardware Firmware Interface can be treated the same way. This is however not the case.

This series tries to introduce the groundwork to start differentiating them based on the VPU (Video Processing Unit) hardware type, fixes a couple of issues that were an effect of that generalized assumption and lays the foundation for supporting 8150 (IRIS1) and SM6115/QCM2290 (AR50 Lite), which will hopefully come soon.

Tested on 8250, but pretty please test it on your boards too!

---
Konrad Dybcio (18):
media: venus: hfi_venus: Only consider sys_idle_indicator on V1
media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts
media: venus: Remap bufreq fields on HFI6XX
media: venus: Introduce VPU version distinction
media: venus: Add vpu_version to most SoCs
media: venus: firmware: Leave a clue for homegrown porters
media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version
media: venus: core: Assign registers based on VPU version
media: venus: hfi_venus: Fix version checks in venus_halt_axi()
media: venus: hfi_venus: Fix version checks in venus_isr()
media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle()
media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready()
media: venus: firmware: Correct IS_V6() checks
media: venus: hfi_platform: Check vpu_version instead of device compatible
media: venus: vdec: Fix version check in vdec_set_work_route()
media: venus: Introduce accessors for remapped hfi_buffer_reqs members
media: venus: Use newly-introduced hfi_buffer_requirements accessors
media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2

 drivers/media/platform/qcom/venus/core.c           | 11 ++--
 drivers/media/platform/qcom/venus/core.h           | 15 ++++++
 drivers/media/platform/qcom/venus/firmware.c       | 19 +++++--
 drivers/media/platform/qcom/venus/helpers.c        |  7 +--
 drivers/media/platform/qcom/venus/hfi_helper.h     | 61 +++++++++++++++++++---
 drivers/media/platform/qcom/venus/hfi_msgs.c       |  2 +-
 .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   | 22 ++++----
 drivers/media/platform/qcom/venus/hfi_platform.c   |  2 +-
 drivers/media/platform/qcom/venus/hfi_venus.c      | 45 ++++++++--------
 drivers/media/platform/qcom/venus/vdec.c           | 10 ++--
 drivers/media/platform/qcom/venus/vdec_ctrls.c     |  2 +-
 drivers/media/platform/qcom/venus/venc.c           |  4 +-
 drivers/media/platform/qcom/venus/venc_ctrls.c     |  2 +-
 13 files changed, 138 insertions(+), 64 deletions(-)

---
base-commit: 92e815cf07ed24ee1c51b122f24ffcf2964b4b13
change-id: 20230228-topic-venus-70ea3bc76688

Best regards,

Signature · 1 line
Konrad Dybcio <[email protected]>
#1 lore raw

PATCH v2 1/18 media: venus: hfi_venus: Only consider sys_idle_indicator on V1

As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device.

Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1.

Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails..

[1] https://lore.kernel.org/lkml/[email protected]/

Fixes 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations")
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +6 -12
index 2ad40b3945b0..bff435abd59b 100644
@@ -131,7 +131,6 @@ struct venus_hfi_device {
 
 static bool venus_pkt_debug;
 int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL;
-static bool venus_sys_idle_indicator;
 static bool venus_fw_low_power_mode = true;
 static int venus_hw_rsp_timeout = 1000;
 static bool venus_fw_coverage;
@@ -947,17 +946,12 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev)
 	if (ret)
 		dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret);
 
-	/*
-	 * Idle indicator is disabled by default on some 4xx firmware versions,
-	 * enable it explicitly in order to make suspend functional by checking
-	 * WFI (wait-for-interrupt) bit.
-	 */
-	if (IS_V4(hdev->core) || IS_V6(hdev->core))
-		venus_sys_idle_indicator = true;
-
-	ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator);
-	if (ret)
-		dev_warn(dev, "setting idle response ON failed (%d)\n", ret);
+	/* HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (HFI V1) */
+	if (IS_V1(hdev->core)) {
+		ret = venus_sys_set_idle_message(hdev, false);
+		if (ret)
+			dev_warn(dev, "setting idle response ON failed (%d)\n", ret);
+	}
 
 	ret = venus_sys_set_power_control(hdev, venus_fw_low_power_mode);
 	if (ret)
Signature · 1 line
2.40.1
#2 lore raw

Re: [PATCH v2 01/18] media: venus: hfi_venus: Only consider sys_idle_indicator on V1

Quoted 42 lines · Konrad Dybcio

As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device.

Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1.

Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails..

[1] https://lore.kernel.org/lkml/[email protected]/

Fixes 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations")
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++------------
  1 file changed, 6 insertions(+), 12 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -8
index 2ad40b3945b0..bff435abd59b 100644
@@ -131,7 +131,6 @@ struct venus_hfi_device {
 
  static bool venus_pkt_debug;
  int venus_fw_debug = HFI_DEBUG_MSG_ERROR | HFI_DEBUG_MSG_FATAL;
-static bool venus_sys_idle_indicator;
  static bool venus_fw_low_power_mode = true;
  static int venus_hw_rsp_timeout = 1000;
  static bool venus_fw_coverage;
@@ -947,17 +946,12 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev)
  	if (ret)
  		dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret);
 
-	/*
-	 * Idle indicator is disabled by default on some 4xx firmware versions,
-	 * enable it explicitly in order to make suspend functional by checking
-	 * WFI (wait-for-interrupt) bit.
-	 */
-	if (IS_V4(hdev->core) || IS_V6(hdev->core))
-		venus_sys_idle_indicator = true;

drivers/media/platform/qcom/venus/hfi_venus.c static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) · line 954

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_venus.c +6 -4
-
-	ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator);
-	if (ret)
-		dev_warn(dev, "setting idle response ON failed (%d)\n", ret);
+	/* HFI_PROPERTY_SYS_IDLE_INDICATOR is not supported beyond 8916 (HFI V1) */
+	if (IS_V1(hdev->core)) {
+		ret = venus_sys_set_idle_message(hdev, false);
+		if (ret)
+			dev_warn(dev, "setting idle response ON failed (%d)\n", ret);
+	}

This property was enabled in video firmware for SDM845 by default from version #7. Need to confirm if patch[1]

was added before the default enablement in firmware. This patch need to be verified on SDM845 for suspend

functionality, before removing it for V4 to avoid power regression.

[1] 17cd3d1d2e52: media: venus: hfi_venus: add suspend functionality for Venus 4xx

-Vikash

Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
  	ret = venus_sys_set_power_control(hdev, venus_fw_low_power_mode);
  	if (ret)
 
#3 lore raw

PATCH v2 2/18 media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts

In reply to Konrad Dybcio

The downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit.

Cc [email protected] # v4.12+
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index bff435abd59b..8fc8f46dc390 100644
@@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
 	int ret = 0;
 
-	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
 	if (IS_V6(hdev->core)) {
 		mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);
 		mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |
@@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
 	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
+	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
 	while (!ctrl_status && count < max_tries) {
 		ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
 		if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {
Signature · 1 line
2.40.1
#4 lore raw

Re: [PATCH v2 02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts

Quoted 2 lines · Konrad Dybcio

The downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit.

Rephrase the commit text,

1. No need to mention downstream driver, if something is buggy, fix it.

2. Avoid "..." and lets make it more formal.

Quoted 20 lines
Cc [email protected] # v4.12+
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -1
index bff435abd59b..8fc8f46dc390 100644
@@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
  	void __iomem *wrapper_base = hdev->core->wrapper_base;
  	int ret = 0;
 
-	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
  	if (IS_V6(hdev->core)) {
  		mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);
  		mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |

drivers/media/platform/qcom/venus/hfi_venus.c static int venus_boot_core(struct venus_hfi_device *hdev) · line 469

Quoted 7 lines
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
@@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
  	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
  	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
+	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
  	while (!ctrl_status && count < max_tries) {
  		ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
  		if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {

Above code looks good.

-Vikash

#5 lore raw

Re: [PATCH v2 02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts

Quoted 8 lines · Vikash Garodia
Quoted 2 lines · Konrad Dybcio

The downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit.

Rephrase the commit text,

1. No need to mention downstream driver, if something is buggy, fix it.

Generally I'd agree, however in this specific case the downstream driver is the only available source of knowledge about what the correct (or at least working) initialization sequence of this hw block is.

Quoted 2 lines

2. Avoid "..." and lets make it more formal.

Ack

Konrad

Quoted 31 lines
Quoted 20 lines
Cc [email protected] # v4.12+
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
index bff435abd59b..8fc8f46dc390 100644
@@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
       void __iomem *wrapper_base = hdev->core->wrapper_base;
       int ret = 0;
   -    writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
       if (IS_V6(hdev->core)) {
           mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);

          mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |

drivers/media/platform/qcom/venus/hfi_venus.c static int venus_boot_core(struct venus_hfi_device *hdev) · line 468

Quoted 6 lines
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
@@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
       writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
       writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
   +    writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
       while (!ctrl_status && count < max_tries) {
           ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
           if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {

Above code looks good.

-Vikash

#6 lore raw

Re: [PATCH v2 02/18] media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interrupts

Quoted 8 lines · Konrad Dybcio
Quoted 5 lines · Vikash Garodia
Quoted 2 lines · Konrad Dybcio

The downstream driver signals the hardware to be enabled only after the interrupts are unmasked, which... makes sense. Follow suit.

Quoted 6 lines
Quoted 3 lines

Rephrase the commit text,

1. No need to mention downstream driver, if something is buggy, fix it.

Generally I'd agree, however in this specific case the downstream driver is the only available source of knowledge about what the correct (or at least working) initialization sequence of this hw block is.

Ideal way would be to refer the sequence of register programming from hardware programming guide (HPG). In this case, the commit can describe the change which is being done and reviewer/maintainer can certify the sequence from the HPG. Also downstream driver can be buggy too, so IMO, it is not the right reference.

-Vikash

Quoted 36 lines
Quoted 2 lines

2. Avoid "..." and lets make it more formal.

Ack

Konrad

Quoted 31 lines
Quoted 20 lines
Cc [email protected] # v4.12+
Fixes d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
index bff435abd59b..8fc8f46dc390 100644
@@ -453,7 +453,6 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
       void __iomem *wrapper_base = hdev->core->wrapper_base;
       int ret = 0;
   -    writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
       if (IS_V6(hdev->core)) {
           mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);

          mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |

drivers/media/platform/qcom/venus/hfi_venus.c static int venus_boot_core(struct venus_hfi_device *hdev) · line 468

Quoted 6 lines
drivers/media/platform/qcom/venus/hfi_venus.c +0 -0
@@ -464,6 +463,7 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
       writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
       writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
   +    writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
       while (!ctrl_status && count < max_tries) {
           ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0);
           if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) {

Above code looks good.

-Vikash

#7 lore raw

PATCH v2 3/18 media: venus: Remap bufreq fields on HFI6XX

In reply to Konrad Dybcio

Similarly to HFI4XX, the fields are remapped on 6XX as well. Fix it.

Cc [email protected] # v5.12+
Fixes 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations")
---
 drivers/media/platform/qcom/venus/hfi_helper.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/hfi_helper.h +6 -3
index 105792a68060..e0c8f15644df 100644
@@ -1170,11 +1170,14 @@ struct hfi_buffer_display_hold_count_actual {
 
 /* HFI 4XX reorder the fields, use these macros */
 #define HFI_BUFREQ_HOLD_COUNT(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count)
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? 0 : (bufreq)->hold_count)
 #define HFI_BUFREQ_COUNT_MIN(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min)
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? (bufreq)->hold_count : (bufreq)->count_min)
 #define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0)
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? (bufreq)->count_min : 0)
 
 struct hfi_buffer_requirements {
 	u32 type;
Signature · 1 line
2.40.1
#8 lore raw

Re: [PATCH v2 03/18] media: venus: Remap bufreq fields on HFI6XX

Quoted 18 lines · Konrad Dybcio

Similarly to HFI4XX, the fields are remapped on 6XX as well. Fix it.

Cc [email protected] # v5.12+
Fixes 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations")
---
  drivers/media/platform/qcom/venus/hfi_helper.h | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/hfi_helper.h +0 -1
index 105792a68060..e0c8f15644df 100644
@@ -1170,11 +1170,14 @@ struct hfi_buffer_display_hold_count_actual {
 
  /* HFI 4XX reorder the fields, use these macros */
  #define HFI_BUFREQ_HOLD_COUNT(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count)

drivers/media/platform/qcom/venus/hfi_helper.h struct hfi_buffer_display_hold_count_actual { · line 1180

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_helper.h +6 -2
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? 0 : (bufreq)->hold_count)
  #define HFI_BUFREQ_COUNT_MIN(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min)
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? (bufreq)->hold_count : (bufreq)->count_min)
  #define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver)	\
-	((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0)
+	((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+	? (bufreq)->count_min : 0)

This patch is not correct. The existing code handles the disparity of buffer requirement payload received from firmware.

Its applicable only for V4.

For V6, driver does not rely on firmware to get the buffer requirement. Refer the buffer platform code for more details.

-Vikash

Quoted 3 lines
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
  struct hfi_buffer_requirements {
  	u32 type;
 
#9 lore raw

Re: [PATCH v2 03/18] media: venus: Remap bufreq fields on HFI6XX

Quoted 31 lines · Vikash Garodia
Quoted 17 lines · Konrad Dybcio

Similarly to HFI4XX, the fields are remapped on 6XX as well. Fix it.

Cc [email protected] # v5.12+
Fixes 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations")

---
  drivers/media/platform/qcom/venus/hfi_helper.h | 9 ++++++---

  1 file changed, 6 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/hfi_helper.h +0 -1
index 105792a68060..e0c8f15644df 100644
@@ -1170,11 +1170,14 @@ struct hfi_buffer_display_hold_count_actual {
     /* HFI 4XX reorder the fields, use these macros */
   #define HFI_BUFREQ_HOLD_COUNT(bufreq, ver)    \
-    ((ver) == HFI_VERSION_4XX ? 0 : (bufreq)->hold_count)

drivers/media/platform/qcom/venus/hfi_helper.h struct hfi_buffer_display_hold_count_actual { · line 1179

Quoted 10 lines
drivers/media/platform/qcom/venus/hfi_helper.h +6 -2
+    ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+    ? 0 : (bufreq)->hold_count)
   #define HFI_BUFREQ_COUNT_MIN(bufreq, ver)    \
-    ((ver) == HFI_VERSION_4XX ? (bufreq)->hold_count : (bufreq)->count_min)
+    ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+    ? (bufreq)->hold_count : (bufreq)->count_min)
   #define HFI_BUFREQ_COUNT_MIN_HOST(bufreq, ver)    \
-    ((ver) == HFI_VERSION_4XX ? (bufreq)->count_min : 0)
+    ((ver) == HFI_VERSION_4XX || (ver) == HFI_VERSION_6XX \
+    ? (bufreq)->count_min : 0)

This patch is not correct. The existing code handles the disparity of buffer requirement payload received from firmware.

Quoted 3 lines

Its applicable only for V4.

For V6, driver does not rely on firmware to get the buffer requirement. Refer the buffer platform code for more details.

OK right I can see, downstream has a condition for IRIS2/IRIS2_1, thanks for pointing this out!

Konrad

Quoted 6 lines

-Vikash

Quoted 3 lines
drivers/media/platform/qcom/venus/hfi_helper.h +0 -0
   struct hfi_buffer_requirements {
       u32 type;
 
#10 lore raw

PATCH v2 4/18 media: venus: Introduce VPU version distinction

In reply to Konrad Dybcio

The Video Processing Unit hardware version is the differentiator, based on which we should decide which code paths to take in hw init. Up until now, we've relied on HFI versions, but that was just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences.

---
 drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/media/platform/qcom/venus/core.h +15 -0
index 4f81669986ba..62c310b7dee6 100644
@@ -48,6 +48,14 @@ struct bw_tbl {
 	u32 peak_10bit;
 };
 
+enum vpu_version {
+	VPU_VERSION_AR50,
+	VPU_VERSION_AR50_LITE,
+	VPU_VERSION_IRIS1,
+	VPU_VERSION_IRIS2,
+	VPU_VERSION_IRIS2_1,
+};
+
 struct venus_resources {
 	u64 dma_mask;
 	const struct freq_tbl *freq_tbl;
@@ -71,6 +79,7 @@ struct venus_resources {
 	const char * const resets[VIDC_RESETS_NUM_MAX];
 	unsigned int resets_num;
 	enum hfi_version hfi_version;
+	enum vpu_version vpu_version;
 	u8 num_vpp_pipes;
 	u32 max_load;
 	unsigned int vmem_id;
@@ -481,6 +490,12 @@ struct venus_inst {
 #define IS_V4(core)	((core)->res->hfi_version == HFI_VERSION_4XX)
 #define IS_V6(core)	((core)->res->hfi_version == HFI_VERSION_6XX)
 
+#define IS_AR50(core)		((core)->res->vpu_version == VPU_VERSION_AR50)
+#define IS_AR50_LITE(core)	((core)->res->vpu_version == VPU_VERSION_AR50_LITE)
+#define IS_IRIS1(core)		((core)->res->vpu_version == VPU_VERSION_IRIS1)
+#define IS_IRIS2(core)		((core)->res->vpu_version == VPU_VERSION_IRIS2)
+#define IS_IRIS2_1(core)	((core)->res->vpu_version == VPU_VERSION_IRIS2_1)
+
 #define ctrl_to_inst(ctrl)	\
 	container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
 
Signature · 1 line
2.40.1
Reviewed-by on v2 4/18
#11 lore raw

Re: [PATCH v2 04/18] media: venus: Introduce VPU version distinction

Quoted 2 lines · Konrad Dybcio

The Video Processing Unit hardware version is the differentiator, based on which we should decide which code paths to take in hw

we -> video driver

Quoted 1 line

init. Up until now, we've relied on HFI versions, but that was

not just hw init, aspects like power sequence, buffer calculations, etc would

rely on hardware version.

Once the above comments are addressed, you can put

Quoted 50 lines

just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences.

---
  drivers/media/platform/qcom/venus/core.h | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
drivers/media/platform/qcom/venus/core.h +15 -0
index 4f81669986ba..62c310b7dee6 100644
@@ -48,6 +48,14 @@ struct bw_tbl {
  	u32 peak_10bit;
  };
 
+enum vpu_version {
+	VPU_VERSION_AR50,
+	VPU_VERSION_AR50_LITE,
+	VPU_VERSION_IRIS1,
+	VPU_VERSION_IRIS2,
+	VPU_VERSION_IRIS2_1,
+};
+
  struct venus_resources {
  	u64 dma_mask;
  	const struct freq_tbl *freq_tbl;
@@ -71,6 +79,7 @@ struct venus_resources {
  	const char * const resets[VIDC_RESETS_NUM_MAX];
  	unsigned int resets_num;
  	enum hfi_version hfi_version;
+	enum vpu_version vpu_version;
  	u8 num_vpp_pipes;
  	u32 max_load;
  	unsigned int vmem_id;
@@ -481,6 +490,12 @@ struct venus_inst {
  #define IS_V4(core)	((core)->res->hfi_version == HFI_VERSION_4XX)
  #define IS_V6(core)	((core)->res->hfi_version == HFI_VERSION_6XX)
 
+#define IS_AR50(core)		((core)->res->vpu_version == VPU_VERSION_AR50)
+#define IS_AR50_LITE(core)	((core)->res->vpu_version == VPU_VERSION_AR50_LITE)
+#define IS_IRIS1(core)		((core)->res->vpu_version == VPU_VERSION_IRIS1)
+#define IS_IRIS2(core)		((core)->res->vpu_version == VPU_VERSION_IRIS2)
+#define IS_IRIS2_1(core)	((core)->res->vpu_version == VPU_VERSION_IRIS2_1)
+
  #define ctrl_to_inst(ctrl)	\
  	container_of((ctrl)->handler, struct venus_inst, ctrl_handler)
 
#12 lore raw

PATCH v2 5/18 media: venus: Add vpu_version to most SoCs

In reply to Konrad Dybcio

Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching.

---
 drivers/media/platform/qcom/venus/core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/media/platform/qcom/venus/core.c +5 -0
index 2ae867cb4c48..01671dd23888 100644
@@ -684,6 +684,7 @@ static const struct venus_resources sdm845_res = {
 	.vcodec_clks_num = 2,
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
 	.vmem_addr = 0,
@@ -709,6 +710,7 @@ static const struct venus_resources sdm845_res_v2 = {
 	.vcodec_num = 2,
 	.max_load = 3110400,	/* 4096x2160@90 */
 	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
 	.vmem_addr = 0,
@@ -756,6 +758,7 @@ static const struct venus_resources sc7180_res = {
 	.opp_pmdomain = (const char *[]) { "cx", NULL },
 	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
 	.vmem_addr = 0,
@@ -809,6 +812,7 @@ static const struct venus_resources sm8250_res = {
 	.vcodec_num = 1,
 	.max_load = 7833600,
 	.hfi_version = HFI_VERSION_6XX,
+	.vpu_version = VPU_VERSION_IRIS2,
 	.num_vpp_pipes = 4,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
@@ -866,6 +870,7 @@ static const struct venus_resources sc7280_res = {
 	.opp_pmdomain = (const char *[]) { "cx", NULL },
 	.vcodec_num = 1,
 	.hfi_version = HFI_VERSION_6XX,
+	.vpu_version = VPU_VERSION_IRIS2_1,
 	.num_vpp_pipes = 1,
 	.vmem_id = VIDC_RESOURCE_NONE,
 	.vmem_size = 0,
Signature · 1 line
2.40.1
Reviewed-by on v2 5/18
#13 lore raw

Re: [PATCH v2 05/18] media: venus: Add vpu_version to most SoCs

Quoted 5 lines · Konrad Dybcio

Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching.

Quoted 49 lines
---
  drivers/media/platform/qcom/venus/core.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/media/platform/qcom/venus/core.c +5 -0
index 2ae867cb4c48..01671dd23888 100644
@@ -684,6 +684,7 @@ static const struct venus_resources sdm845_res = {
  	.vcodec_clks_num = 2,
  	.max_load = 3110400,	/* 4096x2160@90 */
  	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
  	.vmem_id = VIDC_RESOURCE_NONE,
  	.vmem_size = 0,
  	.vmem_addr = 0,
@@ -709,6 +710,7 @@ static const struct venus_resources sdm845_res_v2 = {
  	.vcodec_num = 2,
  	.max_load = 3110400,	/* 4096x2160@90 */
  	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
  	.vmem_id = VIDC_RESOURCE_NONE,
  	.vmem_size = 0,
  	.vmem_addr = 0,
@@ -756,6 +758,7 @@ static const struct venus_resources sc7180_res = {
  	.opp_pmdomain = (const char *[]) { "cx", NULL },
  	.vcodec_num = 1,
  	.hfi_version = HFI_VERSION_4XX,
+	.vpu_version = VPU_VERSION_AR50,
  	.vmem_id = VIDC_RESOURCE_NONE,
  	.vmem_size = 0,
  	.vmem_addr = 0,
@@ -809,6 +812,7 @@ static const struct venus_resources sm8250_res = {
  	.vcodec_num = 1,
  	.max_load = 7833600,
  	.hfi_version = HFI_VERSION_6XX,
+	.vpu_version = VPU_VERSION_IRIS2,
  	.num_vpp_pipes = 4,
  	.vmem_id = VIDC_RESOURCE_NONE,
  	.vmem_size = 0,
@@ -866,6 +870,7 @@ static const struct venus_resources sc7280_res = {
  	.opp_pmdomain = (const char *[]) { "cx", NULL },
  	.vcodec_num = 1,
  	.hfi_version = HFI_VERSION_6XX,
+	.vpu_version = VPU_VERSION_IRIS2_1,
  	.num_vpp_pipes = 1,
  	.vmem_id = VIDC_RESOURCE_NONE,
  	.vmem_size = 0,
#14 lore raw

PATCH v2 6/18 media: venus: firmware: Leave a clue for homegrown porters

In reply to Konrad Dybcio

Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream..

---
 drivers/media/platform/qcom/venus/firmware.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/media/platform/qcom/venus/firmware.c +7 -0
index cfb11c551167..a4cd919e1dbe 100644
@@ -241,6 +241,13 @@ 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, addr not size)
+		 * 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,
Signature · 1 line
2.40.1
Reviewed-by on v2 6/18
#15 lore raw

Re: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters

Quoted 5 lines · Konrad Dybcio

Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream..

Quoted 9 lines
---
  drivers/media/platform/qcom/venus/firmware.c | 7 +++++++
  1 file changed, 7 insertions(+)
drivers/media/platform/qcom/venus/firmware.c +0 -0
index cfb11c551167..a4cd919e1dbe 100644

drivers/media/platform/qcom/venus/firmware.c int venus_boot(struct venus_core *core) · line 247

Quoted 7 lines
drivers/media/platform/qcom/venus/firmware.c +4 -0
@@ -241,6 +241,13 @@ 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, addr not size)

The field is the start address of ns context bank. Since the cp_start is 0, the start address for (next) non-secure context bank

is interpreted as size of the (previous) content protection region.

Quoted 7 lines
drivers/media/platform/qcom/venus/firmware.c +3 -0
+		 * 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,
#16 lore raw

Re: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters

Quoted 4 lines · Vikash Garodia
Quoted 2 lines · Konrad Dybcio

Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream..

Rephrase the commit text.

Quoted 30 lines
Quoted 2 lines
Quoted 9 lines

---
  drivers/media/platform/qcom/venus/firmware.c | 7 +++++++

  1 file changed, 7 insertions(+)
drivers/media/platform/qcom/venus/firmware.c +0 -0
index cfb11c551167..a4cd919e1dbe 100644

drivers/media/platform/qcom/venus/firmware.c int venus_boot(struct venus_core *core) · line 246

Quoted 6 lines
drivers/media/platform/qcom/venus/firmware.c +4 -0
@@ -241,6 +241,13 @@ 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, addr not size)

The field is the start address of ns context bank. Since the cp_start is 0, the start address for (next) non-secure context bank

is interpreted as size of the (previous) content protection region.

Quoted 7 lines
drivers/media/platform/qcom/venus/firmware.c +3 -0
+         * 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,
 
#17 lore raw

Re: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters

Quoted 7 lines · Vikash Garodia
Quoted 4 lines · Vikash Garodia
Quoted 2 lines · Konrad Dybcio

Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream..

Rephrase the commit text.

Please be more specific, do you want me to use the explanations you gave in the previous reply?

Konrad

Quoted 30 lines
Quoted 30 lines
Quoted 2 lines
Quoted 9 lines

---
  drivers/media/platform/qcom/venus/firmware.c | 7 +++++++

  1 file changed, 7 insertions(+)
drivers/media/platform/qcom/venus/firmware.c +0 -0
index cfb11c551167..a4cd919e1dbe 100644

drivers/media/platform/qcom/venus/firmware.c int venus_boot(struct venus_core *core) · line 246

Quoted 6 lines
drivers/media/platform/qcom/venus/firmware.c +4 -0
@@ -241,6 +241,13 @@ 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, addr not size)

The field is the start address of ns context bank. Since the cp_start is 0, the start address for (next) non-secure context bank

is interpreted as size of the (previous) content protection region.

Quoted 7 lines
drivers/media/platform/qcom/venus/firmware.c +3 -0
+         * 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,
 
#18 lore raw

Re: [PATCH v2 06/18] media: venus: firmware: Leave a clue for homegrown porters

Quoted 4 lines · Konrad Dybcio
Quoted 1 line · Vikash Garodia
Quoted 8 lines
Quoted 6 lines · Vikash Garodia
Quoted 4 lines · Konrad Dybcio
Quoted 2 lines

Leave a clue about where the seemingly magic values come from, as it is not obvious and requires some digging downstream..

Rephrase the commit text.

Please be more specific, do you want me to use the explanations you gave in the previous reply?

Something which describes the patch like - Add comments to describe the arguments of the qcom_scm_mem_protect_video_var TZ call. The TZ call programs the video hardware with CP and non-CP VARs, and the comments describes these VARs.

Quoted 31 lines

Konrad

Quoted 30 lines
Quoted 30 lines
Quoted 2 lines
Quoted 9 lines

---
  drivers/media/platform/qcom/venus/firmware.c | 7 +++++++

  1 file changed, 7 insertions(+)
drivers/media/platform/qcom/venus/firmware.c +0 -0
index cfb11c551167..a4cd919e1dbe 100644

drivers/media/platform/qcom/venus/firmware.c int venus_boot(struct venus_core *core) · line 246

Quoted 6 lines
drivers/media/platform/qcom/venus/firmware.c +4 -0
@@ -241,6 +241,13 @@ 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, addr not size)

The field is the start address of ns context bank. Since the cp_start is 0, the start address for (next) non-secure context bank

is interpreted as size of the (previous) content protection region.

Quoted 7 lines
drivers/media/platform/qcom/venus/firmware.c +3 -0
+         * 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,
 
#19 lore raw

PATCH v2 7/18 media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-version

In reply to Konrad Dybcio

The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account.

---
 drivers/media/platform/qcom/venus/hfi_venus.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +6 -4
index 8fc8f46dc390..9b840440a115 100644
@@ -447,19 +447,20 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 {
 	struct device *dev = hdev->core->dev;
 	static const unsigned int max_tries = 100;
-	u32 ctrl_status = 0, mask_val;
+	u32 ctrl_status = 0, mask_val = 0;
 	unsigned int count = 0;
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	void __iomem *wrapper_base = hdev->core->wrapper_base;
 	int ret = 0;
 
-	if (IS_V6(hdev->core)) {
+	if (IS_IRIS1(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) {
 		mask_val = readl(wrapper_base + WRAPPER_INTR_MASK);
 		mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 |
 			      WRAPPER_INTR_MASK_A2HCPU_MASK);
 	} else {
 		mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK;
 	}
+
 	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
 	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
@@ -479,10 +480,11 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	if (count >= max_tries)
 		ret = -ETIMEDOUT;
 
-	if (IS_V6(hdev->core)) {
+	if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
 		writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6);
+
+	if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
 		writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6);
-	}
 
 	return ret;
 }
Signature · 1 line
2.40.1
#20 lore raw

PATCH v2 8/18 media: venus: core: Assign registers based on VPU version

In reply to Konrad Dybcio

IRIS2(_1) has a different register map compared to other HFI6XX- using VPUs. AR50L uses the same offsets, but doesn't feature vbif_base and aon_base. Take care of it.

---
 drivers/media/platform/qcom/venus/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/qcom/venus/core.c +3 -3
index 01671dd23888..51cead91571d 100644
@@ -246,14 +246,14 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type)
 
 static void venus_assign_register_offsets(struct venus_core *core)
 {
-	if (IS_V6(core)) {
-		core->vbif_base = core->base + VBIF_BASE;
+	if (IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)) {
+		core->vbif_base = IS_AR50_LITE(core) ? NULL : core->base + VBIF_BASE;
 		core->cpu_base = core->base + CPU_BASE_V6;
 		core->cpu_cs_base = core->base + CPU_CS_BASE_V6;
 		core->cpu_ic_base = core->base + CPU_IC_BASE_V6;
 		core->wrapper_base = core->base + WRAPPER_BASE_V6;
 		core->wrapper_tz_base = core->base + WRAPPER_TZ_BASE_V6;
-		core->aon_base = core->base + AON_BASE_V6;
+		core->aon_base = IS_AR50_LITE(core) ? NULL : core->base + AON_BASE_V6;
 	} else {
 		core->vbif_base = core->base + VBIF_BASE;
 		core->cpu_base = core->base + CPU_BASE;
Signature · 1 line
2.40.1
#21 lore raw

PATCH v2 9/18 media: venus: hfi_venus: Fix version checks in venus_halt_axi()

In reply to Konrad Dybcio

Only IRIS2(_1) should enter the until-now-IS_V6() path and the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that.

Fixes 4b0b6e147dc9 ("media: venus: hfi: Add 6xx AXI halt logic")
Fixes 78d434ba8659 ("media: venus: hfi: Skip AON register programming for V6 1pipe")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -2
index 9b840440a115..ca56b1a8eb71 100644
@@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
 	u32 mask_val;
 	int ret;
 
-	if (IS_V6(hdev->core)) {
+	if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) {
 		writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
 
-		if (hdev->core->res->num_vpp_pipes == 1)
+		if (IS_IRIS2_1(hdev->core))
 			goto skip_aon_mvp_noc;
 
 		writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
Signature · 1 line
2.40.1
#22 lore raw

Re: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi()

Quoted 3 lines · Konrad Dybcio

Only IRIS2(_1) should enter the until-now-IS_V6() path and the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that.

Do not see any issue with existing code. IRIS2 with single pipe is IRIS2_1. This does not

quality as a fix to earlier implementation. Since this series introduces VPU versions,

IRIS2 with 1 pipe is being replaced with IRIS2_1.

-Vikash

Quoted 26 lines
Fixes 4b0b6e147dc9 ("media: venus: hfi: Add 6xx AXI halt logic")
Fixes 78d434ba8659 ("media: venus: hfi: Skip AON register programming for V6 1pipe")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -2
index 9b840440a115..ca56b1a8eb71 100644
@@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
  	u32 mask_val;
  	int ret;
 
-	if (IS_V6(hdev->core)) {
+	if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) {
  		writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
 
-		if (hdev->core->res->num_vpp_pipes == 1)
+		if (IS_IRIS2_1(hdev->core))
  			goto skip_aon_mvp_noc;
 
  		writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
#23 lore raw

Re: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi()

Quoted 7 lines · Vikash Garodia
Quoted 3 lines · Konrad Dybcio

Only IRIS2(_1) should enter the until-now-IS_V6() path and the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that.

Quoted 7 lines

Do not see any issue with existing code. IRIS2 with single pipe is IRIS2_1. This does not

quality as a fix to earlier implementation. Since this series introduces VPU versions,

IRIS2 with 1 pipe is being replaced with IRIS2_1.

Could you please fix the line wrapping of your emails. It becomes hard to read them otherwise.

Signature · 2 lines
With best wishes
Dmitry
#24 lore raw

Re: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi()

Quoted 9 lines · Dmitry Baryshkov
Quoted 8 lines · Vikash Garodia
Quoted 3 lines · Konrad Dybcio

Only IRIS2(_1) should enter the until-now-IS_V6() path and the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that.

Do not see any issue with existing code. IRIS2 with single pipe is IRIS2_1. This does not

Quoted 6 lines
Quoted 4 lines

quality as a fix to earlier implementation. Since this series introduces VPU versions,

IRIS2 with 1 pipe is being replaced with IRIS2_1.

Could you please fix the line wrapping of your emails. It becomes hard to read them otherwise.

My apologies for the inconvenience. Tried to set the email wrap config, but it does not take

an effect on my email client. Will try playing around a bit with it and fix it.

Meanwhile go through the comments and if you can align them with minimal effort, we

can continue to discuss on the same.

-Vikash

Quoted 2 lines
#25 lore raw

Re: [PATCH v2 09/18] media: venus: hfi_venus: Fix version checks in venus_halt_axi()

In reply to Vikash Garodia
Quoted 6 lines · Vikash Garodia
Quoted 3 lines · Konrad Dybcio

Only IRIS2(_1) should enter the until-now-IS_V6() path and the condition for skipping part of it should be IS_IRIS2_1 and not the number of VPP pipes. Fix that.

Quoted 7 lines

Do not see any issue with existing code. IRIS2 with single pipe is IRIS2_1. This does not

quality as a fix to earlier implementation. Since this series introduces VPU versions,

IRIS2 with 1 pipe is being replaced with IRIS2_1.

-Vikash

Right, I'll drop the fixes tags.

Also, your email client seems to be inserting 2 newlines instead of 1. If you're using thunderbird, you may want to edit:

mail.identity.(default or your mail identity idx).default.compose_html

to false

or you can use shift+enter as a half-measure

Konrad

Quoted 24 lines
Quoted 24 lines
Fixes 4b0b6e147dc9 ("media: venus: hfi: Add 6xx AXI halt logic")
Fixes 78d434ba8659 ("media: venus: hfi: Skip AON register programming for V6 1pipe")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -0
index 9b840440a115..ca56b1a8eb71 100644
@@ -549,10 +549,10 @@ static int venus_halt_axi(struct venus_hfi_device *hdev)
       u32 mask_val;
       int ret;
   -    if (IS_V6(hdev->core)) {
+    if (IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core)) {
           writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6);
   -        if (hdev->core->res->num_vpp_pipes == 1)
+        if (IS_IRIS2_1(hdev->core))
               goto skip_aon_mvp_noc;
             writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL);
 
#26 lore raw

PATCH v2 10/18 media: venus: hfi_venus: Fix version checks in venus_isr()

In reply to Konrad Dybcio

IS_V6 was used there IS_IRIS2(_1) should have been and the !IS_V6 condition was only correct by luck and for now. Replace them both with VPU version checks.

Fixes 24fcc0522d87 ("media: venus: hfi: Add 6xx interrupt support")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -2
index ca56b1a8eb71..6d5906fab800 100644
@@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
 	wrapper_base = hdev->core->wrapper_base;
 
 	status = readl(wrapper_base + WRAPPER_INTR_STATUS);
-	if (IS_V6(core)) {
+	if (IS_IRIS2(core) || IS_IRIS2_1(core)) {
 		if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
 		    status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 ||
 		    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
@@ -1142,7 +1142,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
 			hdev->irq_status = status;
 	}
 	writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR);
-	if (!IS_V6(core))
+	if (!(IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)))
 		writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
 
 	return IRQ_WAKE_THREAD;
Signature · 1 line
2.40.1
#27 lore raw

Re: [PATCH v2 10/18] media: venus: hfi_venus: Fix version checks in venus_isr()

Quoted 3 lines · Konrad Dybcio

IS_V6 was used there IS_IRIS2(_1) should have been and the !IS_V6 condition was only correct by luck and for now. Replace them both with VPU version checks.

Existing video driver supports IRIS2(_1) under V6 category. What is meant by

!IS_V6 condition was correct by luck ?

-Vikash

Quoted 30 lines
Fixes 24fcc0522d87 ("media: venus: hfi: Add 6xx interrupt support")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -2
index ca56b1a8eb71..6d5906fab800 100644
@@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
  	wrapper_base = hdev->core->wrapper_base;
 
  	status = readl(wrapper_base + WRAPPER_INTR_STATUS);
-	if (IS_V6(core)) {
+	if (IS_IRIS2(core) || IS_IRIS2_1(core)) {
  		if (status & WRAPPER_INTR_STATUS_A2H_MASK ||
  		    status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 ||
  		    status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)
@@ -1142,7 +1142,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
  			hdev->irq_status = status;
  	}
  	writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR);
-	if (!IS_V6(core))
+	if (!(IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)))
  		writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
 
  	return IRQ_WAKE_THREAD;
#28 lore raw

Re: [PATCH v2 10/18] media: venus: hfi_venus: Fix version checks in venus_isr()

Quoted 9 lines · Vikash Garodia
Quoted 3 lines · Konrad Dybcio

IS_V6 was used there IS_IRIS2(_1) should have been and the !IS_V6 condition was only correct by luck and for now. Replace them both with VPU version checks.

Existing video driver supports IRIS2(_1) under V6 category. What is meant by

!IS_V6 condition was correct by luck ?

Right, I didn't quite think of it this way. I probably meant "it works just because there are no other HFIv6 cores supported", but that might have just as well been a design choice. I'll reword and drop fixes.

Konrad

Quoted 31 lines

-Vikash

Quoted 28 lines
Fixes 24fcc0522d87 ("media: venus: hfi: Add 6xx interrupt support")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index ca56b1a8eb71..6d5906fab800 100644
@@ -1130,7 +1130,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
       wrapper_base = hdev->core->wrapper_base;
         status = readl(wrapper_base + WRAPPER_INTR_STATUS);
-    if (IS_V6(core)) {
+    if (IS_IRIS2(core) || IS_IRIS2_1(core)) {

          if (status & WRAPPER_INTR_STATUS_A2H_MASK || status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 || status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK)

drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
@@ -1142,7 +1142,7 @@ static irqreturn_t venus_isr(struct venus_core *core)
               hdev->irq_status = status;
       }
       writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR);
-    if (!IS_V6(core))
+    if (!(IS_AR50_LITE(core) || IS_IRIS2(core) || IS_IRIS2_1(core)))
           writel(status, wrapper_base + WRAPPER_INTR_CLEAR);
         return IRQ_WAKE_THREAD;
 
#29 lore raw

PATCH v2 11/18 media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle()

In reply to Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index 6d5906fab800..82aa7deeafa1 100644
@@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	if (IS_V6(hdev->core))
+	if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
 		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
 	else
 		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
Signature · 1 line
2.40.1
#30 lore raw

Re: [PATCH v2 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle()

Quoted 1 line · Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

This is again not a fix. The patch just adds a video hardware AR50_LITE, which is

not supported on existing driver yet. With existing code, IS_V6 covers the video

hardwares which are enabled by the driver.

-Vikash

Quoted 21 lines
Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index 6d5906fab800..82aa7deeafa1 100644
@@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
  	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
  	u32 ctrl_status, cpu_status;
 
-	if (IS_V6(hdev->core))
+	if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
  		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
  	else
  		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
#31 lore raw

Re: [PATCH v2 11/18] media: venus: hfi_venus: Fix version check in venus_cpu_and_video_core_idle()

Quoted 9 lines · Vikash Garodia
Quoted 1 line · Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

This is again not a fix. The patch just adds a video hardware AR50_LITE, which is

not supported on existing driver yet. With existing code, IS_V6 covers the video

hardwares which are enabled by the driver.

ack

Konrad

Quoted 23 lines

-Vikash

Quoted 20 lines
Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
index 6d5906fab800..82aa7deeafa1 100644
@@ -1537,7 +1537,7 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev)
       void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
       u32 ctrl_status, cpu_status;
   -    if (IS_V6(hdev->core))
+    if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
           cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);

      else
          cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);

#32 lore raw

PATCH v2 12/18 media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready()

In reply to Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")
---
 drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index 82aa7deeafa1..d6df99a921bb 100644
@@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev)
 	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
 	u32 ctrl_status, cpu_status;
 
-	if (IS_V6(hdev->core))
+	if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
 		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
 	else
 		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
Signature · 1 line
2.40.1
#33 lore raw

Re: [PATCH v2 12/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready()

Quoted 1 line · Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

This is again not a fix. The patch just adds a video hardware AR50_LITE, which is

not supported on existing driver yet. With existing code, IS_V6 covers the video

hardwares which are enabled by the driver.

-Vikash

Quoted 21 lines
Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")
---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -1
index 82aa7deeafa1..d6df99a921bb 100644
@@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev)
  	void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
  	u32 ctrl_status, cpu_status;
 
-	if (IS_V6(hdev->core))
+	if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
  		cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);
  	else
  		cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);
#34 lore raw

Re: [PATCH v2 12/18] media: venus: hfi_venus: Fix version check in venus_cpu_idle_and_pc_ready()

Quoted 9 lines · Vikash Garodia
Quoted 1 line · Konrad Dybcio

IS_V6() should have instead checked for specific VPU versions. Fix it.

This is again not a fix. The patch just adds a video hardware AR50_LITE, which is

not supported on existing driver yet. With existing code, IS_V6 covers the video

hardwares which are enabled by the driver.

-Vikash

Ack

Konrad

Quoted 20 lines
Quoted 20 lines
Fixes e396e75fc254 ("media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx")

---
  drivers/media/platform/qcom/venus/hfi_venus.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +1 -0
index 82aa7deeafa1..d6df99a921bb 100644
@@ -1557,7 +1557,7 @@ static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev)
       void __iomem *cpu_cs_base = hdev->core->cpu_cs_base;
       u32 ctrl_status, cpu_status;
   -    if (IS_V6(hdev->core))
+    if (IS_AR50_LITE(hdev->core) || IS_IRIS2(hdev->core) || IS_IRIS2_1(hdev->core))
           cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6);

      else
          cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS);

#35 lore raw

PATCH v2 13/18 media: venus: firmware: Correct IS_V6() checks

In reply to Konrad Dybcio

Most of these checks should have checked for TZ presence (or well, absence), as we shouldn't really be doing things that the black box does for us on non-CrOS platforms.

The IS_V6() check in venus_shutdown_no_tz() should have checked whether the core version is IRIS2_1 (so, SC7280). Fix that.

Fixes afeae6ef0780 ("media: venus: firmware: enable no tz fw loading for sc7280")
---
 drivers/media/platform/qcom/venus/firmware.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/firmware.c +8 -4
index a4cd919e1dbe..be59f2017155 100644
@@ -29,7 +29,11 @@ static void venus_reset_cpu(struct venus_core *core)
 	u32 fw_size = core->fw.mapped_mem_size;
 	void __iomem *wrapper_base;
 
-	if (IS_V6(core))
+	/*
+	 * When there's no Qualcomm TZ (like on Chromebooks), the OS is
+	 * responsible for bringing up the hardware instead.
+	 */
+	if (!core->use_tz)
 		wrapper_base = core->wrapper_tz_base;
 	else
 		wrapper_base = core->wrapper_base;
@@ -41,7 +45,7 @@ static void venus_reset_cpu(struct venus_core *core)
 	writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR);
 	writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR);
 
-	if (IS_V6(core)) {
+	if (!core->use_tz) {
 		/* Bring XTSS out of reset */
 		writel(0, wrapper_base + WRAPPER_TZ_XTSS_SW_RESET);
 	} else {
@@ -67,7 +71,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume)
 	if (resume) {
 		venus_reset_cpu(core);
 	} else {
-		if (IS_V6(core))
+		if (!core->use_tz)
 			writel(WRAPPER_XTSS_SW_RESET_BIT,
 			       core->wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
 		else
@@ -179,7 +183,7 @@ static int venus_shutdown_no_tz(struct venus_core *core)
 	void __iomem *wrapper_base = core->wrapper_base;
 	void __iomem *wrapper_tz_base = core->wrapper_tz_base;
 
-	if (IS_V6(core)) {
+	if (IS_IRIS2_1(core)) {
 		/* Assert the reset to XTSS */
 		reg = readl(wrapper_tz_base + WRAPPER_TZ_XTSS_SW_RESET);
 		reg |= WRAPPER_XTSS_SW_RESET_BIT;
Signature · 1 line
2.40.1
#36 lore raw

PATCH v2 14/18 media: venus: hfi_platform: Check vpu_version instead of device compatible

In reply to Konrad Dybcio

This is not a matter of the host SoC, but the VPU chip in Venus. Fix it.

---
 drivers/media/platform/qcom/venus/hfi_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_platform.c +1 -1
index f07f554bc5fe..d163d5b0e6b7 100644
@@ -80,7 +80,7 @@ hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codec
 	if (plat->codecs)
 		plat->codecs(enc_codecs, dec_codecs, count);
 
-	if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) {
+	if (IS_IRIS2_1(core)) {
 		*enc_codecs &= ~HFI_VIDEO_CODEC_VP8;
 		*dec_codecs &= ~HFI_VIDEO_CODEC_VP8;
 	}
Signature · 1 line
2.40.1
Reviewed-by on v2 14/18
#37 lore raw

Re: [PATCH v2 14/18] media: venus: hfi_platform: Check vpu_version instead of device compatible

Quoted 4 lines · Konrad Dybcio

This is not a matter of the host SoC, but the VPU chip in Venus. Fix it.

Quoted 18 lines
---
  drivers/media/platform/qcom/venus/hfi_platform.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_platform.c +1 -1
index f07f554bc5fe..d163d5b0e6b7 100644
@@ -80,7 +80,7 @@ hfi_platform_get_codecs(struct venus_core *core, u32 *enc_codecs, u32 *dec_codec
  	if (plat->codecs)
  		plat->codecs(enc_codecs, dec_codecs, count);
 
-	if (of_device_is_compatible(core->dev->of_node, "qcom,sc7280-venus")) {
+	if (IS_IRIS2_1(core)) {
  		*enc_codecs &= ~HFI_VIDEO_CODEC_VP8;
  		*dec_codecs &= ~HFI_VIDEO_CODEC_VP8;
  	}
#38 lore raw

PATCH v2 15/18 media: venus: vdec: Fix version check in vdec_set_work_route()

In reply to Konrad Dybcio

This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it.

Fixes 6483a8cbea54 ("media: venus: vdec: set work route to fw")
---
 drivers/media/platform/qcom/venus/vdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/vdec.c +1 -1
index 51a53bf82bd3..33e3f7208b1a 100644
@@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst)
 	u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE;
 	struct hfi_video_work_route wr;
 
-	if (!IS_V6(inst->core))
+	if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core)))
 		return 0;
 
 	wr.video_work_route = inst->core->res->num_vpp_pipes;
Signature · 1 line
2.40.1
#39 lore raw

Re: [PATCH v2 15/18] media: venus: vdec: Fix version check in vdec_set_work_route()

Quoted 1 line · Konrad Dybcio

This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it.

Again, why is it marked as fix ?

Quoted 13 lines
Fixes 6483a8cbea54 ("media: venus: vdec: set work route to fw")
---
  drivers/media/platform/qcom/venus/vdec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/vdec.c +0 -0
index 51a53bf82bd3..33e3f7208b1a 100644

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_work_route(struct venus_inst *inst) · line 704

Quoted 5 lines
drivers/media/platform/qcom/venus/vdec.c +1 -1
@@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst)
  	u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE;
  	struct hfi_video_work_route wr;
 
-	if (!IS_V6(inst->core))
+	if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core)))

Not a good idea to add IRIS1 just for deciding work route and not at other places in driver. Add IRIS1 relevant

code in other aspects as well, if the patch needs to handle anything w.r.t IRIS1.

Quoted 4 lines
drivers/media/platform/qcom/venus/vdec.c +0 -0
  		return 0;
 
  	wr.video_work_route = inst->core->res->num_vpp_pipes;
#40 lore raw

Re: [PATCH v2 15/18] media: venus: vdec: Fix version check in vdec_set_work_route()

Quoted 4 lines · Vikash Garodia
Quoted 1 line · Konrad Dybcio

This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it.

Again, why is it marked as fix ?

It corrects the logic but does not manifest on currently supported hardware. I'll reword it and drop the fixes tag.

Quoted 20 lines
Quoted 13 lines
Fixes 6483a8cbea54 ("media: venus: vdec: set work route to fw")

---
  drivers/media/platform/qcom/venus/vdec.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/vdec.c +0 -0
index 51a53bf82bd3..33e3f7208b1a 100644

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_work_route(struct venus_inst *inst) · line 704

Quoted 4 lines
drivers/media/platform/qcom/venus/vdec.c +1 -0
@@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst)
       u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE;
       struct hfi_video_work_route wr;
   -    if (!IS_V6(inst->core))
+    if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core)))

Not a good idea to add IRIS1 just for deciding work route and not at other places in driver. Add IRIS1 relevant

Quoted 1 line

code in other aspects as well, if the patch needs to handle anything w.r.t IRIS1.

I'd say that correcting this condition is fair regardless. I can however delay this patch until IRIS1 enablement if you'd prefer that.

Konrad

Quoted 4 lines
Quoted 4 lines
drivers/media/platform/qcom/venus/vdec.c +0 -0
           return 0;
         wr.video_work_route = inst->core->res->num_vpp_pipes;
 
#41 lore raw

Re: [PATCH v2 15/18] media: venus: vdec: Fix version check in vdec_set_work_route()

Quoted 30 lines · Konrad Dybcio
Quoted 4 lines · Vikash Garodia
Quoted 1 line · Konrad Dybcio

This is not so much V6-dependent as it's IRIS(1|2|2_1). Fix it.

Again, why is it marked as fix ?

It corrects the logic but does not manifest on currently supported hardware. I'll reword it and drop the fixes tag.

Quoted 20 lines
Quoted 13 lines
Fixes 6483a8cbea54 ("media: venus: vdec: set work route to fw")

---
  drivers/media/platform/qcom/venus/vdec.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/venus/vdec.c +0 -0
index 51a53bf82bd3..33e3f7208b1a 100644

drivers/media/platform/qcom/venus/vdec.c static int vdec_set_work_route(struct venus_inst *inst) · line 704

Quoted 4 lines
drivers/media/platform/qcom/venus/vdec.c +1 -0
@@ -701,7 +701,7 @@ static int vdec_set_work_route(struct venus_inst *inst)
       u32 ptype = HFI_PROPERTY_PARAM_WORK_ROUTE;
       struct hfi_video_work_route wr;
   -    if (!IS_V6(inst->core))
+    if (!(IS_IRIS1(inst->core) || IS_IRIS2(inst->core) || IS_IRIS2_1(inst->core)))

Not a good idea to add IRIS1 just for deciding work route and not at other places in driver. Add IRIS1 relevant

Quoted 4 lines
Quoted 1 line

code in other aspects as well, if the patch needs to handle anything w.r.t IRIS1.

I'd say that correcting this condition is fair regardless. I can however delay this patch until IRIS1 enablement if you'd prefer that.

Lets add IRIS1 along with other IRIS1 changes.

Quoted 5 lines

Konrad

Quoted 4 lines
Quoted 4 lines
drivers/media/platform/qcom/venus/vdec.c +0 -0
           return 0;
         wr.video_work_route = inst->core->res->num_vpp_pipes;
 
#42 lore raw

PATCH v2 16/18 media: venus: Introduce accessors for remapped hfi_buffer_reqs members

In reply to Konrad Dybcio

Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that.

---
 drivers/media/platform/qcom/venus/helpers.c    |  2 +-
 drivers/media/platform/qcom/venus/hfi_helper.h | 64 +++++++++++++++++++++-----
 drivers/media/platform/qcom/venus/hfi_msgs.c   |  2 +-
 drivers/media/platform/qcom/venus/vdec.c       |  8 ++--
 drivers/media/platform/qcom/venus/vdec_ctrls.c |  2 +-
 drivers/media/platform/qcom/venus/venc.c       |  4 +-
 drivers/media/platform/qcom/venus/venc_ctrls.c |  2 +-
 7 files changed, 63 insertions(+), 21 deletions(-)
drivers/media/platform/qcom/venus/helpers.c +1 -1
index a2ceab7f9ddb..1ce2624abc12 100644
@@ -189,7 +189,7 @@ int venus_helper_alloc_dpb_bufs(struct venus_inst *inst)
 	if (ret)
 		return ret;
 
-	count = HFI_BUFREQ_COUNT_MIN(&bufreq, ver);
+	count = hfi_bufreq_get_count_min(&bufreq, ver);
 
 	for (i = 0; i < count; i++) {
 		buf = kzalloc(sizeof(*buf), GFP_KERNEL);
drivers/media/platform/qcom/venus/hfi_helper.h +53 -11

76 lines not on this page · raw message

drivers/media/platform/qcom/venus/hfi_msgs.c +1 -1
index df96db3761a7..c320ebbdb24e 100644
@@ -99,7 +99,7 @@ static void event_seq_changed(struct venus_core *core, struct venus_inst *inst,
 		case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS:
 			data_ptr += sizeof(u32);
 			bufreq = (struct hfi_buffer_requirements *)data_ptr;
-			event.buf_count = HFI_BUFREQ_COUNT_MIN(bufreq, ver);
+			event.buf_count = hfi_bufreq_get_count_min(bufreq, ver);
 			data_ptr += sizeof(*bufreq);
 			break;
 		case HFI_INDEX_EXTRADATA_INPUT_CROP:
drivers/media/platform/qcom/venus/vdec.c +4 -4
index 33e3f7208b1a..2f0a95860c94 100644
@@ -870,13 +870,13 @@ static int vdec_num_buffers(struct venus_inst *inst, unsigned int *in_num,
 	if (ret)
 		return ret;
 
-	*in_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver);
+	*in_num = hfi_bufreq_get_count_min(&bufreq, ver);
 
 	ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq);
 	if (ret)
 		return ret;
 
-	*out_num = HFI_BUFREQ_COUNT_MIN(&bufreq, ver);
+	*out_num = hfi_bufreq_get_count_min(&bufreq, ver);
 
 	return 0;
 }
@@ -990,14 +990,14 @@ static int vdec_verify_conf(struct venus_inst *inst)
 		return ret;
 
 	if (inst->num_output_bufs < bufreq.count_actual ||
-	    inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver))
+	    inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver))
 		return -EINVAL;
 
 	ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq);
 	if (ret)
 		return ret;
 
-	if (inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver))
+	if (inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver))
 		return -EINVAL;
 
 	return 0;
drivers/media/platform/qcom/venus/vdec_ctrls.c +1 -1
index fbe12a608b21..7e0f29bf7fae 100644
@@ -79,7 +79,7 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_MIN_BUFFERS_FOR_CAPTURE:
 		ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq);
 		if (!ret)
-			ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver);
+			ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver);
 		break;
 	default:
 		return -EINVAL;
drivers/media/platform/qcom/venus/venc.c +2 -2
index 4666f42feea3..42cbb1619463 100644
@@ -1202,7 +1202,7 @@ static int venc_verify_conf(struct venus_inst *inst)
 		return ret;
 
 	if (inst->num_output_bufs < bufreq.count_actual ||
-	    inst->num_output_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver))
+	    inst->num_output_bufs < hfi_bufreq_get_count_min(&bufreq, ver))
 		return -EINVAL;
 
 	ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq);
@@ -1210,7 +1210,7 @@ static int venc_verify_conf(struct venus_inst *inst)
 		return ret;
 
 	if (inst->num_input_bufs < bufreq.count_actual ||
-	    inst->num_input_bufs < HFI_BUFREQ_COUNT_MIN(&bufreq, ver))
+	    inst->num_input_bufs < hfi_bufreq_get_count_min(&bufreq, ver))
 		return -EINVAL;
 
 	return 0;
drivers/media/platform/qcom/venus/venc_ctrls.c +1 -1
index 7468e43800a9..d9d2a293f3ef 100644
@@ -358,7 +358,7 @@ static int venc_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT:
 		ret = venus_helper_get_bufreq(inst, HFI_BUFFER_INPUT, &bufreq);
 		if (!ret)
-			ctrl->val = HFI_BUFREQ_COUNT_MIN(&bufreq, ver);
+			ctrl->val = hfi_bufreq_get_count_min(&bufreq, ver);
 		break;
 	default:
 		return -EINVAL;
Signature · 1 line
2.40.1
#43 lore raw

PATCH v2 17/18 media: venus: Use newly-introduced hfi_buffer_requirements accessors

In reply to Konrad Dybcio

Now that we have a way which is independent of the HFI version to set the correct fields in hfi_buffer_requirements, use it!

---
 drivers/media/platform/qcom/venus/helpers.c        |  5 +++--
 .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   | 22 +++++++++++-----------
 2 files changed, 14 insertions(+), 13 deletions(-)
drivers/media/platform/qcom/venus/helpers.c +3 -2
index 1ce2624abc12..0268129ab9ac 100644
@@ -667,6 +667,7 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
 			    struct hfi_buffer_requirements *req)
 {
 	u32 ptype = HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS;
+	enum hfi_version ver = inst->core->res->hfi_version;
 	union hfi_get_property hprop;
 	unsigned int i;
 	int ret;
@@ -674,12 +675,12 @@ int venus_helper_get_bufreq(struct venus_inst *inst, u32 type,
 	memset(req, 0, sizeof(*req));
 
 	if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2)
-		req->count_min = inst->fw_min_cnt;
+		hfi_bufreq_set_count_min(req, ver, inst->fw_min_cnt);
 
 	ret = platform_get_bufreq(inst, type, req);
 	if (!ret) {
 		if (type == HFI_BUFFER_OUTPUT || type == HFI_BUFFER_OUTPUT2)
-			inst->fw_min_cnt = req->count_min;
+			inst->fw_min_cnt = hfi_bufreq_get_count_min(req, ver);
 		return 0;
 	}
 
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +11 -11
index a9be31ec6927..5eb4032bc551 100644
@@ -1214,25 +1214,25 @@ static int bufreq_dec(struct hfi_plat_buffers_params *params, u32 buftype,
 
 	out_min_count = output_buffer_count(VIDC_SESSION_TYPE_DEC, codec);
 	/* Max of driver and FW count */
-	out_min_count = max(out_min_count, bufreq->count_min);
+	out_min_count = max(out_min_count, hfi_bufreq_get_count_min(bufreq, version));
 
 	bufreq->type = buftype;
 	bufreq->region_size = 0;
-	bufreq->count_min = 1;
 	bufreq->count_actual = 1;
-	bufreq->hold_count = 1;
+	hfi_bufreq_set_count_min(bufreq, version, 1);
+	hfi_bufreq_set_count_min_host(bufreq, version, 1);
 	bufreq->contiguous = 1;
 	bufreq->alignment = 256;
 
 	if (buftype == HFI_BUFFER_INPUT) {
-		bufreq->count_min = MIN_INPUT_BUFFERS;
+		hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS);
 		bufreq->size =
 			calculate_dec_input_frame_size(width, height, codec,
 						       max_mbs_per_frame,
 						       buffer_size_limit);
 	} else if (buftype == HFI_BUFFER_OUTPUT ||
 		   buftype == HFI_BUFFER_OUTPUT2) {
-		bufreq->count_min = out_min_count;
+		hfi_bufreq_set_count_min(bufreq, version, out_min_count);
 		bufreq->size =
 			venus_helper_get_framesz_raw(params->hfi_color_fmt,
 						     width, height);
@@ -1264,7 +1264,7 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype,
 	u32 work_mode = params->enc.work_mode;
 	u32 rc_type = params->enc.rc_type;
 	u32 num_vpp_pipes = params->num_vpp_pipes;
-	u32 num_ref;
+	u32 num_ref, count_min;
 
 	switch (codec) {
 	case V4L2_PIX_FMT_H264:
@@ -1284,21 +1284,21 @@ static int bufreq_enc(struct hfi_plat_buffers_params *params, u32 buftype,
 
 	bufreq->type = buftype;
 	bufreq->region_size = 0;
-	bufreq->count_min = 1;
 	bufreq->count_actual = 1;
-	bufreq->hold_count = 1;
+	hfi_bufreq_set_count_min(bufreq, version, 1);
+	hfi_bufreq_set_count_min_host(bufreq, version, 1);
 	bufreq->contiguous = 1;
 	bufreq->alignment = 256;
 
 	if (buftype == HFI_BUFFER_INPUT) {
-		bufreq->count_min = MIN_INPUT_BUFFERS;
+		hfi_bufreq_set_count_min(bufreq, version, MIN_INPUT_BUFFERS);
 		bufreq->size =
 			venus_helper_get_framesz_raw(params->hfi_color_fmt,
 						     width, height);
 	} else if (buftype == HFI_BUFFER_OUTPUT ||
 		   buftype == HFI_BUFFER_OUTPUT2) {
-		bufreq->count_min =
-			output_buffer_count(VIDC_SESSION_TYPE_ENC, codec);
+		count_min = output_buffer_count(VIDC_SESSION_TYPE_ENC, codec);
+		hfi_bufreq_set_count_min(bufreq, version, count_min);
 		bufreq->size = calculate_enc_output_frame_size(width, height,
 							       rc_type);
 	} else if (buftype == HFI_BUFFER_INTERNAL_SCRATCH(version)) {
Signature · 1 line
2.40.1
#44 lore raw

PATCH v2 18/18 media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2

In reply to Konrad Dybcio

This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition.

Does not seem to have any adverse effects on at least SM8250.

---
 drivers/media/platform/qcom/venus/hfi_venus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/qcom/venus/hfi_venus.c +2 -1
index d6df99a921bb..6405771568d1 100644
@@ -462,7 +462,8 @@ static int venus_boot_core(struct venus_hfi_device *hdev)
 	}
 
 	writel(mask_val, wrapper_base + WRAPPER_INTR_MASK);
-	writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
+	if (IS_V1(hdev->core))
+		writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3);
 
 	writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT);
 	while (!ctrl_status && count < max_tries) {
Signature · 1 line
2.40.1
#45 lore raw
In reply to Konrad Dybcio
Quoted 1 line · Konrad Dybcio

Tested on 8250, but pretty please test it on your boards too!

What's the definition of test here ?

I ran this

ffplay -codec:video h264_v4l2m2m FantasticFour-ROTSS.mp4

and this

ffplay -codec:video vp8_v4l2m2m /mnt/big-buck-bunny_trailer.webm

on db410c with no errors. Then again I applied and disapplied the 8x8 264 fix to that branch and saw no discernable difference so I'm not very confident we have good coverage.

@Stan @Vikash could you give some suggested tests for coverage here ?

@Konrad - get a db410c !

My superficial first-pass on this series looks good but, before giving a Tested-by here, I think we should define a set of coverage tests, run them - the upper end on sm8250 and lower end msm8916 "makes sense to me"

20? different gstreamer tests at different formats and different sizes on our selected platforms db410c, rb5, rb3 I have - also an 820 I haven't booted and an enforce sdm660.

Which tests will we use to validate this series and subsequent series to ensure we don't have more regressions ?

---
bod

#46 lore raw
Quoted 11 lines · Bryan O'Donoghue
Quoted 1 line · Konrad Dybcio

Tested on 8250, but pretty please test it on your boards too!

What's the definition of test here ?

I ran this

ffplay -codec:video h264_v4l2m2m FantasticFour-ROTSS.mp4

and this

Quoted 7 lines

ffplay -codec:video vp8_v4l2m2m /mnt/big-buck-bunny_trailer.webm

on db410c with no errors. Then again I applied and disapplied the 8x8 264 fix to that branch and saw no discernable difference so I'm not very confident we have good coverage.

@Stan @Vikash could you give some suggested tests for coverage here ?

I could think of below test aspects for this series
1. Suspend Resume
2. Concurrency test
3. Module load -> video usecase -> module unload -> module load -> video usecase. This would ensure video firmware is reloaded and functional.
4. Video playback and encode for all supported resolution and codecs.
5. In general, video playback with more test content.

I would be testing the series with stability test suite on CrOS. That would be either on sc7180 or sc7280 setup.

Konrad, you can post the new version as one patch needs to be dropped. Test can be done on the new version. There are few patches in the series pending review, which can be done in parallel.

-Vikash

Quoted 16 lines

@Konrad - get a db410c !

My superficial first-pass on this series looks good but, before giving a Tested-by here, I think we should define a set of coverage tests, run them - the upper end on sm8250 and lower end msm8916 "makes sense to me"

20? different gstreamer tests at different formats and different sizes on our selected platforms db410c, rb5, rb3 I have - also an 820 I haven't booted and an enforce sdm660.

Which tests will we use to validate this series and subsequent series to ensure we don't have more regressions ?

---
bod

#47 lore raw
Quoted 29 lines · Vikash Garodia
Quoted 11 lines · Bryan O'Donoghue
Quoted 1 line · Konrad Dybcio

Tested on 8250, but pretty please test it on your boards too!

What's the definition of test here ?

I ran this

ffplay -codec:video h264_v4l2m2m FantasticFour-ROTSS.mp4

and this

Quoted 7 lines

ffplay -codec:video vp8_v4l2m2m /mnt/big-buck-bunny_trailer.webm

on db410c with no errors. Then again I applied and disapplied the 8x8 264 fix to that branch and saw no discernable difference so I'm not very confident we have good coverage.

@Stan @Vikash could you give some suggested tests for coverage here ?

I could think of below test aspects for this series
1. Suspend Resume
2. Concurrency test
3. Module load -> video usecase -> module unload -> module load -> video usecase. This would ensure video firmware is reloaded and functional.
4. Video playback and encode for all supported resolution and codecs.
5. In general, video playback with more test content.

Quoted 6 lines

I would be testing the series with stability test suite on CrOS. That would be either on sc7180 or sc7280 setup.

Konrad, you can post the new version as one patch needs to be dropped. Test can be done on the new version. There are few patches in the series pending review, which can be done in parallel.

Sure, working on it!

Konrad

Quoted 19 lines

-Vikash

Quoted 16 lines

@Konrad - get a db410c !

My superficial first-pass on this series looks good but, before giving a Tested-by here, I think we should define a set of coverage tests, run them - the upper end on sm8250 and lower end msm8916 "makes sense to me"

20? different gstreamer tests at different formats and different sizes on our selected platforms db410c, rb5, rb3 I have - also an 820 I haven't booted and an enforce sdm660.

Which tests will we use to validate this series and subsequent series to ensure we don't have more regressions ?

---
bod

#48 lore raw
In reply to Bryan O'Donoghue
Quoted 7 lines · Bryan O'Donoghue
Quoted 1 line · Konrad Dybcio

Tested on 8250, but pretty please test it on your boards too!

What's the definition of test here ?

I ran this

Quoted 7 lines

ffplay -codec:video h264_v4l2m2m FantasticFour-ROTSS.mp4

and this

ffplay -codec:video vp8_v4l2m2m /mnt/big-buck-bunny_trailer.webm

on db410c with no errors. Then again I applied and disapplied the 8x8 264 fix to that branch and saw no discernable difference so I'm not very confident we have good coverage.

I don't think we have any coverage at all, especially considering there were 1 or 2 patches fixing vdec not working at all in the past few months.. Maybe CrOS has some internal pipelines for this.

Quoted 4 lines

@Stan @Vikash could you give some suggested tests for coverage here ?

@Konrad - get a db410c !

Don't think they're even made anymore!

Quoted 6 lines

My superficial first-pass on this series looks good but, before giving a Tested-by here, I think we should define a set of coverage tests, run them - the upper end on sm8250 and lower end msm8916 "makes sense to me"

20? different gstreamer tests at different formats and different sizes on our selected platforms db410c, rb5, rb3 I have - also an 820 I haven't booted and an enforce sdm660.

Which tests will we use to validate this series and subsequent series to ensure we don't have more regressions ?

Personally I've done:

- boot and check if venus still probes and doesn't shout in dmesg
- decode and re-encode a H264 file

which is far from perfect..

Konrad

Quoted 3 lines

---
bod