]> git.baikalelectronics.ru Git - kernel.git/commit
drm/client: Support unmapping of DRM client buffers
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 3 Jul 2019 07:58:18 +0000 (09:58 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 1 Aug 2019 13:01:22 +0000 (15:01 +0200)
commit97df56e527a53362e83c5ba77d21b25556b9b1cc
treee1bccd37044f023cf4237fe92d3f1f18989641b6
parente9b79a27dcd331be4729e21ae07fe48e6731c8d0
drm/client: Support unmapping of DRM client buffers

DRM clients, such as the fbdev emulation, have their buffer objects
mapped by default. Mapping a buffer implicitly prevents its relocation.
Hence, the buffer may permanently consume video memory while it's
allocated. This is a problem for drivers of low-memory devices, such as
ast, mgag200 or older framebuffer hardware, which will then not have
enough memory to display other content (e.g., X11).

This patch introduces drm_client_buffer_vmap() and _vunmap(). Internal
DRM clients can use these functions to unmap and remap buffer objects
as needed.

There's no reference counting for vmap operations. Callers are expected
to either keep buffers mapped (as it is now), or call vmap and vunmap
in pairs around code that accesses the mapped memory.

v2:
* remove several duplicated NULL-pointer checks
v3:
* style and typo fixes

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/315831/
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
drivers/gpu/drm/drm_client.c
include/drm/drm_client.h