Skip to contentSkip to conversation

Fix for H265 decoding failure .

PATCH In review [email protected] 4 participants 8 messages Nov 15, 2022 – Mar 16, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Fix for H265 decoding failure .

From: Viswanath Boma <[email protected]>

Fixed the buffer size calculation mismatch with firmware requirements. Tested on v5.15 and v5.4 kernels .
For testing utilised the chrome utilities .

Viswanath Boma (1):
venus : Fix for H265 decoding failure.

 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 venus : Fix for H265 decoding failure.

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +2 -2
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
 #define LCU_MIN_SIZE_PELS		16
 #define SIZE_SEI_USERDATA		4096
 
-#define H265D_MAX_SLICE			600
+#define H265D_MAX_SLICE			3600
 #define SIZE_H265D_HW_PIC_T		SIZE_H264D_HW_PIC_T
 #define SIZE_H265D_BSE_CMD_PER_BUF	(16 * sizeof(u32))
 #define SIZE_H265D_VPP_CMD_PER_BUF	256
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)
 static u32 h265d_persist1_size(void)
 {
 	return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-			* sizeof(u32)), HFI_DMA_ALIGNMENT);
+			* sizeof(u32) + NUM_HW_PIC_BUF * SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
 }
 
 static u32 vp8d_persist1_size(void)
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH 1/1] venus : Fix for H265 decoding failure.

Quoted 35 lines · On Tue, Nov 15, 2022 at 4:10 AM <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +2 -3
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
 #define LCU_MIN_SIZE_PELS              16
 #define SIZE_SEI_USERDATA              4096
 
-#define H265D_MAX_SLICE                        600
+#define H265D_MAX_SLICE                        3600
 #define SIZE_H265D_HW_PIC_T            SIZE_H264D_HW_PIC_T
 #define SIZE_H265D_BSE_CMD_PER_BUF     (16 * sizeof(u32))
 #define SIZE_H265D_VPP_CMD_PER_BUF     256
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)
 static u32 h265d_persist1_size(void)
 {
        return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-                       * sizeof(u32)), HFI_DMA_ALIGNMENT);
+                       * sizeof(u32) + NUM_HW_PIC_BUF * SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
 }
 
 static u32 vp8d_persist1_size(void)
--
Quoted 2 lines

2.17.1

Hi Viswanath. I tested this patch on ChromiumOS's downstream 5.15-based fork. Using ITU-T HEVC test vectors [0] I am seeing firmware errors "qcom-venus-decoder aa00000.video-codec:video-decoder:
VenusMed : event not sufficient resources". Does this change fix HEVC decoding for you?

[0]: https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/HEVC_v1/

Best regards,
Nathan Hebert

Tested-by
#3 lore raw

Re: [PATCH 1/1] venus : Fix for H265 decoding failure.

Quoted 35 lines · Nathan Hebert
Quoted 33 lines · On Tue, Nov 15, 2022 at 4:10 AM <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +2 -2
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
 #define LCU_MIN_SIZE_PELS              16
 #define SIZE_SEI_USERDATA              4096
 
-#define H265D_MAX_SLICE                        600
+#define H265D_MAX_SLICE                        3600
 #define SIZE_H265D_HW_PIC_T            SIZE_H264D_HW_PIC_T
 #define SIZE_H265D_BSE_CMD_PER_BUF     (16 * sizeof(u32))
 #define SIZE_H265D_VPP_CMD_PER_BUF     256
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)
 static u32 h265d_persist1_size(void)
 {
        return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-                       * sizeof(u32)), HFI_DMA_ALIGNMENT);
+                       * sizeof(u32) + NUM_HW_PIC_BUF * SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
 }
 
Quoted 10 lines
Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +0 -1
 static u32 vp8d_persist1_size(void)
--

2.17.1

Hi Viswanath. I tested this patch on ChromiumOS's downstream 5.15-based fork. Using ITU-T HEVC test vectors [0] I am seeing firmware errors "qcom-venus-decoder aa00000.video-codec:video-decoder:
VenusMed : event not sufficient resources". Does this change fix HEVC decoding for you?

Hi Viswanath. Thanks for looking at the logs offline. I re-tested after adding Q08C (UBWC) support to my decoder client, and it fixed the error that I was seeing. My mistake. Each of the main profile test vectors now decodes correctly after applying your patch!

Quoted 4 lines

[0]: https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/HEVC_v1/

Best regards,
Nathan Hebert

Tested-by Nathan Hebert
#4 lore raw

RE: [PATCH 1/1] venus : Fix for H265 decoding failure.

-----Original Message-----
From: Nathan Hebert <[email protected]>
Sent: Saturday, December 3, 2022 1:19 AM
To: Viswanath Boma (Temp) (QUIC) <[email protected]>
Cc: [email protected]; Andy Gross <[email protected]>; [email protected]; Mauro Carvalho Chehab <[email protected]>; [email protected]; [email protected]; [email protected]; Vikash Garodia <[email protected]>
Subject: Re: [PATCH 1/1] venus : Fix for H265 decoding failure.

WARNING: This email originated from outside of Qualcomm. Please be wary of any links or attachments, and do not enable macros.

Quoted 36 lines · Nathan Hebert
Quoted 34 lines · On Tue, Nov 15, 2022 at 4:10 AM <[email protected]> wrote:

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +3 -2
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
 #define LCU_MIN_SIZE_PELS              16
 #define SIZE_SEI_USERDATA              4096
 
-#define H265D_MAX_SLICE                        600
+#define H265D_MAX_SLICE                        3600
 #define SIZE_H265D_HW_PIC_T            SIZE_H264D_HW_PIC_T
 #define SIZE_H265D_BSE_CMD_PER_BUF     (16 * sizeof(u32))
 #define SIZE_H265D_VPP_CMD_PER_BUF     256
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)  static 
 u32 h265d_persist1_size(void)  {
        return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-                       * sizeof(u32)), HFI_DMA_ALIGNMENT);
+                       * sizeof(u32) + NUM_HW_PIC_BUF * 
+ SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
 }
 
Quoted 10 lines
Quoted 4 lines
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +0 -1
 static u32 vp8d_persist1_size(void)
--

2.17.1

Hi Viswanath. I tested this patch on ChromiumOS's downstream 5.15-based fork. Using ITU-T HEVC test vectors [0] I am seeing firmware errors "qcom-venus-decoder aa00000.video-codec:video-decoder:
VenusMed : event not sufficient resources". Does this change fix HEVC decoding for you?

Hi Viswanath. Thanks for looking at the logs offline. I re-tested after adding Q08C (UBWC) support to my decoder client, and it fixed the error that I was seeing. My mistake. Each of the main profile test vectors now decodes correctly after applying your patch! [vboma] Thank you Nathan for the update .

Quoted 6 lines

[0]:
https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_
conformance/HEVC_v1/

Best regards,
Nathan Hebert

#5 lore raw

Re: [PATCH 1/1] venus : Fix for H265 decoding failure.

In reply to [email protected]
Quoted 25 lines · On 15/11/2022 12:10, [email protected] wrote:

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
  drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +1 -1
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
  #define LCU_MIN_SIZE_PELS		16
  #define SIZE_SEI_USERDATA		4096
 
-#define H265D_MAX_SLICE			600
+#define H265D_MAX_SLICE			3600
  #define SIZE_H265D_HW_PIC_T		SIZE_H264D_HW_PIC_T
  #define SIZE_H265D_BSE_CMD_PER_BUF	(16 * sizeof(u32))
  #define SIZE_H265D_VPP_CMD_PER_BUF	256

drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c static u32 h264d_persist1_size(void) · line 1027

Quoted 8 lines
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +1 -1
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)
  static u32 h265d_persist1_size(void)
  {
  	return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-			* sizeof(u32)), HFI_DMA_ALIGNMENT);
+			* sizeof(u32) + NUM_HW_PIC_BUF * SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
  }
 
  static u32 vp8d_persist1_size(void)

If this is a real fix it need to be applied elsewhere

Please add a Fixes tag

Fixes 3a75bf4e7925 ("media: venus: Add platform buffers for v6")

and

Cc <[email protected]> # 5.14.x

---
bod

#6 lore raw

PATCH 1/1 PATCH 0/1] Fix for H265 decoding failure .

In reply to [email protected]

From: Viswanath Boma <[email protected]>

Fixed strict patch warnings and ensured rebase.

Fixed the buffer size calculation mismatch with firmware requirements. Tested on v5.15 kernel.
For testing utilised the chrome utilities .

Viswanath Boma (1):
venus : Fix for H265 decoding failure.

 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.17.1
#7 lore raw

PATCH 1/1 venus : Fix for H265 decoding failure.

From: Viswanath Boma <[email protected]>

Aligned the mismatch of persist1 and scratch1 buffer calculation, as per the firmware requirements .

---
 drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +2 -2
index ea25c451222b..a9be31ec6927 100644
@@ -93,7 +93,7 @@
 #define LCU_MIN_SIZE_PELS		16
 #define SIZE_SEI_USERDATA		4096
 
-#define H265D_MAX_SLICE			600
+#define H265D_MAX_SLICE			3600
 #define SIZE_H265D_HW_PIC_T		SIZE_H264D_HW_PIC_T
 #define SIZE_H265D_BSE_CMD_PER_BUF	(16 * sizeof(u32))
 #define SIZE_H265D_VPP_CMD_PER_BUF	256
@@ -1021,7 +1021,7 @@ static u32 h264d_persist1_size(void)
 static u32 h265d_persist1_size(void)
 {
 	return ALIGN((SIZE_SLIST_BUF_H265 * NUM_SLIST_BUF_H265 + H265_NUM_TILE
-			* sizeof(u32)), HFI_DMA_ALIGNMENT);
+			* sizeof(u32) + NUM_HW_PIC_BUF * SIZE_SEI_USERDATA), HFI_DMA_ALIGNMENT);
 }
 
 static u32 vp8d_persist1_size(void)
Signature · 1 line
2.17.1