Thread (20 messages) 20 messages, 3 authors, 2021-07-27

Re: [PATCHv3 7/8] videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag

From: Sergey Senozhatsky <senozhatsky@chromium.org>
Date: 2021-07-26 04:06:06
Also in: lkml

On (21/07/26 10:40), Sergey Senozhatsky wrote:
On (21/07/22 19:33), Dafna Hirschfeld wrote:
[..]
quoted
quoted
  int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
  {
  	int ret = vb2_verify_memory_type(q, req->memory, req->type);
+	u32 flags = req->flags;
  	fill_buf_caps(q, &req->capabilities);
-	return ret ? ret : vb2_core_reqbufs(q, req->memory, 0, &req->count);
+	validate_memory_flags(q, req->memory, &flags);
+	req->flags = flags;
you can do instead

validate_memory_flags(q, req->memory, &req->flags);
->flags are u32 for create-bufs and u8 for reqi-bufs. So `*flags = <value>`
can write to ->reserved[] for req-bufs (if the value is huge enough).
I guess ->flags can become u8 for both create-bufs and req-bufs.
We had ->flags in both structs as u32, but then decided to leave
some reserved[] space in req-bufs and switched to u8 there.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help