media: vb2-dc: skip CPU sync in map/unmap dma_buf
authorLucas Stach <l.stach@pengutronix.de>
Mon, 8 Jul 2019 13:07:42 +0000 (09:07 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 23 Jul 2019 15:46:27 +0000 (11:46 -0400)
commit596a5a58e89a4bfe0d8a275ab552de990b18f0ac
tree3446af715a7c8fb4e68c6ea1676772f03ddc2f25
parent81f96ebc8a663869948c197c60f0356f247ac91c
media: vb2-dc: skip CPU sync in map/unmap dma_buf

This is rougly equivalent to ca0e68e21aae (drm/prime: skip CPU sync
in map/unmap dma_buf). The contig memory allocated is already device
coherent memory, so there is no point in doing a CPU sync when
mapping it to another device. Also most importers currently cache
the mapping so the CPU sync would only happen on the first import,
so we are better off with not pretending to do a cache synchronization
at all.

This gets rid of a lot of CPU overhead in uses where those dma-bufs
are regularily imported and detached again, like Weston is currently
doing in the DRM compositor.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: fix checkpatch warnings]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-dma-contig.c