Skip to contentSkip to conversation

drm/sun4i: wait on implicit fence before display

PATCH In review Qiang Yu 2 participants 3 messages Nov 19, 2018 – Nov 22, 2018 1 message not in the archive

Subsystems (5)
lore
Share & tools
lore

Qiang Yu

author
#0 lore raw

PATCH 1/1 drm/sun4i: wait on implicit fence before display

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.

---
 drivers/gpu/drm/sun4i/sun4i_layer.c    | 2 ++
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 ++
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 ++
 3 files changed, 6 insertions(+)
drivers/gpu/drm/sun4i/sun4i_layer.c +2 -0
index 750ad24de1d7..d68e663df9a0 100644
@@ -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"
@@ -114,6 +115,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,
 };
drivers/gpu/drm/sun4i/sun8i_ui_layer.c +2 -0
index 28c15c6ef1ef..7bc2ca2bd0c3 100644
@@ -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>
 
@@ -287,6 +288,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,
drivers/gpu/drm/sun4i/sun8i_vi_layer.c +2 -0
index f4fe97813f94..815895795afd 100644
@@ -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>
 
@@ -315,6 +316,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,
Signature · 1 line
2.17.1

A message that is not in the archive (sent off-list or not yet received): 20181119143311.17156-1-yuq825-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

Hi,

Dne ponedeljek, 19. november 2018 ob 15:33:11 CET je Qiang Yu napisal(a):

Quoted 3 lines

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.

Please resend this patch to all emails listed when running "scripts/ get_maintainer.pl" on this patch. You are missing at least sunxi maintainers.

Best regards,
Jernej

Quoted 71 lines
---
 drivers/gpu/drm/sun4i/sun4i_layer.c    | 2 ++
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 ++
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 ++
 3 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun4i_layer.c index 750ad24de1d7..d68e663df9a0 100644

drivers/gpu/drm/sun4i/sun4i_layer.c +1 -0
@@ -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"
@@ -114,6 +115,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,
 };
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 28c15c6ef1ef..7bc2ca2bd0c3 100644

drivers/gpu/drm/sun4i/sun8i_ui_layer.c +2 -0
@@ -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>
 
@@ -287,6 +288,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,
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index f4fe97813f94..815895795afd 100644

drivers/gpu/drm/sun4i/sun8i_vi_layer.c +2 -0
@@ -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>
 
@@ -315,6 +316,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,
author
#3 lore raw

Thanks, thought linux-sunxi is enough.

Regards,
Qiang

Quoted 89 lines · Jernej Škrabec

Hi,

Dne ponedeljek, 19. november 2018 ob 15:33:11 CET je Qiang Yu napisal(a):

Quoted 3 lines

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.

Please resend this patch to all emails listed when running "scripts/ get_maintainer.pl" on this patch. You are missing at least sunxi maintainers.

Best regards,
Jernej

Quoted 71 lines
---
 drivers/gpu/drm/sun4i/sun4i_layer.c    | 2 ++
 drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 2 ++
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 ++
 3 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun4i_layer.c index 750ad24de1d7..d68e663df9a0 100644

drivers/gpu/drm/sun4i/sun4i_layer.c +1 -0
@@ -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"
@@ -114,6 +115,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,
 };
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c index 28c15c6ef1ef..7bc2ca2bd0c3 100644

drivers/gpu/drm/sun4i/sun8i_ui_layer.c +2 -0
@@ -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>
 
@@ -287,6 +288,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,
(quoted diff) +0 -0

b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index f4fe97813f94..815895795afd 100644

drivers/gpu/drm/sun4i/sun8i_vi_layer.c +2 -0
@@ -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>
 
@@ -315,6 +316,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,
Signature · 3 lines
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/d/optout.