Commit 69365526 authored by Dor Askayo's avatar Dor Askayo
Browse files

glamor: Set AMDGPU_CREATE_PIXMAP_SCANOUT on DRI2 and shared pixmaps

The scanout usage flag wasn't applied for DRI2 and shared pixmaps
in 0732f81a, resulting in GPU artifacts in some scenarios.

Fixes: 0732f81a ("glamor: Make pixmap scanout compatible if its
                      dimensions are")
Closes: #41

Signed-off-by: Dor Askayo's avatarDor Askayo <dor.askayo@gmail.com>
Signed-off-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
parent 0d68a91d
Pipeline #390138 passed with stages
in 49 seconds
......@@ -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;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment