diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/amdgpu_pixmap.h | 1 | ||||
-rw-r--r-- | src/amdgpu_present.c | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h index 6720458..94ec210 100644 --- a/src/amdgpu_pixmap.h +++ b/src/amdgpu_pixmap.h @@ -36,6 +36,7 @@ struct amdgpu_pixmap { struct amdgpu_buffer *bo; struct drmmode_fb *fb; + Bool fb_failed; /* GEM handle for pixmaps shared via DRI2/3 */ Bool handle_valid; diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index fdedd32..83a0517 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -255,6 +255,7 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, xf86CrtcPtr xf86_crtc = crtc->devPrivate; ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86_crtc->scrn; + struct amdgpu_pixmap *priv = amdgpu_get_pixmap_private(pixmap); PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); AMDGPUInfoPtr info = AMDGPUPTR(scrn); @@ -278,6 +279,23 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, return FALSE; #endif + if (priv && priv->fb_failed) + return FALSE; + + if (!amdgpu_pixmap_get_fb(pixmap)) { + if (!priv) + priv = amdgpu_get_pixmap_private(pixmap); + + if (priv && !priv->fb_failed) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Cannot get FB for Present flip (may be " + "normal if using PRIME render offloading)\n"); + priv->fb_failed = TRUE; + } + + return FALSE; + } + /* Only DC supports advanced color management features, so we can use * drmmode_cm_enabled as a proxy for "Is DC enabled?" */ |