]> git.baikalelectronics.ru Git - kernel.git/commit
drm/prime: skip CPU sync in map/unmap dma_buf
authorLucas Stach <l.stach@pengutronix.de>
Thu, 30 Nov 2017 17:34:28 +0000 (18:34 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 4 Dec 2017 16:30:19 +0000 (17:30 +0100)
commitec1e52be1059936da6ee89cb622e28cbfbe5b22a
treed2bc5239f3e104575f6fde63d62fd0382f6a346f
parent31d755c302b9a1d269f498d7eb2b6d9989ec648e
drm/prime: skip CPU sync in map/unmap dma_buf

Dma-bufs should already be device coherent, as they are only pulled in the
CPU domain via the begin/end cpu_access calls. As we cache the mapping set
up by dma_map_sg a CPU sync at this point will not actually guarantee proper
coherency on non-coherent architectures, so we can as well stop pretending.

This is an important performance fix for architectures which need explicit
cache synchronization and userspace doing lots of dma-buf imports.
Improves Weston on Etnaviv performance 5x, where before this patch > 90%
of Weston CPU time was spent synchronizing caches for buffers which are
already device coherent.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171130173428.8666-1-l.stach@pengutronix.de
drivers/gpu/drm/drm_prime.c