diff options
Diffstat (limited to 'src/amdgpu_glamor.c')
-rw-r--r-- | src/amdgpu_glamor.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c index 5b8d560..174bbdf 100644 --- a/src/amdgpu_glamor.c +++ b/src/amdgpu_glamor.c @@ -201,11 +201,12 @@ amdgpu_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, unsigned usage) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + PixmapFormatPtr format = xf86GetPixFormat(scrn, depth); AMDGPUInfoPtr info = AMDGPUPTR(scrn); struct amdgpu_pixmap *priv; PixmapPtr pixmap, new_pixmap = NULL; - if (!xf86GetPixFormat(scrn, depth)) + if (!format) return NULL; if (!AMDGPU_CREATE_PIXMAP_SHARED(usage)) { @@ -216,9 +217,15 @@ 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) { - pixmap = glamor_create_pixmap(screen, w, h, depth, usage); - if (pixmap) - return 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; + } } } |