[PATCH xf86-video-amdgpu 1/6] Only copy fbcon BO contents if bgNoneRoot is TRUE

Michel Dänzer michel at daenzer.net
Thu Aug 6 02:59:31 PDT 2015


From: Michel Dänzer <michel.daenzer at amd.com>

Otherwise, the X server will initialize the screen pixmap contents
anyway.

(Ported from radeon commit 39c497f3efca5ca08343b884f44c93215dcdef31)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 9 ++++++++-
 src/drmmode_display.h | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8c2df13..e4fc815 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -312,6 +312,8 @@ drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)
 					    crtc->x, crtc->y);
 }
 
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10
+
 /* TODO: currently this function only clear the front buffer to zero */
 /* Moving forward, we might to look into making the copy with glamor instead */
 void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
@@ -324,6 +326,8 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	memset(info->front_buffer->cpu_ptr, 0x00, size);
 }
 
+#endif /* GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10 */
+
 static void
 drmmode_crtc_scanout_destroy(drmmode_ptr drmmode,
                              struct drmmode_scanout *scanout)
@@ -1714,7 +1718,10 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 	int c;
 
-	drmmode_copy_fb(pScrn, drmmode);
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10
+	if (bgNoneRoot)
+		drmmode_copy_fb(pScrn, drmmode);
+#endif
 
 	for (c = 0; c < config->num_crtc; c++) {
 		xf86CrtcPtr crtc = config->crtc[c];
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 8262e05..197e46a 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -123,7 +123,9 @@ extern void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id,
 			       struct amdgpu_buffer *bo);
 void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y);
 extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) >= 10
 extern void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
+#endif
 extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
 
 extern void drmmode_scanout_free(ScrnInfoPtr scrn);
-- 
2.5.0



More information about the xorg-driver-ati mailing list