From: Kamil Debski <k.debski@samsung.com>
To: 'Andrzej Hajda' <a.hajda@samsung.com>,
"'open list:ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC)...'"
<linux-media@vger.kernel.org>
Cc: 'Bartlomiej Zolnierkiewicz' <b.zolnierkie@samsung.com>,
'Marek Szyprowski' <m.szyprowski@samsung.com>,
'Kyungmin Park' <kyungmin.park@samsung.com>,
'Jeongtae Park' <jtp.park@samsung.com>,
'Mauro Carvalho Chehab' <mchehab@osg.samsung.com>,
linux-samsung-soc@vger.kernel.org
Subject: RE: [PATCH v2 2/2] s5p-mfc: use MFC_BUF_FLAG_EOS to identify last buffers in decoder capture queue
Date: Fri, 02 Oct 2015 14:44:22 +0200 [thread overview]
Message-ID: <002701d0fd10$1056ea60$3104bf20$@samsung.com> (raw)
In-Reply-To: <1443787779-18458-2-git-send-email-a.hajda@samsung.com>
Hi Andrzej,
> From: Andrzej Hajda [mailto:a.hajda@samsung.com]
> Sent: Friday, October 02, 2015 2:10 PM
>
> MFC driver never delivered EOS event to apps feeding constantly its
capture
> buffer with fresh buffers. The patch fixes it by marking last buffers
returned
> by MFC with MFC_BUF_FLAG_EOS flag and firing EOS event on de-queuing
> such buffers.
Checkpatch complains that lines in the description are too long.
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars
per line)
#23:
Best wishes,
--
Kamil Debski
Samsung R&D Institute Poland
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> Hi,
>
> This version is rebased on latest media_tree branch.
>
> Regards
> Andrzej
> ---
> drivers/media/platform/s5p-mfc/s5p_mfc.c | 1 +
> drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 21 +++++++++++++-------
> -
> 2 files changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 05a31ee..3ffe2ec 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -196,6 +196,7 @@ static void
> s5p_mfc_handle_frame_all_extracted(struct s5p_mfc_ctx *ctx)
> vb2_set_plane_payload(&dst_buf->b->vb2_buf, 0, 0);
> vb2_set_plane_payload(&dst_buf->b->vb2_buf, 1, 0);
> list_del(&dst_buf->list);
> + dst_buf->flags |= MFC_BUF_FLAG_EOS;
> ctx->dst_queue_cnt--;
> dst_buf->b->sequence = (ctx->sequence++);
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> index 1734775..8d3d40c 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
> @@ -645,17 +645,22 @@ static int vidioc_dqbuf(struct file *file, void
*priv,
> struct v4l2_buffer *buf)
> mfc_err("Call on DQBUF after unrecoverable error\n");
> return -EIO;
> }
> - if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
> - ret = vb2_dqbuf(&ctx->vq_src, buf, file->f_flags &
> O_NONBLOCK);
> - else if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
> +
> + switch (buf->type) {
> + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> + return vb2_dqbuf(&ctx->vq_src, buf, file->f_flags &
> O_NONBLOCK);
> + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> ret = vb2_dqbuf(&ctx->vq_dst, buf, file->f_flags &
> O_NONBLOCK);
> - if (ret == 0 && ctx->state == MFCINST_FINISHED &&
> - list_empty(&ctx->vq_dst.done_list))
> + if (ret)
> + return ret;
> +
> + if (ctx->state == MFCINST_FINISHED &&
> + (ctx->dst_bufs[buf->index].flags & MFC_BUF_FLAG_EOS))
> v4l2_event_queue_fh(&ctx->fh, &ev);
> - } else {
> - ret = -EINVAL;
> + return 0;
> + default:
> + return -EINVAL;
> }
> - return ret;
> }
>
> /* Export DMA buffer */
> --
> 1.9.1
next prev parent reply other threads:[~2015-10-02 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 12:09 [PATCH v2 1/2] s5p-mfc: end-of-stream handling for newer encoders Andrzej Hajda
2015-10-02 12:09 ` [PATCH v2 2/2] s5p-mfc: use MFC_BUF_FLAG_EOS to identify last buffers in decoder capture queue Andrzej Hajda
2015-10-02 12:44 ` Kamil Debski [this message]
2015-10-07 10:13 ` [PATCH v3 " Andrzej Hajda
2015-10-02 12:44 ` [PATCH v2 1/2] s5p-mfc: end-of-stream handling for newer encoders Kamil Debski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='002701d0fd10$1056ea60$3104bf20$@samsung.com' \
--to=k.debski@samsung.com \
--cc=a.hajda@samsung.com \
--cc=b.zolnierkie@samsung.com \
--cc=jtp.park@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox