xf86-video-amdgpu: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 25 15:32:24 UTC 2019


 src/amdgpu_pixmap.h  |    1 +
 src/amdgpu_present.c |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 7d3fef72e0c871e1677e9e544f4cae5e238b5c52
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu May 9 17:39:49 2019 +0200

    present: Check that we can get a KMS FB for flipping
    
    This can legitimately fail if the pixmap's storage is shared from
    another device, e.g. when using PRIME render offloading.

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?"
 	 */


More information about the xorg-commit mailing list