lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201302041157.45340.hverkuil@xs4all.nl>
Date:	Mon, 4 Feb 2013 11:57:45 +0100
From:	Hans Verkuil <hverkuil@...all.nl>
To:	Federico Vaga <federico.vaga@...il.com>
Cc:	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Mauro Carvalho Chehab <mchehab@...radead.org>,
	Giancarlo Asnaghi <giancarlo.asnaghi@...com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] sta2x11_vip: convert to videobuf2, control framework, file handler

On Wed January 23 2013 15:07:06 Federico Vaga wrote:
> This patch re-write the driver and use the videobuf2
> interface instead of the old videobuf. Moreover, it uses also
> the control framework which allows the driver to inherit
> controls from its subdevice (ADV7180). Finally the driver does not
> implement custom file operation but it uses the generic ones from
> videobuf2 and v4l2_fh
> 
> Signed-off-by: Federico Vaga <federico.vaga@...il.com>
> Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@...com>
> ---
>  drivers/media/pci/sta2x11/Kconfig       |    2 +-
>  drivers/media/pci/sta2x11/sta2x11_vip.c | 1071 +++++++++++++------------------
>  2 file modificati, 432 inserzioni(+), 641 rimozioni(-)
> 
> @@ -797,12 +601,11 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
>  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;
> +		v4l2_warn(&vip->v4l2_dev, "Invalid format, only UYVY supported\n");

As mentioned in my v4 review, keep the return -EINVAL here. As long as it is
uncertain what try_fmt should do with unsupported pixelformats we shouldn't
change this behavior.

Regards,

	Hans

>  
>  	if (V4L2_STD_525_60 & vip->std)
>  		interlace_lim = 240;
> @@ -810,6 +613,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
>  		interlace_lim = 288;
>  
>  	switch (f->fmt.pix.field) {
> +	default:
>  	case V4L2_FIELD_ANY:
>  		if (interlace_lim < f->fmt.pix.height)
>  			f->fmt.pix.field = V4L2_FIELD_INTERLACED;
> @@ -823,10 +627,10 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
>  		break;
>  	case V4L2_FIELD_INTERLACED:
>  		break;
> -	default:
> -		return -EINVAL;
>  	}
>  
> +	/* It is the only supported format */
> +	f->fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
>  	f->fmt.pix.height &= ~1;
>  	if (2 * interlace_lim < f->fmt.pix.height)
>  		f->fmt.pix.height = 2 * interlace_lim;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ