]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Add support for GEM buffers backed by non-coherent memory
authorPaul Cercueil <paul@crapouillou.net>
Sun, 23 May 2021 17:04:13 +0000 (18:04 +0100)
committerPaul Cercueil <paul@crapouillou.net>
Tue, 25 May 2021 10:41:07 +0000 (11:41 +0100)
commit28b5afd08d804149af19cd02ed22257853430491
treee1caa0c6dfe844c338b6f057a7ff6c967a7b2a12
parenta122721d63313bd8f0403a4ce8e35c7ed9c22f5d
drm: Add support for GEM buffers backed by non-coherent memory

Having GEM buffers backed by non-coherent memory is interesting in the
particular case where it is faster to render to a non-coherent buffer
then sync the data cache, than to render to a write-combine buffer, and
(by extension) much faster than using a shadow buffer. This is true for
instance on some Ingenic SoCs, where even simple blits (e.g. memcpy)
are about three times faster using this method.

Add a 'map_noncoherent' flag to the drm_gem_cma_object structure, which
can be set by the drivers when they create the dumb buffer.

Since this really only applies to software rendering, disable this flag
as soon as the CMA objects are exported via PRIME.

v3: New patch. Now uses a simple 'map_noncoherent' flag to control how
    the objects are mapped, and use the new dma_mmap_pages function.

v4: Make sure map_noncoherent is always disabled when creating GEM
    objects meant to be used with dma-buf.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20210523170415.90410-2-paul@crapouillou.net
drivers/gpu/drm/drm_gem_cma_helper.c
include/drm/drm_gem_cma_helper.h