]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Add additional atomic helpers for shadow-buffered planes
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 8 Feb 2021 11:55:34 +0000 (12:55 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 8 Feb 2021 12:00:14 +0000 (13:00 +0100)
commitffa1598caea28055e5b2ba49d448cef2e0b138c4
tree6232501cad483644006436c738f5aa293cb8ab63
parent9a9de01934759e8aaa3b45f90f878a62e2d0c503
drm: Add additional atomic helpers for shadow-buffered planes

Several drivers use GEM buffer objects as shadow buffers for the actual
framebuffer memory. Right now, drivers do these vmap operations in their
commit tail, which is actually not allowed by the locking rules for
the dma-buf reservation lock. The involved BO has to be vmapped in the
plane's prepare_fb callback and vunmapped in cleanup_fb.

This patch introduces atomic helpers for such shadow planes. Plane
functions manage the plane state for shadow planes. The provided
implementations for prepare_fb and cleanup_fb vmap and vunmap all BOs of
struct drm_plane_state.fb. The mappings are afterwards available in the
plane's commit-tail functions.

For now, all rsp drivers use the simple KMS helpers, so we add the plane
callbacks and wrappers for simple KMS. The internal plane functions can
later be exported as needed.

v3:
* documentation fixes
v2:
* make duplicate_state interface compatible with
  struct drm_plane_funcs

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210208115538.6430-4-tzimmermann@suse.de
Documentation/gpu/drm-kms-helpers.rst
drivers/gpu/drm/Makefile
drivers/gpu/drm/drm_gem_atomic_helper.c [new file with mode: 0644]
include/drm/drm_gem_atomic_helper.h [new file with mode: 0644]