summaryrefslogtreecommitdiff
path: root/recipes-graphics/wayland/files/0003-Add-glFinish-to-DRM-backend-to-avoid-tearing.patch
blob: c7426a429cc0a4623e9fe84ba5ab1838b479c1f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From 412880dfeb9951f9e807ed36e293805bc97beb32 Mon Sep 17 00:00:00 2001
From: Alexandre Courbot <acourbot@nvidia.com>
Date: Thu, 24 Sep 2015 13:19:02 +0900
Subject: [PATCH 3/6] Add glFinish to DRM backend to avoid tearing

---
 Makefile.am          | 3 ++-
 src/compositor-drm.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 00b74e5..071d540 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -281,8 +281,9 @@ drm_backend_la_LIBADD =				\
 	$(COMPOSITOR_LIBS)			\
 	$(DRM_COMPOSITOR_LIBS)			\
 	$(INPUT_BACKEND_LIBS)			\
-	libshared.la				\
 	$(CLOCK_GETTIME_LIBS)			\
+	$(SIMPLE_EGL_CLIENT_LIBS)               \
+	libshared.la -lrt			\
 	libsession-helper.la
 drm_backend_la_CFLAGS =				\
 	$(COMPOSITOR_CFLAGS)			\
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 90cae10..17ba640 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -715,6 +715,7 @@ drm_output_repaint(struct weston_output *output_base,
 		output_base->set_dpms(output_base, WESTON_DPMS_ON);
 	}
 
+	glFinish();
 	if (drmModePageFlip(backend->drm.fd, output->crtc_id,
 			    output->next->fb_id,
 			    DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
@@ -838,6 +839,7 @@ drm_output_start_repaint_loop(struct weston_output *output_base)
 	 */
 	fb_id = output->current->fb_id;
 
+        glFinish();
 	if (drmModePageFlip(backend->drm.fd, output->crtc_id, fb_id,
 			    DRM_MODE_PAGE_FLIP_EVENT, output) < 0) {
 		weston_log("queueing pageflip failed: %m\n");
-- 
2.9.3