|
1
|
+From 69365526d0a477e0d7842571a72266631c77742d Mon Sep 17 00:00:00 2001
|
|
2
|
+From: Dor Askayo <dor.askayo@gmail.com>
|
|
3
|
+Date: Sat, 21 Aug 2021 19:11:05 +0300
|
|
4
|
+Subject: [PATCH] glamor: Set AMDGPU_CREATE_PIXMAP_SCANOUT on DRI2 and shared
|
|
5
|
+ pixmaps
|
|
6
|
+MIME-Version: 1.0
|
|
7
|
+Content-Type: text/plain; charset=UTF-8
|
|
8
|
+Content-Transfer-Encoding: 8bit
|
|
9
|
+
|
|
10
|
+The scanout usage flag wasn't applied for DRI2 and shared pixmaps
|
|
11
|
+in 0732f81a2c67, resulting in GPU artifacts in some scenarios.
|
|
12
|
+
|
|
13
|
+Fixes: 0732f81a2c67 ("glamor: Make pixmap scanout compatible if its
|
|
14
|
+ dimensions are")
|
|
15
|
+Closes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/issues/41
|
|
16
|
+Signed-off-by: Dor Askayo <dor.askayo@gmail.com>
|
|
17
|
+Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
18
|
+Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
|
|
19
|
+---
|
|
20
|
+ src/amdgpu_glamor.c | 20 +++++++++++---------
|
|
21
|
+ 1 file changed, 11 insertions(+), 9 deletions(-)
|
|
22
|
+
|
|
23
|
+diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
|
|
24
|
+index fb7a46b..31fcfb4 100644
|
|
25
|
+--- a/src/amdgpu_glamor.c
|
|
26
|
++++ b/src/amdgpu_glamor.c
|
|
27
|
+@@ -209,6 +209,14 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
|
|
28
|
+ if (!format)
|
|
29
|
+ return NULL;
|
|
30
|
+
|
|
31
|
++ if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP &&
|
|
32
|
++ !info->shadow_primary &&
|
|
33
|
++ w >= scrn->virtualX &&
|
|
34
|
++ w <= scrn->displayWidth &&
|
|
35
|
++ h == scrn->virtualY &&
|
|
36
|
++ format->bitsPerPixel == scrn->bitsPerPixel)
|
|
37
|
++ usage |= AMDGPU_CREATE_PIXMAP_SCANOUT;
|
|
38
|
++
|
|
39
|
+ if (!(usage & AMDGPU_CREATE_PIXMAP_SCANOUT) &&
|
|
40
|
+ !AMDGPU_CREATE_PIXMAP_SHARED(usage)) {
|
|
41
|
+ if (info->shadow_primary) {
|
|
42
|
+@@ -218,15 +226,9 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
|
|
43
|
+ usage |= AMDGPU_CREATE_PIXMAP_LINEAR |
|
|
44
|
+ AMDGPU_CREATE_PIXMAP_GTT;
|
|
45
|
+ } else if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) {
|
|
46
|
+- if (w < scrn->virtualX || w > scrn->displayWidth ||
|
|
47
|
+- h != scrn->virtualY ||
|
|
48
|
+- format->bitsPerPixel != scrn->bitsPerPixel) {
|
|
49
|
+- pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
|
|
50
|
+- if (pixmap)
|
|
51
|
+- return pixmap;
|
|
52
|
+- } else {
|
|
53
|
+- usage |= AMDGPU_CREATE_PIXMAP_SCANOUT;
|
|
54
|
+- }
|
|
55
|
++ pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
|
|
56
|
++ if (pixmap)
|
|
57
|
++ return pixmap;
|
|
58
|
+ }
|
|
59
|
+ }
|
|
60
|
+
|
|
61
|
+--
|
|
62
|
+2.32.0
|
|
63
|
+
|