From: Junghak Sung <jh1009.sung@samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
linux-media@vger.kernel.org, mchehab@osg.samsung.com,
laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi,
pawel@osciak.com
Cc: inki.dae@samsung.com, sw0312.kim@samsung.com,
nenggun.kim@samsung.com, sangbae90.lee@samsung.com,
rany.kwon@samsung.com
Subject: Re: [RFC PATCH v9 4/6] media: videobuf2: last_buffer_queued is set at fill_v4l2_buffer()
Date: Mon, 09 Nov 2015 16:48:01 +0900 [thread overview]
Message-ID: <56404FB1.6050401@samsung.com> (raw)
In-Reply-To: <563B28A0.8080202@xs4all.nl>
On 11/05/2015 07:00 PM, Hans Verkuil wrote:
> On 11/03/15 11:16, Junghak Sung wrote:
>> The location in which last_buffer_queued is set is moved to fill_v4l2_buffer().
>> So, __vb2_perform_fileio() can use vb2_core_dqbuf() instead of
>> vb2_internal_dqbuf().
>>
>> Signed-off-by: Junghak Sung <jh1009.sung@samsung.com>
>> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com>
>> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
>> Acked-by: Inki Dae <inki.dae@samsung.com>
>
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
>
> One comment: I think the struct vb2_buf_ops callbacks can all return void
> instead of int. I don't think they should ever be allowed to fail.
>
> If you agree, then that can be changed in a separate later.
>
Dear Hans,
IMHO, it seems to be better that vb2_buf_ops callbacks return int
as it is. Because fill_vb2_buffer() includes verifying the bytesused
value for each plane and checking ALTERNATE field for output buffer.
It can return fail if the information provided in a v4l2_buffer
by the userspace is not proper.
Best regards,
Junghak
> Regards,
>
> Hans
>
>> ---
>> drivers/media/v4l2-core/videobuf2-v4l2.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/videobuf2-v4l2.c b/drivers/media/v4l2-core/videobuf2-v4l2.c
>> index 0ca9f23..b0293df 100644
>> --- a/drivers/media/v4l2-core/videobuf2-v4l2.c
>> +++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
>> @@ -270,6 +270,11 @@ static int __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
>> if (vb2_buffer_in_use(q, vb))
>> b->flags |= V4L2_BUF_FLAG_MAPPED;
>>
>> + if (!q->is_output &&
>> + b->flags & V4L2_BUF_FLAG_DONE &&
>> + b->flags & V4L2_BUF_FLAG_LAST)
>> + q->last_buffer_dequeued = true;
>> +
>> return 0;
>> }
>>
>> @@ -579,10 +584,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b,
>>
>> ret = vb2_core_dqbuf(q, b, nonblocking);
>>
>> - if (!ret && !q->is_output &&
>> - b->flags & V4L2_BUF_FLAG_LAST)
>> - q->last_buffer_dequeued = true;
>> -
>> return ret;
>> }
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-11-09 7:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 10:16 [RFC PATCH v9] Refactoring Videobuf2 for common use Junghak Sung
2015-11-03 10:16 ` [RFC PATCH v9 1/6] media: videobuf2: Move timestamp to vb2_buffer Junghak Sung
2015-11-04 12:28 ` Hans Verkuil
2015-11-05 3:12 ` Junghak Sung
2015-11-05 7:50 ` Hans Verkuil
2015-11-03 10:16 ` [RFC PATCH v9 2/6] media: videobuf2: Add set_timestamp to struct vb2_queue Junghak Sung
2015-11-04 12:41 ` Hans Verkuil
2015-11-05 3:19 ` Junghak Sung
2015-11-03 10:16 ` [RFC PATCH v9 3/6] media: videobuf2: Separate vb2_poll() Junghak Sung
2015-11-05 9:55 ` Hans Verkuil
2015-11-03 10:16 ` [RFC PATCH v9 4/6] media: videobuf2: last_buffer_queued is set at fill_v4l2_buffer() Junghak Sung
2015-11-05 10:00 ` Hans Verkuil
2015-11-09 7:48 ` Junghak Sung [this message]
2015-11-03 10:16 ` [RFC PATCH v9 5/6] media: videobuf2: Refactor vb2_fileio_data and vb2_thread Junghak Sung
2015-11-05 11:10 ` Hans Verkuil
2015-11-03 10:16 ` [RFC PATCH v9 6/6] media: videobuf2: Move vb2_fileio_data and vb2_thread to core part Junghak Sung
2015-11-05 11:14 ` Hans Verkuil
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=56404FB1.6050401@samsung.com \
--to=jh1009.sung@samsung.com \
--cc=hverkuil@xs4all.nl \
--cc=inki.dae@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=nenggun.kim@samsung.com \
--cc=pawel@osciak.com \
--cc=rany.kwon@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=sangbae90.lee@samsung.com \
--cc=sw0312.kim@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;
as well as URLs for NNTP newsgroup(s).