drm/gem: Implement shadow-plane {begin, end}_fb_access with vmap
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 25 Oct 2022 10:17:37 +0000 (12:17 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 8 Nov 2022 16:10:41 +0000 (17:10 +0100)
commit359c6649cd9ab3907bcaf20ed67b9646c94a7742
tree1e3e003ba7b9f6c12c9049b8d5b48584f3b2fdd1
parent94d879eaf7fb02a0d022a190278b3fd45b1efbd7
drm/gem: Implement shadow-plane {begin, end}_fb_access with vmap

Move the vmap code for shadow-plane helpers from prepare_fb to
begin_fb_access helpers. Vunmap is now performed at the end of
the current pageflip, instead of the end of the following pageflip.

Reduces the duration of the mapping from while the framebuffer is
being displayed to just the atomic commit. This is safe as outside
of the pageflip, nothing should access the mapped buffer memory.
Unmapping the framebuffer BO memory early allows to reduce address-
space consumption and possibly allows for evicting the memory pages.

The change is effectively a rename of prepare_fb and cleanup_fb
implementations, plus updates to the shadow-plane init macro. As
there's no longer a prepare_fb helper for shadow planes, atomic
helpers will call drm_gem_plane_helper_prepare_fb() automatically.

v2:
* fix typos in commit message (Javier)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221025101737.8874-3-tzimmermann@suse.de
drivers/gpu/drm/drm_gem_atomic_helper.c
include/drm/drm_gem_atomic_helper.h