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: <d9498772-d9f5-7b25-72af-04249619ce07@xs4all.nl>
Date:   Thu, 23 Jan 2020 12:41:36 +0100
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>
Cc:     Hans Verkuil <hans.verkuil@...co.com>,
        Tomasz Figa <tfiga@...omium.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Kyungmin Park <kyungmin.park@...sung.com>,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Sakari Ailus <sakari.ailus@....fi>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Pawel Osciak <posciak@...omium.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 06/15] videobuf2: handle
 V4L2_FLAG_MEMORY_NON_CONSISTENT in CREATE_BUFS

On 1/23/20 4:41 AM, Sergey Senozhatsky wrote:
> On (20/01/10 10:59), Hans Verkuil wrote:
> [..]
>>>  
>>>  	num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);
>>> diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
>>> index 0eabb589684f..48d123a1ac2a 100644
>>> --- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
>>> +++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
>>> @@ -730,6 +730,7 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
>>>  	unsigned requested_sizes[VIDEO_MAX_PLANES];
>>>  	struct v4l2_format *f = &create->format;
>>>  	int ret = vb2_verify_memory_type(q, create->memory, f->type);
>>> +	bool consistent = true;
>>>  	unsigned i;
>>>  
>>>  	fill_buf_caps(q, &create->capabilities);
>>> @@ -775,7 +776,11 @@ int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create)
>>>  	for (i = 0; i < requested_planes; i++)
>>>  		if (requested_sizes[i] == 0)
>>>  			return -EINVAL;
>>> -	return ret ? ret : vb2_core_create_bufs(q, create->memory,
>>> +
>>> +	if (create->flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
>>> +		consistent = false;
>>> +
>>> +	return ret ? ret : vb2_core_create_bufs(q, create->memory, consistent,
>>>  		&create->count, requested_planes, requested_sizes);
>>
>> As mentioned before: we need a V4L2_BUF_CAP capability.
> 
> I can add V4L2_BUF_CAP for memory consistency. Isn't it just q->memory
> property though? User space may request MMAP consistent memory or MMAP
> inconsistent memory.

So instead of adding a flag we add a V4L2_MEMORY_MMAP_NON_CONSISTENT memory
type and add a V4L2_BUF_CAP_SUPPORTS_MMAP_NON_CONSISTENT to signal support
for this?

I like that better than a flag. It also automatically enforces that all
buffers must be of that type.

Regards,

	Hans

> 
> 	-ss
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ