linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Cc: Linux Media <linux-media@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-mentors@selenic.com" <kernel-mentors@selenic.com>,
	devel@driverdev.osuosl.org,
	kernel-janitors <kernel-janitors@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Andrey Utkin <andrey_utkin@fastmail.com>
Subject: Re: [RFC PATCH v0] Add tw5864 driver
Date: Fri, 11 Mar 2016 10:59:02 +0100	[thread overview]
Message-ID: <56E296E6.8000709@xs4all.nl> (raw)
In-Reply-To: <20160311104003.1cad89f3@zver>

On 03/11/2016 09:40 AM, Andrey Utkin wrote:
> On Fri, 11 Mar 2016 09:00:18 +0100
> Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> The reason is likely to be the tw5864_queue_setup function which has
>> not been updated to handle CREATE_BUFS support correctly. It should
>> look like this:
>>
>> static int tw5864_queue_setup(struct vb2_queue *q,
>> 			      unsigned int *num_buffers,
>> 			      unsigned int *num_planes, unsigned int
>> sizes[], void *alloc_ctxs[])
>> {
>> 	struct tw5864_input *dev = vb2_get_drv_priv(q);
>>
>> 	if (q->num_buffers + *num_buffers < 12)
>> 		*num_buffers = 12 - q->num_buffers;
>>
>> 	alloc_ctxs[0] = dev->alloc_ctx;
>> 	if (*num_planes)
>> 		return sizes[0] < H264_VLC_BUF_SIZE ? -EINVAL : 0;
>>
>> 	sizes[0] = H264_VLC_BUF_SIZE;
>> 	*num_planes = 1;
>>
>> 	return 0;
>> }
> 
> Thanks for suggestion, but now the failure looks this way:
> 
> Streaming ioctls:
>         test read/write: OK
>                 fail: v4l2-test-buffers.cpp(297): g_field() == V4L2_FIELD_ANY

While userspace may specify FIELD_ANY when setting a format, the driver should
always map that to a specific field setting and should never return FIELD_ANY
back to userspace.

In this case, the 'field' field of the v4l2_buffer struct has FIELD_ANY which
means it is not set correctly (or at all) in the driver.

It's a common mistake, which is why v4l2-compliance tests for it :-)

Regards,

	Hans

>                 fail: v4l2-test-buffers.cpp(703): buf.check(q, last_seq)
>                 fail: v4l2-test-buffers.cpp(976): captureBufs(node, q, m2m_q, frame_count, false)
>         test MMAP: FAIL
> 
> Will check that later. If you have any suggestions, I would be very
> grateful.
> --
> 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
> 

  reply	other threads:[~2016-03-11  9:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03  1:41 [RFC PATCH v0] Add tw5864 driver Andrey Utkin
2016-01-03  3:47 ` Joe Perches
2016-01-03 13:34   ` Andrey Utkin
2016-01-03  5:38 ` Leon Romanovsky
2016-01-11 10:52 ` Hans Verkuil
2016-01-15  2:13   ` Andrey Utkin
2016-02-08  9:58     ` Hans Verkuil
2016-02-08 10:23       ` Andrey Utkin
2016-02-08 10:29         ` Hans Verkuil
2016-03-09 14:29       ` Andrey Utkin
2016-03-11  8:00         ` Hans Verkuil
2016-03-11  8:40           ` Andrey Utkin
2016-03-11  9:59             ` Hans Verkuil [this message]
2016-03-11 13:23               ` Andrey Utkin

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=56E296E6.8000709@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=andrey.utkin@corp.bluecherry.net \
    --cc=andrey_utkin@fastmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kernel-mentors@selenic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).