]> git.baikalelectronics.ru Git - kernel.git/commit
drm: omapdrm: Support exporting of non-contiguous GEM BOs
authorIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Wed, 19 Jan 2022 10:23:10 +0000 (12:23 +0200)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Mon, 28 Mar 2022 09:39:51 +0000 (12:39 +0300)
commitcf1b35890911bb4d1d712ce08f4c9f8dc143beb6
treebb85608a867696f28adab62cd43cd7e5cd4d6f8b
parent1db717ba5729e0da693822c3b2316616b3684c94
drm: omapdrm: Support exporting of non-contiguous GEM BOs

Currently code allocates non-scanout BOs from SHMEM and those objects are
accessible to userspace by mmap(). However, on devices with no DMM (like
OMAP3), the same objects are not accessible by kernel drivers that want to
render to them as code refuses to export them. In turn this means that on
devices with no DMM, all buffers must be allocated as scanout, otherwise
only CPU can access them. On those devices, scanout buffers are allocated
from CMA, making those allocations highly unreliable.

Fix that by implementing functionality to export SHMEM backed buffers on
devices with no DMM. This makes CMA memory only being used when needed,
instead for every buffer that has to be off-CPU rendered.

Tested on Motorola Droid4 and Nokia N900

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1642587791-13222-3-git-send-email-ivo.g.dimitrov.75@gmail.com
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/omapdrm/omap_gem.h
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c