Fix critical bugs
Subsystems (2)
Jackson.lee
maintainerv2 cover Fix critical bugs
iThe wave5 codec driver is a stateful encoder/decoder.
The following patches is for improving decoder performance and fix critical bugs
v4l2-compliance results:
========================
v4l2-compliance 1.26.1-5142, 64 bits, 64-bit time_t
Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test CREATE_BUFS maximum buffers: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)
Total for wave5-dec device /dev/video0: 46, Succeeded: 46, Failed: 0, Warnings: 2 Total for wave5-enc device /dev/video1: 46, Succeeded: 46, Failed: 0, Warnings: 0
Fluster test results:
=====================
Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 68.608 secs
(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption,
2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)
Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 78/135 tests successfully in 33.238 secs
(57 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)
Change since v1:
=================
* For [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color
- Add Reviewed-by tag
* For [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
- Add Reviewed-by tag
* For [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
- Add Reviewed-by tag
* For [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while testing
- Add Reviewed-by tag
* Drop "media: chips-media: wave5: Improve performance of decoder"
- We will try to send this patch separately next time
Change since v0:
=================
* For [PATCH v1 3/5] media: chips-media: wave5: Improve performance of decoder
- Fix Null reference while testing fluster for more than 2 decoders
- Fix timeout while testing fluster for multi instances
Jackson.lee (4):
media: chips-media: wave5: Fix to display gray color on screen
media: chips-media: wave5: Avoid race condition for interrupt handling
media: chips-media: wave5: Fix hang after seeking
media: chips-media: wave5: Fix timeout while testing 10bit hevc
fluster
.../platform/chips-media/wave5/wave5-hw.c | 2 +- .../chips-media/wave5/wave5-vpu-dec.c | 31 ++++++++++++++++++- .../platform/chips-media/wave5/wave5-vpu.c | 4 +-- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++ 4 files changed, 43 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0
Jackson.lee
maintainerPATCH v2 1/4 media: chips-media: wave5: Fix to display gray color on screen
When a decoder instance is created, W5_CMD_ERR_CONCEAL register should be initialized to 0. If not set to 0, gray color can occasionally be displayed on screen while decoding.
--- drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/chips-media/wave5/wave5-hw.c +1 -1
@@ -585,7 +585,7 @@ int wave5_vpu_build_up_dec_param(struct vpu_instance *inst,vpu_write_reg (inst->dev,W5_CMD_NUM_CQ_DEPTH_M1 ,WAVE521_COMMAND_QUEUE_DEPTH -1 ); } - +vpu_write_reg (inst->dev,W5_CMD_ERR_CONCEAL ,0 ); ret =send_firmware_command (inst,W5_CREATE_INSTANCE , true,NULL ,NULL );if (ret) {wave5_vdi_free_dma_memory (vpu_dev, &p_dec_info->vb_work);
Signature · 1 line
2.43.0
Re: [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen
Hi,
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 7 lines
When a decoder instance is created,
W5_CMD_ERR_CONCEALregister should be initialized to 0. If not set to 0, gray color can occasionally be displayed on screen while decoding.Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>
You forgot to add Fixes: tags, can you find back which commit you fix, and send us the correctly formatted tag ? This will avoid the need of a resend.
Nicolas
Quoted 17 lines
--- drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/chips-media/wave5/wave5-hw.c +1
-1@@ -585,7 +585,7 @@ int wave5_vpu_build_up_dec_param(struct vpu_instance *inst,vpu_write_reg (inst->dev,W5_CMD_NUM_CQ_DEPTH_M1 ,WAVE521_COMMAND_QUEUE_DEPTH -1 ); } - +vpu_write_reg (inst->dev,W5_CMD_ERR_CONCEAL ,0 ); ret =send_firmware_command (inst,W5_CREATE_INSTANCE , true,NULL ,NULL );if (ret) {wave5_vdi_free_dma_memory (vpu_dev, &p_dec_info->vb_work);
jackson.lee
maintainerRE: [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen
Hi Nicolas
Quoted 19 lines
-----Original Message-----
From: Nicolas Dufresne <[email protected]>
Sent: Tuesday, December 17, 2024 11:04 PM
To: jackson.lee <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; lafley.kim <[email protected]>; [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: Re: [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screenHi,
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 4 lines
When a decoder instance is created,
W5_CMD_ERR_CONCEALregister should be initialized to 0. If not set to 0, gray color can occasionally be displayed on screen while decoding.
Quoted 8 lines
Quoted 3 lines
Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>You forgot to add Fixes: tags, can you find back which commit you fix, and send us the correctly formatted tag ? This will avoid the need of a resend.
Nicolas
Thanks for your advice.
Thanks
Quoted 21 lines
drivers/media/platform/chips-media/wave5/wave5-hw.c int wave5_vpu_build_up_dec_param(struct vpu_instance
Quoted 11 lines
--- drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/chips-media/wave5/wave5-hw.c +0
-0@@ -585,7 +585,7 @@ int wave5_vpu_build_up_dec_param(struct vpu_instance*inst,
drivers/media/platform/chips-media/wave5/wave5-hw.c int wave5_vpu_build_up_dec_param(struct vpu_instance *inst,
Quoted 6 lines
drivers/media/platform/chips-media/wave5/wave5-hw.c +1
-1vpu_write_reg (inst->dev,W5_CMD_NUM_CQ_DEPTH_M1 ,WAVE521_COMMAND_QUEUE_DEPTH -1 ); } - +vpu_write_reg (inst->dev,W5_CMD_ERR_CONCEAL ,0 ); ret = send_firmware_command(inst, W5_CREATE_INSTANCE, true, NULL,NULL);
Quoted 2 lines
drivers/media/platform/chips-media/wave5/wave5-hw.c +0
-0if (ret) {wave5_vdi_free_dma_memory (vpu_dev, &p_dec_info->vb_work);
Jackson.lee
maintainerPATCH v2 2/4 media: chips-media: wave5: Avoid race condition for interrupt handling
In reply to Jackson.leeIn case of multi instance, interrupts can occur for other instances as soon as interrupt is cleared. If driver reads the instance_info after clearing the interrupt, it is not guaranteed that the instance_info is valid for the current interrupt.
Read the instance_info register for each interrupt before clearing the interrupt.
--- drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-vpu.c +2 -2
@@ -55,12 +55,12 @@ static void wave5_vpu_handle_irq(void *dev_id)struct vpu_device *dev = dev_id; irq_reason =wave5_vdi_read_register (dev,W5_VPU_VINT_REASON ); + seq_done =wave5_vdi_read_register (dev,W5_RET_SEQ_DONE_INSTANCE_INFO ); + cmd_done =wave5_vdi_read_register (dev,W5_RET_QUEUE_CMD_DONE_INST );wave5_vdi_write_register (dev,W5_VPU_VINT_REASON_CLR , irq_reason);wave5_vdi_write_register (dev,W5_VPU_VINT_CLEAR ,0x1 );list_for_each_entry (inst, &dev->instances, list) { - seq_done =wave5_vdi_read_register (dev,W5_RET_SEQ_DONE_INSTANCE_INFO ); - cmd_done =wave5_vdi_read_register (dev,W5_RET_QUEUE_CMD_DONE_INST );if (irq_reason &BIT (INT_WAVE5_INIT_SEQ ) || irq_reason &BIT (INT_WAVE5_ENC_SET_PARAM )) {
Signature · 1 line
2.43.0
Re: [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 11 lines
In case of multi instance, interrupts can occur for other instances as soon as interrupt is cleared. If driver reads the
instance_infoafter clearing the interrupt, it is not guaranteed that theinstance_infois valid for the current interrupt.Read the
instance_inforegister for each interrupt before clearing the interrupt.Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>
Same, what is the Fixes tag ?
Quoted 23 lines
--- drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/platform/chips-media/wave5/wave5-vpu.c +2
-2@@ -55,12 +55,12 @@ static void wave5_vpu_handle_irq(void *dev_id)struct vpu_device *dev = dev_id; irq_reason =wave5_vdi_read_register (dev,W5_VPU_VINT_REASON ); + seq_done =wave5_vdi_read_register (dev,W5_RET_SEQ_DONE_INSTANCE_INFO ); + cmd_done =wave5_vdi_read_register (dev,W5_RET_QUEUE_CMD_DONE_INST );wave5_vdi_write_register (dev,W5_VPU_VINT_REASON_CLR , irq_reason);wave5_vdi_write_register (dev,W5_VPU_VINT_CLEAR ,0x1 );list_for_each_entry (inst, &dev->instances, list) { - seq_done =wave5_vdi_read_register (dev,W5_RET_SEQ_DONE_INSTANCE_INFO ); - cmd_done =wave5_vdi_read_register (dev,W5_RET_QUEUE_CMD_DONE_INST );if (irq_reason &BIT (INT_WAVE5_INIT_SEQ ) || irq_reason &BIT (INT_WAVE5_ENC_SET_PARAM )) {
jackson.lee
maintainerRE: [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
Hi Nicolas
Quoted 18 lines
-----Original Message-----
From: Nicolas Dufresne <[email protected]>
Sent: Tuesday, December 17, 2024 11:04 PM
To: jackson.lee <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; lafley.kim <[email protected]>; [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: Re: [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handlingLe mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 5 lines
In case of multi instance, interrupts can occur for other instances as soon as interrupt is cleared. If driver reads the
instance_infoafter clearing the interrupt, it is not guaranteed that theinstance_infois valid for the current interrupt.
Quoted 8 lines
Quoted 6 lines
Read the
instance_inforegister for each interrupt before clearing the interrupt.Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>Same, what is the Fixes tag ?
thanks
Quoted 28 lines
Quoted 11 lines
--- drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/media/platform/chips-media/wave5/wave5-vpu.c +0
-0drivers/media/platform/chips-media/wave5/wave5-vpu.c static void wave5_vpu_handle_irq(void *dev_id) · line 58
Quoted 4 lines
drivers/media/platform/chips-media/wave5/wave5-vpu.c +1
-0@@ -55,12 +55,12 @@ static void wave5_vpu_handle_irq(void *dev_id)struct vpu_device *dev = dev_id; irq_reason =wave5_vdi_read_register (dev,W5_VPU_VINT_REASON ); + seq_done = wave5_vdi_read_register(dev,
W5_RET_SEQ_DONE_INSTANCE_INFO);drivers/media/platform/chips-media/wave5/wave5-vpu.c static void wave5_vpu_handle_irq(void *dev_id)
Quoted 6 lines
drivers/media/platform/chips-media/wave5/wave5-vpu.c +1
-1+ cmd_done =wave5_vdi_read_register (dev,W5_RET_QUEUE_CMD_DONE_INST );wave5_vdi_write_register (dev,W5_VPU_VINT_REASON_CLR , irq_reason);wave5_vdi_write_register (dev,W5_VPU_VINT_CLEAR ,0x1 );list_for_each_entry (inst, &dev->instances, list) { - seq_done = wave5_vdi_read_register(dev,
W5_RET_SEQ_DONE_INSTANCE_INFO);drivers/media/platform/chips-media/wave5/wave5-vpu.c static void wave5_vpu_handle_irq(void *dev_id) · line 63
Quoted 1 line
drivers/media/platform/chips-media/wave5/wave5-vpu.c +0
-1- cmd_done = wave5_vdi_read_register(dev,
W5_RET_QUEUE_CMD_DONE_INST);Quoted 3 lines
drivers/media/platform/chips-media/wave5/wave5-vpu.c +0
-0if (irq_reason &BIT (INT_WAVE5_INIT_SEQ ) || irq_reason &BIT (INT_WAVE5_ENC_SET_PARAM )) {
Jackson.lee
maintainerPATCH v2 3/4 media: chips-media: wave5: Fix hang after seeking
In reply to Jackson.leeWhile seeking, driver calls flush command. Before flush command is sent to VPU, driver should handle display buffer flags and should get all decoded information from VPU if VCORE is running.
--- .../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-)
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +16 -1
@@ -1369,6 +1369,16 @@ static int streamoff_output(struct vb2_queue *q)struct vb2_v4l2_buffer *buf;int ret;dma_addr_t new_rd_ptr; +struct dec_output_info dec_info; +unsigned int i; + +for (i =0 ; i <v4l2_m2m_num_dst_bufs_ready (m2m_ctx); i++) { + ret =wave5_vpu_dec_set_disp_flag (inst, i); +if (ret) +dev_dbg (inst->dev->dev, +"%s: Setting display flag of buf index: %u, fail: %d\n" , + __func__, i, ret); + }while ((buf =v4l2_m2m_src_buf_remove (m2m_ctx))) { dev_dbg(inst->dev->dev, "%s: (Multiplanar) buf type %4u | index %4u\n",
@@ -1376,6 +1386,11 @@ static int streamoff_output(struct vb2_queue *q)v4l2_m2m_buf_done (buf,VB2_BUF_STATE_ERROR ); } +while (wave5_vpu_dec_get_output_info (inst, &dec_info) ==0 ) { +if (dec_info.index_frame_display >=0 ) +wave5_vpu_dec_set_disp_flag (inst, dec_info.index_frame_display); + } + ret =wave5_vpu_flush_instance (inst);if (ret)return ret;
@@ -1459,7 +1474,7 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)break ;if (wave5_vpu_dec_get_output_info (inst, &dec_output_info)) -dev_dbg (inst->dev->dev,"Getting decoding results from fw, fail\n" ); +dev_dbg (inst->dev->dev,"there is no output info\n" ); }v4l2_m2m_update_stop_streaming_state (m2m_ctx, q);
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +10 -0
@@ -75,6 +75,16 @@ int wave5_vpu_flush_instance(struct vpu_instance *inst) inst->type == VPU_INST_TYPE_DEC ? "DECODER" : "ENCODER", inst->id);mutex_unlock (&inst->dev->hw_lock);return -ETIMEDOUT ; + }else if (ret == -EBUSY ) { +struct dec_output_info dec_info; + +mutex_unlock (&inst->dev->hw_lock); +wave5_vpu_dec_get_output_info (inst, &dec_info); + ret =mutex_lock_interruptible (&inst->dev->hw_lock); +if (ret) +return ret; +if (dec_info.index_frame_display >0 ) +wave5_vpu_dec_set_disp_flag (inst, dec_info.index_frame_display); } }while (ret !=0 );mutex_unlock (&inst->dev->hw_lock);
Signature · 1 line
2.43.0
Re: [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 7 lines
While seeking, driver calls flush command. Before flush command is sent to VPU, driver should handle display buffer flags and should get all decoded information from VPU if VCORE is running.
Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>
This one too please.
Quoted 68 lines
--- .../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-)drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +16
-1@@ -1369,6 +1369,16 @@ static int streamoff_output(struct vb2_queue *q)struct vb2_v4l2_buffer *buf;int ret;dma_addr_t new_rd_ptr; +struct dec_output_info dec_info; +unsigned int i; + +for (i =0 ; i <v4l2_m2m_num_dst_bufs_ready (m2m_ctx); i++) { + ret =wave5_vpu_dec_set_disp_flag (inst, i); +if (ret) +dev_dbg (inst->dev->dev, +"%s: Setting display flag of buf index: %u, fail: %d\n" , + __func__, i, ret); + }while ((buf =v4l2_m2m_src_buf_remove (m2m_ctx))) { dev_dbg(inst->dev->dev, "%s: (Multiplanar) buf type %4u | index %4u\n",@@ -1376,6 +1386,11 @@ static int streamoff_output(struct vb2_queue *q)v4l2_m2m_buf_done (buf,VB2_BUF_STATE_ERROR ); } +while (wave5_vpu_dec_get_output_info (inst, &dec_info) ==0 ) { +if (dec_info.index_frame_display >=0 ) +wave5_vpu_dec_set_disp_flag (inst, dec_info.index_frame_display); + } + ret =wave5_vpu_flush_instance (inst);if (ret)return ret;@@ -1459,7 +1474,7 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)break ;if (wave5_vpu_dec_get_output_info (inst, &dec_output_info)) -dev_dbg (inst->dev->dev,"Getting decoding results from fw, fail\n" ); +dev_dbg (inst->dev->dev,"there is no output info\n" ); }v4l2_m2m_update_stop_streaming_state (m2m_ctx, q);drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +10
-0@@ -75,6 +75,16 @@ int wave5_vpu_flush_instance(struct vpu_instance *inst) inst->type == VPU_INST_TYPE_DEC ? "DECODER" : "ENCODER", inst->id);mutex_unlock (&inst->dev->hw_lock);return -ETIMEDOUT ; + }else if (ret == -EBUSY ) { +struct dec_output_info dec_info; + +mutex_unlock (&inst->dev->hw_lock); +wave5_vpu_dec_get_output_info (inst, &dec_info); + ret =mutex_lock_interruptible (&inst->dev->hw_lock); +if (ret) +return ret; +if (dec_info.index_frame_display >0 ) +wave5_vpu_dec_set_disp_flag (inst, dec_info.index_frame_display); } }while (ret !=0 );mutex_unlock (&inst->dev->hw_lock);
jackson.lee
maintainerRE: [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
Hi Nicolas
Quoted 17 lines
-----Original Message-----
From: Nicolas Dufresne <[email protected]>
Sent: Tuesday, December 17, 2024 11:05 PM
To: jackson.lee <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; lafley.kim <[email protected]>; [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: Re: [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seekingLe mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
Quoted 4 lines
While seeking, driver calls flush command. Before flush command is sent to VPU, driver should handle display buffer flags and should get all decoded information from VPU if VCORE is running.
Quoted 5 lines
Quoted 3 lines
Signed-off-by Jackson.lee <[email protected]>Signed-off-by Nas Chung <[email protected]>Reviewed-by Nicolas Dufresne <[email protected]>This one too please.
thanks
Quoted 80 lines
Quoted 13 lines
--- .../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-)drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +0
-0@@ -1369,6 +1369,16 @@ static int streamoff_output(struct vb2_queue *q)struct vb2_v4l2_buffer *buf;drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c static int streamoff_output(struct vb2_queue *q) · line 1379
Quoted 10 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +8
-0int ret;dma_addr_t new_rd_ptr; +struct dec_output_info dec_info; +unsigned int i; + +for (i =0 ; i <v4l2_m2m_num_dst_bufs_ready (m2m_ctx); i++) { + ret =wave5_vpu_dec_set_disp_flag (inst, i); +if (ret) + dev_dbg(inst->dev->dev, + "%s: Setting display flag of buf index: %u,fail: %d\n",
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c static int streamoff_output(struct vb2_queue *q)
Quoted 5 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +2
-0+ __func__, i, ret); + }while ((buf =v4l2_m2m_src_buf_remove (m2m_ctx))) { dev_dbg(inst->dev->dev, "%s: (Multiplanar) buf type %4u |index
Quoted 1 line
%4u\n", @@ -1376,6 +1386,11 @@ static int streamoff_output(struct
vb2_queue*q)drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c static int streamoff_output(struct vb2_queue *q)
Quoted 6 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +3
-0v4l2_m2m_buf_done (buf,VB2_BUF_STATE_ERROR ); } +while (wave5_vpu_dec_get_output_info (inst, &dec_info) ==0 ) { +if (dec_info.index_frame_display >=0 ) + wave5_vpu_dec_set_disp_flag(inst,dec_info.index_frame_display);
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c static void wave5_vpu_dec_stop_streaming(struct
Quoted 6 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +2
-0+ } + ret =wave5_vpu_flush_instance (inst);if (ret)return ret;@@ -1459,7 +1474,7 @@ static void wave5_vpu_dec_stop_streaming(struct
vb2_queue*q)drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)
Quoted 4 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +0
-1break ;if (wave5_vpu_dec_get_output_info (inst, &dec_output_info)) - dev_dbg(inst->dev->dev, "Getting decoding results fromfw, fail\n");
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c int wave5_vpu_flush_instance(struct vpu_instance
Quoted 10 lines
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +1
-0+dev_dbg (inst->dev->dev,"there is no output info\n" ); } v4l2_m2m_update_stop_streaming_state(m2m_ctx, q); diff --git
a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.cb/drivers/media/platform/chips-media/wave5/wave5-vpuapi.cindexe16b990041c2..e5e879a13e8b100644drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +0
-0@@ -75,6 +75,16 @@ int wave5_vpu_flush_instance(struct vpu_instance*inst)
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c int wave5_vpu_flush_instance(struct vpu_instance · line 75
Quoted 1 line
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +0
-0inst->type == VPU_INST_TYPE_DEC ? "DECODER" :"ENCODER",
inst->id);drivers/media/platform/chips-media/wave5/wave5-vpuapi.c int wave5_vpu_flush_instance(struct vpu_instance *inst)
Quoted 12 lines
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +10
-0mutex_unlock (&inst->dev->hw_lock);return -ETIMEDOUT ; + }else if (ret == -EBUSY ) { +struct dec_output_info dec_info; + +mutex_unlock (&inst->dev->hw_lock); +wave5_vpu_dec_get_output_info (inst, &dec_info); + ret =mutex_lock_interruptible (&inst->dev->hw_lock); +if (ret) +return ret; +if (dec_info.index_frame_display >0 ) + wave5_vpu_dec_set_disp_flag(inst,dec_info.index_frame_display);
Quoted 3 lines
drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +0
-0} }while (ret !=0 );mutex_unlock (&inst->dev->hw_lock);
Jackson.lee
maintainerPATCH v2 4/4 media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster
In reply to Jackson.lee521C Wave5 variant does not support 10 bit. When 10 bit support for 515 variant was added, the code which returns an error was removed. While testing 10bit hevc fluster on the 521C hw, timeout happened.
--- .../platform/chips-media/wave5/wave5-vpu-dec.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +14 -0
@@ -1345,10 +1345,24 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int countif (ret) goto free_bitstream_vbuf; }else if (q->type ==V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ) { +struct dec_initial_info *initial_info = + &inst->codec_info->dec_info.initial_info; +if (inst->state ==VPU_INST_STATE_STOP ) ret =switch_state (inst,VPU_INST_STATE_INIT_SEQ );if (ret) goto return_buffers; + +if (inst->state ==VPU_INST_STATE_INIT_SEQ && + inst->dev->product_code ==WAVE521C_CODE ) { +if (initial_info->luma_bitdepth !=8 ) { +dev_info (inst->dev->dev,"%s: no support for %d bit depth" , + __func__, initial_info->luma_bitdepth); + ret = -EINVAL ; + goto return_buffers; + } + } + }pm_runtime_mark_last_busy (inst->dev->dev);pm_runtime_put_autosuspend (inst->dev->dev);
Signature · 1 line
2.43.0
jackson.lee
maintainerHi Sebastian and Nicolas
Can you review the following patch series?
https://patchwork.linuxtv.org/project/linux-media/cover/[email protected]/
thanks
Jackson
Quoted 98 lines
-----Original Message-----
From: jackson.lee
Sent: Tuesday, December 17, 2024 1:52 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; jackson.lee <[email protected]>; lafley.kim <[email protected]>; b- [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: [PATCH v2 0/4] Fix critical bugsiThe wave5 codec driver is a stateful encoder/decoder. The following patches is for improving decoder performance and fix critical bugs
v4l2-compliance results:
========================v4l2-compliance 1.26.1-5142, 64 bits, 64-bit
time_tBuffer ioctls:
warn: v4l2-test-buffers.cpp(693):VIDIOC_CREATE_BUFSnot
supported
warn: v4l2-test-buffers.cpp(693):VIDIOC_CREATE_BUFSnot
supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
testCREATE_BUFSmaximum buffers: OK
testVIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)Total for wave5-dec device
/dev/video0: 46, Succeeded: 46, Failed: 0,
Warnings: 2 Total for wave5-enc device/dev/video1: 46, Succeeded: 46,
Failed: 0, Warnings: 0Fluster test results:
=====================Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 68.608 secs(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption,
2 tests fail because of sizes which are incompatible with the IP, 11
tests fail because of unsupported 10 bit format)Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 78/135 tests successfully in 33.238 secs(57 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)
Change since v1:
=================
* For [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color
- Add Reviewed-by tag* For [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
- Add Reviewed-by tag* For [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
- Add Reviewed-by tag* For [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while testing
- Add Reviewed-by tag* Drop "media: chips-media: wave5: Improve performance of decoder"
- We will try to send this patch separately next timeChange since v0:
=================* For [PATCH v1 3/5] media: chips-media: wave5: Improve performance of decoder
- Fix Null reference while testing fluster for more than 2 decoders
- Fix timeout while testing fluster for multi instancesJackson.lee (4):
media: chips-media: wave5: Fix to display gray color on screen
media: chips-media: wave5: Avoid race condition for interrupt handling
media: chips-media: wave5: Fix hang after seeking
media: chips-media: wave5: Fix timeout while testing 10bit hevc
fluster.../platform/chips-media/wave5/wave5-hw.c | 2 +- .../chips-media/wave5/wave5-vpu-dec.c | 31 ++++++++++++++++++- .../platform/chips-media/wave5/wave5-vpu.c | 4 +-- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++ 4 files changed, 43 insertions(+), 4 deletions(-)--
2.43.0
jackson.lee
maintainerHi Sebastian and Nicolas
Is there any thing for me to do for these patch series ?
Thanks
Jackson
Quoted 122 lines
-----Original Message-----
From: jackson.lee
Sent: Tuesday, January 7, 2025 10:39 AM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; lafley.kim <[email protected]>; [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: RE: [PATCH v2 0/4] Fix critical bugsHi Sebastian and Nicolas
Can you review the following patch series?
https://patchwork.linuxtv.org/project/linux-media/cover/20241217045125.58-
[email protected]/thanks
JacksonQuoted 51 lines
-----Original Message-----
From: jackson.lee
Sent: Tuesday, December 17, 2024 1:52 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; jackson.lee <[email protected]>; lafley.kim <[email protected]>; b- [email protected]; [email protected]; Nas Chung <[email protected]>
Subject: [PATCH v2 0/4] Fix critical bugsiThe wave5 codec driver is a stateful encoder/decoder. The following patches is for improving decoder performance and fix critical bugs
v4l2-compliance results:
========================v4l2-compliance 1.26.1-5142, 64 bits, 64-bit
time_tBuffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFSnot supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK testCREATE_BUFSmaximum buffers: OK testVIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)Total for wave5-dec device
/dev/video0: 46, Succeeded: 46, Failed: 0,
Warnings: 2 Total for wave5-enc device/dev/video1: 46, Succeeded: 46,
Failed: 0, Warnings: 0Fluster test results:
=====================Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 68.608 secs(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption,
2 tests fail because of sizes which are incompatible with the IP, 11
tests fail because of unsupported 10 bit format)Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 78/135 tests successfully in 33.238 secsQuoted 6 lines
(57 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)
Change since v1:
=================
* For [PATCH v2 1/4] media: chips-media: wave5: Fix to display graycolor
Quoted 10 lines
- Add Reviewed-by tag
* For [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
- Add Reviewed-by tag* For [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
- Add Reviewed-by tag* For [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while
testing
Quoted 32 lines
- Add Reviewed-by tag
* Drop "media: chips-media: wave5: Improve performance of decoder"
- We will try to send this patch separately next timeChange since v0:
=================* For [PATCH v1 3/5] media: chips-media: wave5: Improve performance of decoder
- Fix Null reference while testing fluster for more than 2 decoders
- Fix timeout while testing fluster for multi instancesJackson.lee (4):
media: chips-media: wave5: Fix to display gray color on screen
media: chips-media: wave5: Avoid race condition for interrupt handling
media: chips-media: wave5: Fix hang after seeking
media: chips-media: wave5: Fix timeout while testing 10bit hevc
fluster.../platform/chips-media/wave5/wave5-hw.c | 2 +- .../chips-media/wave5/wave5-vpu-dec.c | 31 ++++++++++++++++++- .../platform/chips-media/wave5/wave5-vpu.c | 4 +-- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++ 4 files changed, 43 insertions(+), 4 deletions(-)--
2.43.0