xf86-video-amdgpu: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 27 18:19:50 UTC 2021


 src/amdgpu_glamor.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 69365526d0a477e0d7842571a72266631c77742d
Author: Dor Askayo <dor.askayo at gmail.com>
Date:   Sat Aug 21 19:11:05 2021 +0300

    glamor: Set AMDGPU_CREATE_PIXMAP_SCANOUT on DRI2 and shared pixmaps
    
    The scanout usage flag wasn't applied for DRI2 and shared pixmaps
    in 0732f81a2c67, resulting in GPU artifacts in some scenarios.
    
    Fixes: 0732f81a2c67 ("glamor: Make pixmap scanout compatible if its
                          dimensions are")
    Closes: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/-/issues/41
    Signed-off-by: Dor Askayo <dor.askayo at gmail.com>
    Signed-off-by: Michel Dänzer <mdaenzer at redhat.com>
    Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>

diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index fb7a46b..31fcfb4 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -209,6 +209,14 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
 	if (!format)
 		return NULL;
 
+	if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP &&
+	    !info->shadow_primary &&
+	    w >= scrn->virtualX &&
+	    w <= scrn->displayWidth &&
+	    h == scrn->virtualY &&
+	    format->bitsPerPixel == scrn->bitsPerPixel)
+		usage |= AMDGPU_CREATE_PIXMAP_SCANOUT;
+
 	if (!(usage & AMDGPU_CREATE_PIXMAP_SCANOUT) &&
 	    !AMDGPU_CREATE_PIXMAP_SHARED(usage)) {
 		if (info->shadow_primary) {
@@ -218,15 +226,9 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
 			usage |= AMDGPU_CREATE_PIXMAP_LINEAR |
 				 AMDGPU_CREATE_PIXMAP_GTT;
 		} else if (usage != CREATE_PIXMAP_USAGE_BACKING_PIXMAP) {
-			if (w < scrn->virtualX || w > scrn->displayWidth ||
-			    h != scrn->virtualY ||
-			    format->bitsPerPixel != scrn->bitsPerPixel) {
-				pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
-				if (pixmap)
-					return pixmap;
-			} else {
-				usage |= AMDGPU_CREATE_PIXMAP_SCANOUT;
-			}
+			pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
+			if (pixmap)
+				return pixmap;
 		}
 	}
 


More information about the xorg-commit mailing list