summaryrefslogtreecommitdiff
path: root/extra/xf86-video-intel/0001-sna-dri2-Check-that-the-window-covers-the-whole-CRTC.patch
blob: 4447deb5607305eb938b79c3e87797535e7b40bf (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
49
50
51
52
53
54
55
56
From e2bfa715a9e115921263d572b9f4c496b550a494 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue, 10 Jun 2014 21:28:32 +0100
Subject: [PATCH] sna/dri2: Check that the window covers the whole CRTC before
 xchg

Fixes TearFre regression from

commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912]
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Mon Jun 9 08:58:15 2014 +0100

    sna/dri2: Allow TearFree flipping to individual CRTC

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 src/sna/sna_display.c |  1 +
 src/sna/sna_dri2.c    | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index dcbe622..7169779 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -332,6 +332,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 	assert(bo->refcnt);
 	assert(bo->proxy == NULL);
 	assert(!bo->snoop);
+	assert(8*bo->pitch >= width * scrn->bitsPerPixel);
 	assert(height * bo->pitch <= kgem_bo_size(bo)); /* XXX crtc offset */
 	if (bo->delta) {
 		DBG(("%s: reusing fb=%d for handle=%d\n",
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 1baaf2b..e196464 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -1605,6 +1605,16 @@ can_xchg_one(struct sna *sna,
 		return false;
 	}
 
+	if (memcmp(&win->clipList.extents, &crtc->bounds, sizeof(crtc->bounds))) {
+		DBG(("%s: no, window [(%d, %d), (%d, %d)] does not cover CRTC [(%d, %d), (%d, %d)]\n",
+		     __FUNCTION__,
+		     win->clipList.extents.x1, win->clipList.extents.y1,
+		     win->clipList.extents.x2, win->clipList.extents.y2,
+		     crtc->bounds.x1, crtc->bounds.y1,
+		     crtc->bounds.x2, crtc->bounds.y2));
+		return false;
+	}
+
 	if (sna_crtc_is_transformed(crtc)) {
 		DBG(("%s: no, CRTC is rotated\n", __FUNCTION__));
 		return false;
-- 
2.0.1