drm/fb-helper: Acquire modeset lock around shadow-buffer flushing
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 20 Nov 2020 10:25:45 +0000 (11:25 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 24 Nov 2020 08:31:34 +0000 (09:31 +0100)
commit32228ff5f7e1b1c8916e811d525b6e15e3d21b3d
tree3486e63ce0a5a94fa31b311a69e20da2220b71f2
parent7d4d269c0973f7a8324d9cd2534b3b24e62c72ff
drm/fb-helper: Acquire modeset lock around shadow-buffer flushing

Flushing the fbdev's shadow buffer requires vmap'ing the BO memory, which
in turn requires pinning the BO. While being pinned, the BO cannot be moved
into VRAM for scanout. Consequently, a concurrent modeset operation that
involves the fbdev framebuffer would likely fail.

Resolve this problem be acquiring the modeset lock of the planes that use
the fbdev framebuffer. On non-atomic drivers, also acquire the mode-config
lock. This serializes the flushing of the framebuffer with concurrent
modeset operations.

v2:
* only acquire struct drm_fb_helper.lock in damage blitter (Daniel,
  Christian)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201120102545.4047-11-tzimmermann@suse.de
drivers/gpu/drm/drm_fb_helper.c