drm/vc4: Fix synchronization firmwarekms against GL rendering.
authorEric Anholt <eric@anholt.net>
Thu, 28 Mar 2019 18:58:51 +0000 (11:58 -0700)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:32:58 +0000 (16:32 +0100)
We would present the framebuffer immediately without waiting for
rendering to finish first, resulting in stuttering and flickering as a
window was dragged around when the GPU was busy enough to not just win
the race.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/vc4/vc4_firmware_kms.c

index 85e2736..ee0e6af 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "drm/drm_atomic_helper.h"
+#include "drm/drm_gem_framebuffer_helper.h"
 #include "drm/drm_plane_helper.h"
 #include "drm/drm_crtc_helper.h"
 #include "drm/drm_fourcc.h"
@@ -291,7 +292,7 @@ static const struct drm_plane_funcs vc4_plane_funcs = {
 };
 
 static const struct drm_plane_helper_funcs vc4_primary_plane_helper_funcs = {
-       .prepare_fb = NULL,
+       .prepare_fb = drm_gem_fb_prepare_fb,
        .cleanup_fb = NULL,
        .atomic_check = vc4_plane_atomic_check,
        .atomic_update = vc4_primary_plane_atomic_update,
@@ -299,7 +300,7 @@ static const struct drm_plane_helper_funcs vc4_primary_plane_helper_funcs = {
 };
 
 static const struct drm_plane_helper_funcs vc4_cursor_plane_helper_funcs = {
-       .prepare_fb = NULL,
+       .prepare_fb = drm_gem_fb_prepare_fb,
        .cleanup_fb = NULL,
        .atomic_check = vc4_plane_atomic_check,
        .atomic_update = vc4_cursor_plane_atomic_update,