xf86-video-amdgpu: Branch 'master' - 3 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Mon Aug 10 20:35:10 PDT 2015


 configure.ac          |    2 ++
 src/amdgpu_glamor.c   |   12 ++++++++++++
 src/amdgpu_glamor.h   |    1 +
 src/amdgpu_kms.c      |   11 +++--------
 src/drmmode_display.c |    5 +++--
 5 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit 55a4461bd95698cb8d52f9f6c28583f8f81afb4e
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri Aug 7 11:46:31 2015 +0900

    Wait for scanout BO initialization to finish before setting mode
    
    This should avoid intermittent artifacts which could sometimes be visible
    when setting a new scanout pixmap, e.g. on server startup or when
    changing resolutions.
    
    (Ported from radeon commit 3791fceabf2cb037467dc41c15364e9f9ec1e47e)
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 98dd3b1..88987d0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -416,7 +416,7 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 
 	FreeScratchGC(gc);
 
-	amdgpu_glamor_flush(pScrn);
+	amdgpu_glamor_finish(pScrn);
 
 	pScreen->canDoBGNoneRoot = TRUE;
 
@@ -697,6 +697,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 				x = y = 0;
 
 				amdgpu_scanout_update_handler(pScrn, 0, 0, crtc);
+				amdgpu_glamor_finish(pScrn);
 			}
 		}
 		ret =
@@ -1630,7 +1631,7 @@ static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	(*gc->ops->PolyFillRect)(&ppix->drawable, gc, 1, &rect);
 	info->force_accel = FALSE;
 	FreeScratchGC(gc);
-	amdgpu_glamor_flush(scrn);
+	amdgpu_glamor_finish(scrn);
 
 	for (i = 0; i < xf86_config->num_crtc; i++) {
 		xf86CrtcPtr crtc = xf86_config->crtc[i];
commit 4c425e9c5c038504a0f0498dd800ab1fb40bf0c5
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri Aug 7 12:39:24 2015 +0900

    glamor: Add amdgpu_glamor_finish to wait for glamor rendering to finish
    
    This is a bit sneaky, because it calls glFinish directly from the driver,
    but it seems to work fine.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/configure.ac b/configure.ac
index 85892fa..e350ef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,8 @@ if test "x$GLAMOR" != "xno"; then
 			       #include "glamor.h"])
 	fi
 
+	PKG_CHECK_MODULES(LIBGL, [gl])
+
 	if test "x$GLAMOR_XSERVER" != xyes; then
 		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
 		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index f74aa28..8f0dc79 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -36,6 +36,8 @@
 
 #include <gbm.h>
 
+#include <GL/gl.h>
+
 #if HAS_DEVPRIVATEKEYREC
 DevPrivateKeyRec amdgpu_pixmap_index;
 #else
@@ -371,6 +373,16 @@ void amdgpu_glamor_flush(ScrnInfoPtr pScrn)
 	}
 }
 
+void amdgpu_glamor_finish(ScrnInfoPtr pScrn)
+{
+	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+
+	if (info->use_glamor) {
+		amdgpu_glamor_flush(pScrn);
+		glFinish();
+	}
+}
+
 XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
 {
 	return glamor_xv_init(pScreen, num_adapt);
diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
index a781695..de63005 100644
--- a/src/amdgpu_glamor.h
+++ b/src/amdgpu_glamor.h
@@ -65,6 +65,7 @@ Bool amdgpu_glamor_create_screen_resources(ScreenPtr screen);
 void amdgpu_glamor_free_screen(int scrnIndex, int flags);
 
 void amdgpu_glamor_flush(ScrnInfoPtr pScrn);
+void amdgpu_glamor_finish(ScrnInfoPtr pScrn);
 
 Bool
 amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv);
commit bb989e173dc364a7d68e50d7e819d0e0ee133d2f
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri Aug 7 11:43:48 2015 +0900

    Only call drmmode_copy_fb (at most) once on server startup
    
    It doesn't make sense to copy the screen contents from console when VT
    switching back to Xorg or when Xorg resets.
    
    Fixes intermittent artifacts when VT switching back from console to the
    gdm login screen.
    
    (Ported from radeon commit 4e3dfa69e4630df2e0ec0f5b81d61159757c4664)
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 5aa8397..3d92518 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -675,7 +675,7 @@ static void AMDGPUSetupCapabilities(ScrnInfoPtr pScrn)
 /* When the root window is created, initialize the screen contents from
  * console if -background none was specified on the command line
  */
-static Bool AMDGPUCreateWindow(WindowPtr pWin)
+static Bool AMDGPUCreateWindow_oneshot(WindowPtr pWin)
 {
 	ScreenPtr pScreen = pWin->drawable.pScreen;
 	ScrnInfoPtr pScrn;
@@ -1204,9 +1204,9 @@ Bool AMDGPUScreenInit_KMS(SCREEN_INIT_ARGS_DECL)
 	pScrn->pScreen = pScreen;
 
 #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10
-	if (bgNoneRoot && info->use_glamor) {
+	if (serverGeneration == 1 && bgNoneRoot && info->use_glamor) {
 		info->CreateWindow = pScreen->CreateWindow;
-		pScreen->CreateWindow = AMDGPUCreateWindow;
+		pScreen->CreateWindow = AMDGPUCreateWindow_oneshot;
 	}
 #endif
 
@@ -1266,11 +1266,6 @@ Bool AMDGPUEnterVT_KMS(VT_FUNC_ARGS_DECL)
 
 	pScrn->vtSema = TRUE;
 
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10
-	if (bgNoneRoot && info->use_glamor)
-		drmmode_copy_fb(pScrn, &info->drmmode);
-#endif
-
 	if (!drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE))
 		return FALSE;
 


More information about the xorg-commit mailing list