[RAMEN9610-12270] media: vb2: deliver alloc/map context to memops
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 18 Feb 2019 03:57:02 +0000 (12:57 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:17 +0000 (20:23 +0300)
commit632f89bc10b8d87aef2299b66ecac30b3452a22f
tree9bcd74eced635ed68187535c1420ff9477083acb
parent7a336555a41a33b29d03fae8598ac08c332130b1
[RAMEN9610-12270] media: vb2: deliver alloc/map context to memops

vb2 memops never know about the context in which it is working because
vb2 does not deliver information about the current working context.
However, vb2 memops sometimes needs to know the current context to
improve the performance or manage memory access correctly. Instead of
passing such information from vb2-core, it had better generated from
the client drivers because the information might be driver-specific
or memops-specific.
Let's deliver the information with flags. The flags should be memops-
specific and the client drivers can configure the flags in a callback,
memops.mem_flags(). It is called before .alloc() for mmap,
.get_userptr() for userptr and .map_dmabuf() for dmabuf.
The flags are defined by and specific to memops implementations.

Change-Id: I0b68df4bed659fb99e94755bf9333594b68c0b3b
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/media/v4l2-core/videobuf2-core.c
drivers/media/v4l2-core/videobuf2-dma-sg.c
include/media/videobuf2-core.h