[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)
committerhskang <hs1218.kang@samsung.com>
Wed, 20 Feb 2019 01:00:38 +0000 (10:00 +0900)
commit573e921765639eb0ccc30001b475d2c58bdafe24
tree3465cd624f296c5e7527970cc4fa95042192b1d2
parent05d638b3359bac358953d0d53a8b0aee33131902
[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