[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffc49cd8740472cc968e9e4f8ed0784a7a0eb9ac.camel@collabora.com>
Date: Fri, 13 Dec 2024 14:50:29 -0500
From: Nicolas Dufresne <nicolas.dufresne@...labora.com>
To: "Jackson.lee" <jackson.lee@...psnmedia.com>, mchehab@...nel.org,
hverkuil-cisco@...all.nl, sebastian.fricke@...labora.com,
bob.beckett@...labora.com, dafna.hirschfeld@...labora.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
lafley.kim@...psnmedia.com, b-brnich@...com, hverkuil@...all.nl,
nas.chung@...psnmedia.com
Subject: Re: [PATCH v1 4/5] media: chips-media: wave5: Fix hang after seeking
Le lundi 09 décembre 2024 à 14:36 +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@...psnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@...psnmedia.com>
Looks reasonable to me, can this patch be apply before 3/5 and merged already ?
Also, can that be added a Fixes that ? Its is otherwise from this serie stand
point:
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@...labora.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 b0e1f94bdb30..ce3fc47dc9d8 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> @@ -1431,6 +1431,16 @@ static int streamoff_output(struct vb2_queue *q)
> int ret;
> dma_addr_t new_rd_ptr;
> struct vpu_src_buffer *vpu_buf, *tmp;
> + 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);
> + }
>
> inst->retry = false;
> inst->queuing_num = 0;
> @@ -1444,6 +1454,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;
> @@ -1526,7 +1541,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 9a28d0f770bc..bcb8e6a37843 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);
Powered by blists - more mailing lists