drm/vboxvideo: Implement cursor plane with struct drm_shadow_plane_state
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 9 Feb 2021 12:10:42 +0000 (13:10 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 9 Feb 2021 13:23:11 +0000 (14:23 +0100)
commit48e2b69683e26b703c768bc34926edfeaa16cbb3
tree3f83c71f93a205208f6b8e88ff8a472eeeac1b42
parent9dc9067dce20b2ac7e1ba376485190e4a8b2675f
drm/vboxvideo: Implement cursor plane with struct drm_shadow_plane_state

Functions in the atomic commit tail are not allowed to acquire the
dmabuf's reservation lock. So we cannot legally call the GEM object's
vmap functionality in atomic_update.

Instead use struct drm_shadow_plane_state and friends. It vmaps the
framebuffer BOs in prepare_fb and vunmaps them in cleanup_fb. The
cursor plane state stores the mapping's address. The pinning of the
BO is implicitly done by vmap.

As an extra benefit, there's no source of runtime errors left in
atomic_update.

v2:
* rebase patch onto struct drm_shadow_plane_state

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210209121042.24098-3-tzimmermann@suse.de
drivers/gpu/drm/vboxvideo/vbox_mode.c