summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-24 18:44:30 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-03-24 18:44:30 +0900
commitba9be8f32f0321689133e17c1681809dec8c6cf1 (patch)
treea32988de8093a125c79fc3abcb3b45114967b0c0
parent4a60b4b1851a3cbc2d8ad9048d68eeb6947cf132 (diff)
Factor out HW cursor checking code into drmmode_can_use_hw_cursor
And add a check for RandR 1.4 multihead. (Ported from radeon commit 3de480e83c0a1824838d662d6d67c9fe85277298) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/drmmode_display.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 56b025a..1cbea6e 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -566,6 +566,33 @@ amdgpu_screen_damage_report(DamagePtr damage, RegionPtr region, void *closure)
damage->damage.data = NULL;
}
+static Bool
+drmmode_can_use_hw_cursor(xf86CrtcPtr crtc)
+{
+ AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn);
+
+ /* Check for Option "SWcursor" */
+ if (xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
+ return FALSE;
+
+ /* Fall back to SW cursor if the CRTC is transformed */
+ if (crtc->transformPresent)
+ return FALSE;
+
+ /* Xorg doesn't correctly handle cursor position transform in the
+ * rotation case
+ */
+ if (crtc->driverIsPerformingTransform &&
+ (crtc->rotation & 0xf) != RR_Rotate_0)
+ return FALSE;
+
+ /* HW cursor not supported yet with RandR 1.4 multihead */
+ if (!xorg_list_is_empty(&crtc->scrn->pScreen->pixmap_dirty_list))
+ return FALSE;
+
+ return TRUE;
+}
+
#if XF86_CRTC_VERSION >= 4
static Bool
@@ -772,7 +799,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
}
}
- if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
+ if (drmmode_can_use_hw_cursor(crtc))
xf86_reload_cursors(pScreen);
done:
@@ -901,15 +928,7 @@ static void drmmode_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image)
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;
-
- /* Xorg doesn't correctly handle cursor position transform in the
- * rotation case
- */
- if (crtc->driverIsPerformingTransform &&
- (crtc->rotation & 0xf) != RR_Rotate_0)
+ if (!drmmode_can_use_hw_cursor(crtc))
return FALSE;
drmmode_load_cursor_argb(crtc, image);