[PATCH xf86-video-amdgpu 02/12] Fix RandR CRTC transforms

Michel Dänzer michel at daenzer.net
Fri Mar 18 10:01:27 UTC 2016


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

Currently, Xorg will only transform the cursor as of the first time the
cursor image changes after a transform is set.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80678

(Ported from radeon commit 9483a3d777919b224f70c3b4d01e4b320a57db31)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 17a0f67..7316226 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -615,7 +615,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		crtc->x = x;
 		crtc->y = y;
 		crtc->rotation = rotation;
-		crtc->transformPresent = FALSE;
 
 		output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
 		if (!output_ids) {
@@ -787,6 +786,20 @@ static void drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image)
 	}
 }
 
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
+
+static Bool drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 * image)
+{
+	/* Fall back to SW cursor if the CRTC is transformed */
+	if (crtc->transformPresent)
+		return FALSE;
+
+	drmmode_load_cursor_argb(crtc, image);
+	return TRUE;
+}
+
+#endif
+
 static void drmmode_hide_cursor(xf86CrtcPtr crtc)
 {
 	ScrnInfoPtr pScrn = crtc->scrn;
@@ -951,6 +964,9 @@ static xf86CrtcFuncsRec drmmode_crtc_funcs = {
 	.show_cursor = drmmode_show_cursor,
 	.hide_cursor = drmmode_hide_cursor,
 	.load_cursor_argb = drmmode_load_cursor_argb,
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,903,0)
+	.load_cursor_argb_check = drmmode_load_cursor_argb_check,
+#endif
 
 	.gamma_set = drmmode_crtc_gamma_set,
 	.shadow_create = drmmode_crtc_shadow_create,
-- 
2.7.0



More information about the xorg-driver-ati mailing list