* [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen
2024-12-17 4:51 [PATCH v2 0/4] Fix critical bugs Jackson.lee
@ 2024-12-17 4:51 ` Jackson.lee
2024-12-17 14:03 ` Nicolas Dufresne
2024-12-17 4:51 ` [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling Jackson.lee
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Jackson.lee @ 2024-12-17 4:51 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, jackson.lee, lafley.kim, b-brnich,
hverkuil, nas.chung
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.
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-hw.c b/drivers/media/platform/chips-media/wave5/wave5-hw.c
index c8a905994109..d94cf84c3ee5 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-hw.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-hw.c
@@ -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);
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen
2024-12-17 4:51 ` [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen Jackson.lee
@ 2024-12-17 14:03 ` Nicolas Dufresne
2024-12-18 2:58 ` jackson.lee
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Dufresne @ 2024-12-17 14:03 UTC (permalink / raw)
To: Jackson.lee, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, nas.chung
Hi,
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
> 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.
>
> Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
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
> ---
> drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-hw.c b/drivers/media/platform/chips-media/wave5/wave5-hw.c
> index c8a905994109..d94cf84c3ee5 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-hw.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-hw.c
> @@ -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);
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen
2024-12-17 14:03 ` Nicolas Dufresne
@ 2024-12-18 2:58 ` jackson.lee
0 siblings, 0 replies; 13+ messages in thread
From: jackson.lee @ 2024-12-18 2:58 UTC (permalink / raw)
To: Nicolas Dufresne, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, Nas Chung
Hi Nicolas
> -----Original Message-----
> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Sent: Tuesday, December 17, 2024 11:04 PM
> To: jackson.lee <jackson.lee@chipsnmedia.com>; mchehab@kernel.org;
> hverkuil-cisco@xs4all.nl; sebastian.fricke@collabora.com;
> bob.beckett@collabora.com; dafna.hirschfeld@collabora.com
> Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; lafley.kim
> <lafley.kim@chipsnmedia.com>; b-brnich@ti.com; hverkuil@xs4all.nl; Nas
> Chung <nas.chung@chipsnmedia.com>
> Subject: 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 :
> > 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.
> >
> > Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
> > Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
>
> 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.
Fixes: 45d1a2b93277 ("media: chips-media: wave5: Add vpuapi layer")
Thanks
>
> > ---
> > drivers/media/platform/chips-media/wave5/wave5-hw.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/chips-media/wave5/wave5-hw.c
> > b/drivers/media/platform/chips-media/wave5/wave5-hw.c
> > index c8a905994109..d94cf84c3ee5 100644
> > --- a/drivers/media/platform/chips-media/wave5/wave5-hw.c
> > +++ b/drivers/media/platform/chips-media/wave5/wave5-hw.c
> > @@ -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);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
2024-12-17 4:51 [PATCH v2 0/4] Fix critical bugs Jackson.lee
2024-12-17 4:51 ` [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen Jackson.lee
@ 2024-12-17 4:51 ` Jackson.lee
2024-12-17 14:04 ` Nicolas Dufresne
2024-12-17 4:51 ` [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking Jackson.lee
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Jackson.lee @ 2024-12-17 4:51 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, jackson.lee, lafley.kim, b-brnich,
hverkuil, nas.chung
In 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.
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 6b294a2d6717..63a607d10433 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -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)) {
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
2024-12-17 4:51 ` [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling Jackson.lee
@ 2024-12-17 14:04 ` Nicolas Dufresne
2024-12-18 3:02 ` jackson.lee
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Dufresne @ 2024-12-17 14:04 UTC (permalink / raw)
To: Jackson.lee, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, nas.chung
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
> In 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.
>
> Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Same, what is the Fixes tag ?
> ---
> drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index 6b294a2d6717..63a607d10433 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -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)) {
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling
2024-12-17 14:04 ` Nicolas Dufresne
@ 2024-12-18 3:02 ` jackson.lee
0 siblings, 0 replies; 13+ messages in thread
From: jackson.lee @ 2024-12-18 3:02 UTC (permalink / raw)
To: Nicolas Dufresne, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, Nas Chung
Hi Nicolas
> -----Original Message-----
> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Sent: Tuesday, December 17, 2024 11:04 PM
> To: jackson.lee <jackson.lee@chipsnmedia.com>; mchehab@kernel.org;
> hverkuil-cisco@xs4all.nl; sebastian.fricke@collabora.com;
> bob.beckett@collabora.com; dafna.hirschfeld@collabora.com
> Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; lafley.kim
> <lafley.kim@chipsnmedia.com>; b-brnich@ti.com; hverkuil@xs4all.nl; Nas
> Chung <nas.chung@chipsnmedia.com>
> Subject: 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 :
> > In 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.
> >
> > Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
> > Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
>
> Same, what is the Fixes tag ?
Fixes: ed7276ed2fd0 ("media: chips-media: wave5: Add hrtimer based polling support")
thanks
>
> > ---
> > drivers/media/platform/chips-media/wave5/wave5-vpu.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > index 6b294a2d6717..63a607d10433 100644
> > --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> > @@ -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)) {
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
2024-12-17 4:51 [PATCH v2 0/4] Fix critical bugs Jackson.lee
2024-12-17 4:51 ` [PATCH v2 1/4] media: chips-media: wave5: Fix to display gray color on screen Jackson.lee
2024-12-17 4:51 ` [PATCH v2 2/4] media: chips-media: wave5: Avoid race condition for interrupt handling Jackson.lee
@ 2024-12-17 4:51 ` Jackson.lee
2024-12-17 14:05 ` Nicolas Dufresne
2024-12-17 4:51 ` [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster Jackson.lee
2025-01-07 1:39 ` [PATCH v2 0/4] Fix critical bugs jackson.lee
4 siblings, 1 reply; 13+ messages in thread
From: Jackson.lee @ 2024-12-17 4:51 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, jackson.lee, lafley.kim, b-brnich,
hverkuil, nas.chung
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 <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
.../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++-
.../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
index d3ff420c52ce..882d5539630f 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
@@ -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);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
index e16b990041c2..e5e879a13e8b 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
@@ -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);
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
2024-12-17 4:51 ` [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking Jackson.lee
@ 2024-12-17 14:05 ` Nicolas Dufresne
2024-12-18 3:06 ` jackson.lee
0 siblings, 1 reply; 13+ messages in thread
From: Nicolas Dufresne @ 2024-12-17 14:05 UTC (permalink / raw)
To: Jackson.lee, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, nas.chung
Le mardi 17 décembre 2024 à 13:51 +0900, Jackson.lee a écrit :
> 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 <jackson.lee@chipsnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
This one too please.
> ---
> .../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++-
> .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++
> 2 files changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> index d3ff420c52ce..882d5539630f 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> @@ -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);
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> index e16b990041c2..e5e879a13e8b 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> @@ -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);
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking
2024-12-17 14:05 ` Nicolas Dufresne
@ 2024-12-18 3:06 ` jackson.lee
0 siblings, 0 replies; 13+ messages in thread
From: jackson.lee @ 2024-12-18 3:06 UTC (permalink / raw)
To: Nicolas Dufresne, mchehab, hverkuil-cisco, sebastian.fricke,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, Nas Chung
Hi Nicolas
> -----Original Message-----
> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Sent: Tuesday, December 17, 2024 11:05 PM
> To: jackson.lee <jackson.lee@chipsnmedia.com>; mchehab@kernel.org;
> hverkuil-cisco@xs4all.nl; sebastian.fricke@collabora.com;
> bob.beckett@collabora.com; dafna.hirschfeld@collabora.com
> Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; lafley.kim
> <lafley.kim@chipsnmedia.com>; b-brnich@ti.com; hverkuil@xs4all.nl; Nas
> Chung <nas.chung@chipsnmedia.com>
> Subject: 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 :
> > 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 <jackson.lee@chipsnmedia.com>
> > Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
>
> This one too please.
Fixes: 9707a6254a8a ("media: chips-media: wave5: Add the v4l2 layer")
thanks
>
> > ---
> > .../platform/chips-media/wave5/wave5-vpu-dec.c | 17 ++++++++++++++++-
> > .../platform/chips-media/wave5/wave5-vpuapi.c | 10 ++++++++++
> > 2 files changed, 26 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> > b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> > index d3ff420c52ce..882d5539630f 100644
> > --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> > +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> > @@ -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); diff --git
> > a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> > b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> > index e16b990041c2..e5e879a13e8b 100644
> > --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> > +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> > @@ -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);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster
2024-12-17 4:51 [PATCH v2 0/4] Fix critical bugs Jackson.lee
` (2 preceding siblings ...)
2024-12-17 4:51 ` [PATCH v2 3/4] media: chips-media: wave5: Fix hang after seeking Jackson.lee
@ 2024-12-17 4:51 ` Jackson.lee
2025-01-07 1:39 ` [PATCH v2 0/4] Fix critical bugs jackson.lee
4 siblings, 0 replies; 13+ messages in thread
From: Jackson.lee @ 2024-12-17 4:51 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne,
bob.beckett, dafna.hirschfeld
Cc: linux-media, linux-kernel, jackson.lee, lafley.kim, b-brnich,
hverkuil, nas.chung
521C 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.
Fixes: 143e7ab4d9a0 ("media: chips-media: wave5: support decoding HEVC Main10 profile")
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
.../platform/chips-media/wave5/wave5-vpu-dec.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
index 882d5539630f..fd71f0c43ac3 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
@@ -1345,10 +1345,24 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
if (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);
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH v2 0/4] Fix critical bugs
2024-12-17 4:51 [PATCH v2 0/4] Fix critical bugs Jackson.lee
` (3 preceding siblings ...)
2024-12-17 4:51 ` [PATCH v2 4/4] media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster Jackson.lee
@ 2025-01-07 1:39 ` jackson.lee
2025-02-03 0:54 ` jackson.lee
4 siblings, 1 reply; 13+ messages in thread
From: jackson.lee @ 2025-01-07 1:39 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, Nas Chung
Hi Sebastian and Nicolas
Can you review the following patch series?
https://patchwork.linuxtv.org/project/linux-media/cover/20241217045125.58-1-jackson.lee@chipsnmedia.com/
thanks
Jackson
> -----Original Message-----
> From: jackson.lee
> Sent: Tuesday, December 17, 2024 1:52 PM
> To: mchehab@kernel.org; hverkuil-cisco@xs4all.nl;
> sebastian.fricke@collabora.com; nicolas.dufresne@collabora.com;
> bob.beckett@collabora.com; dafna.hirschfeld@collabora.com
> Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; jackson.lee
> <jackson.lee@chipsnmedia.com>; lafley.kim <lafley.kim@chipsnmedia.com>; b-
> brnich@ti.com; hverkuil@xs4all.nl; Nas Chung <nas.chung@chipsnmedia.com>
> Subject: [PATCH v2 0/4] 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(-)
>
> --
> 2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread* RE: [PATCH v2 0/4] Fix critical bugs
2025-01-07 1:39 ` [PATCH v2 0/4] Fix critical bugs jackson.lee
@ 2025-02-03 0:54 ` jackson.lee
0 siblings, 0 replies; 13+ messages in thread
From: jackson.lee @ 2025-02-03 0:54 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, sebastian.fricke, nicolas.dufresne
Cc: linux-media, linux-kernel, lafley.kim, b-brnich, hverkuil, Nas Chung
Hi Sebastian and Nicolas
Is there any thing for me to do for these patch series ?
Thanks
Jackson
> -----Original Message-----
> From: jackson.lee
> Sent: Tuesday, January 7, 2025 10:39 AM
> To: mchehab@kernel.org; hverkuil-cisco@xs4all.nl;
> sebastian.fricke@collabora.com; nicolas.dufresne@collabora.com
> Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org; lafley.kim
> <lafley.kim@chipsnmedia.com>; b-brnich@ti.com; hverkuil@xs4all.nl; Nas
> Chung <nas.chung@chipsnmedia.com>
> Subject: RE: [PATCH v2 0/4] Fix critical bugs
>
> Hi Sebastian and Nicolas
>
> Can you review the following patch series?
>
> https://patchwork.linuxtv.org/project/linux-media/cover/20241217045125.58-
> 1-jackson.lee@chipsnmedia.com/
>
>
> thanks
> Jackson
>
> > -----Original Message-----
> > From: jackson.lee
> > Sent: Tuesday, December 17, 2024 1:52 PM
> > To: mchehab@kernel.org; hverkuil-cisco@xs4all.nl;
> > sebastian.fricke@collabora.com; nicolas.dufresne@collabora.com;
> > bob.beckett@collabora.com; dafna.hirschfeld@collabora.com
> > Cc: linux-media@vger.kernel.org; linux-kernel@vger.kernel.org;
> > jackson.lee <jackson.lee@chipsnmedia.com>; lafley.kim
> > <lafley.kim@chipsnmedia.com>; b- brnich@ti.com; hverkuil@xs4all.nl;
> > Nas Chung <nas.chung@chipsnmedia.com>
> > Subject: [PATCH v2 0/4] 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(-)
> >
> > --
> > 2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread