drm/sun4i: wait on implicit fence before display
authorQiang Yu <yuq825@gmail.com>
Thu, 22 Nov 2018 01:44:17 +0000 (09:44 +0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 22 Nov 2018 09:07:26 +0000 (10:07 +0100)
Render like lima will attach a fence to the framebuffer
dma_buf, display like sun4i should wait it finish before
show the framebuffer. Otherwise tearing will be observed.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20181122014417.23285-1-yuq825@gmail.com
drivers/gpu/drm/sun4i/sun4i_layer.c
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
drivers/gpu/drm/sun4i/sun8i_vi_layer.c

index 78f77af8805ace3597295548f37a38462c293111..3f51744b6e897da7dd7faf5de024c77803b0b664 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_plane_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drmP.h>
 
 #include "sun4i_backend.h"
@@ -112,6 +113,7 @@ static void sun4i_backend_layer_atomic_update(struct drm_plane *plane,
 }
 
 static const struct drm_plane_helper_funcs sun4i_backend_layer_helper_funcs = {
+       .prepare_fb     = drm_gem_fb_prepare_fb,
        .atomic_disable = sun4i_backend_layer_atomic_disable,
        .atomic_update  = sun4i_backend_layer_atomic_update,
 };
index e3fc8fa920fbaccc5abce984ef37386af9857ba2..18534263a05d827fe4e87b5e65355f98094ffb46 100644 (file)
@@ -19,6 +19,7 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drmP.h>
 
@@ -300,6 +301,7 @@ static void sun8i_ui_layer_atomic_update(struct drm_plane *plane,
 }
 
 static struct drm_plane_helper_funcs sun8i_ui_layer_helper_funcs = {
+       .prepare_fb     = drm_gem_fb_prepare_fb,
        .atomic_check   = sun8i_ui_layer_atomic_check,
        .atomic_disable = sun8i_ui_layer_atomic_disable,
        .atomic_update  = sun8i_ui_layer_atomic_update,
index 4249edfb47ed7b074005d7410e14249906242aaf..87be898f9b7a090cf732e9c9b2187e1986031aaf 100644 (file)
@@ -13,6 +13,7 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_plane_helper.h>
 #include <drm/drmP.h>
 
@@ -336,6 +337,7 @@ static void sun8i_vi_layer_atomic_update(struct drm_plane *plane,
 }
 
 static struct drm_plane_helper_funcs sun8i_vi_layer_helper_funcs = {
+       .prepare_fb     = drm_gem_fb_prepare_fb,
        .atomic_check   = sun8i_vi_layer_atomic_check,
        .atomic_disable = sun8i_vi_layer_atomic_disable,
        .atomic_update  = sun8i_vi_layer_atomic_update,