The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Federico Vaga <federico.vaga@gmail.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Pawel Osciak <pawel@osciak.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Giancarlo Asnaghi <giancarlo.asnaghi@st.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jonathan Corbet <corbet@lwn.net>
Subject: Re: [PATCH v2 3/4] sta2x11_vip: convert to videobuf2 and control framework
Date: Sun, 23 Sep 2012 19:20:04 +0200	[thread overview]
Message-ID: <1568507.e1NUzqJ3mL@harkonnen> (raw)
In-Reply-To: <201209211147.06204.hverkuil@xs4all.nl>

> > +struct sta2x11_vip_fh {
> > +	struct v4l2_fh fh;
> > +};
> 
> No need to make a sta2x11_vip_fh struct, just use v4l2_fh directly. It
> doesn't add anything. In fact, it's not even used.

Thank you :)


> >  static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
> >  
> >  				  struct v4l2_format *f)
> >  
> >  {
> > 
> > -	struct video_device *dev = priv;
> > -	struct sta2x11_vip *vip = video_get_drvdata(dev);
> > +	struct sta2x11_vip *vip = video_drvdata(file);
> > 
> >  	int interlace_lim;
> > 
> > -	if (V4L2_PIX_FMT_UYVY != f->fmt.pix.pixelformat)
> > -		return -EINVAL;
> > -
> > 
> >  	if (V4L2_STD_525_60 & vip->std)
> >  	
> >  		interlace_lim = 240;
> >  	
> >  	else
> > 
> > @@ -827,6 +522,8 @@ static int vidioc_try_fmt_vid_cap(struct file
> > *file, void *priv,> 
> >  		return -EINVAL;
> 
> No -EINVAL allowed anymore in try_fmt_vid_cap. I generally handle
> unknown field values in try_fmt_vid_cap as if FIELD_ANY was
> specified.

ok, unknown -> any

> > 
> >  	memcpy(&vip->format, &f->fmt.pix, sizeof(struct 
v4l2_pix_format));
> 
> Just use an assignment: vip->format = f->fmt.pix
> 

> > 
> >  	memcpy(&f->fmt.pix, &vip->format, sizeof(struct 
v4l2_pix_format));
> 
> Assignment
> 

Fixed


> > -
> > 
> >  static const struct v4l2_ioctl_ops vip_ioctl_ops = {
> >  
> >  	.vidioc_querycap = vidioc_querycap,
> > 
> > -	.vidioc_s_std = vidioc_s_std,
> > +	/* FMT handling */
> > +	.vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
> > +	.vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
> > +	.vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
> > +	.vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
> > +	/* Buffer handlers */
> > +	.vidioc_reqbufs = vb2_ioctl_reqbufs,
> > +	.vidioc_querybuf = vb2_ioctl_querybuf,
> > +	.vidioc_qbuf = vb2_ioctl_qbuf,
> > +	.vidioc_dqbuf = vb2_ioctl_dqbuf,
> > +	.vidioc_create_bufs = vb2_ioctl_create_bufs,
> 
> If you want to use create_bufs, then in queue_setup() you need to
> handle the fmt argument. See e.g. vivi.c for an example.

Fixed

I will send a patch v3 tomorrow
-- 
Federico Vaga

  reply	other threads:[~2012-09-23 17:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  9:21 [PATCH 1/4] v4l: vb2: add prepare/finish callbacks to allocators Federico Vaga
2012-09-21  9:21 ` [PATCH v2 2/4] videobuf2-dma-streaming: new videobuf2 memory allocator Federico Vaga
2012-09-21  9:21 ` [PATCH v2 3/4] sta2x11_vip: convert to videobuf2 and control framework Federico Vaga
2012-09-21  9:47   ` Hans Verkuil
2012-09-23 17:20     ` Federico Vaga [this message]
2012-09-21  9:21 ` [PATCH v2 4/4] adv7180: remove {query/g_/s_}ctrl Federico Vaga
2012-09-21  9:36 ` [PATCH 1/4] v4l: vb2: add prepare/finish callbacks to allocators Hans Verkuil
2012-09-21  9:54   ` Federico Vaga
     [not found] <002e01cd91b9110d1603327420$%szyprowski@samsung.com>
2012-09-21  9:13 ` [PATCH v2 3/4] sta2x11_vip: convert to videobuf2 and control framework federico.vaga

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=1568507.e1NUzqJ3mL@harkonnen \
    --to=federico.vaga@gmail.com \
    --cc=corbet@lwn.net \
    --cc=giancarlo.asnaghi@st.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@infradead.org \
    --cc=pawel@osciak.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