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]
Date:   Tue, 22 May 2018 13:57:50 +0200
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Ezequiel Garcia <ezequiel@...labora.com>,
        linux-media@...r.kernel.org
Cc:     kernel@...labora.com,
        Mauro Carvalho Chehab <mchehab@....samsung.com>,
        Shuah Khan <shuahkh@....samsung.com>,
        Pawel Osciak <pawel@...iak.com>,
        Alexandre Courbot <acourbot@...omium.org>,
        Sakari Ailus <sakari.ailus@....fi>,
        Brian Starkey <brian.starkey@....com>,
        linux-kernel@...r.kernel.org,
        Gustavo Padovan <gustavo.padovan@...labora.com>
Subject: Re: [PATCH v10 09/16] cobalt: add .is_unordered() for cobalt

On 21/05/18 18:59, Ezequiel Garcia wrote:
> From: Gustavo Padovan <gustavo.padovan@...labora.com>
> 
> The cobalt driver may reorder the capture buffers so we need to report
> it as such.
> 
> v3: set formats as unordered
> v2: use vb2_ops_set_unordered() helper
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@...labora.com>
> Signed-off-by: Ezequiel Garcia <ezequiel@...labora.com>
> ---
>  drivers/media/pci/cobalt/cobalt-v4l2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c
> index e2a4c705d353..ccca1a96df90 100644
> --- a/drivers/media/pci/cobalt/cobalt-v4l2.c
> +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c
> @@ -430,6 +430,7 @@ static const struct vb2_ops cobalt_qops = {
>  	.stop_streaming = cobalt_stop_streaming,
>  	.wait_prepare = vb2_ops_wait_prepare,
>  	.wait_finish = vb2_ops_wait_finish,
> +	.is_unordered = vb2_ops_is_unordered,
>  };
>  
>  /* V4L2 ioctls */
> @@ -695,14 +696,17 @@ static int cobalt_enum_fmt_vid_cap(struct file *file, void *priv_fh,
>  	case 0:
>  		strlcpy(f->description, "YUV 4:2:2", sizeof(f->description));
>  		f->pixelformat = V4L2_PIX_FMT_YUYV;
> +		f->flags |= V4L2_FMT_FLAG_UNORDERED;
>  		break;
>  	case 1:
>  		strlcpy(f->description, "RGB24", sizeof(f->description));
>  		f->pixelformat = V4L2_PIX_FMT_RGB24;
> +		f->flags |= V4L2_FMT_FLAG_UNORDERED;
>  		break;
>  	case 2:
>  		strlcpy(f->description, "RGB32", sizeof(f->description));
>  		f->pixelformat = V4L2_PIX_FMT_BGR32;
> +		f->flags |= V4L2_FMT_FLAG_UNORDERED;

Rather than adding this for every case, just move it out of the switch and
set it just before the 'return 0'.

Regards,

	Hans

>  		break;
>  	default:
>  		return -EINVAL;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ