|
|
a3e08e |
From 846596b38165e5170d1a410f37ce7c5280db649d Mon Sep 17 00:00:00 2001
|
|
|
a3e08e |
From: Adam Jackson <ajax@redhat.com>
|
|
|
a3e08e |
Date: Tue, 9 May 2017 17:02:17 -0400
|
|
|
a3e08e |
Subject: [PATCH] modesetting: software cursor hack
|
|
|
a3e08e |
|
|
|
a3e08e |
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
|
a3e08e |
---
|
|
|
a3e08e |
hw/xfree86/drivers/modesetting/driver.c | 30 +++++++++++++++++++++++++++---
|
|
|
a3e08e |
1 file changed, 27 insertions(+), 3 deletions(-)
|
|
|
a3e08e |
|
|
|
a3e08e |
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
|
|
|
a3e08e |
index 3da69a3..31a58fd 100644
|
|
|
a3e08e |
--- a/hw/xfree86/drivers/modesetting/driver.c
|
|
|
a3e08e |
+++ b/hw/xfree86/drivers/modesetting/driver.c
|
|
|
a3e08e |
@@ -878,6 +878,30 @@ ms_get_drm_master_fd(ScrnInfoPtr pScrn)
|
|
|
a3e08e |
}
|
|
|
a3e08e |
|
|
|
a3e08e |
static Bool
|
|
|
a3e08e |
+msDefaultSoftwareCursor(modesettingPtr ms)
|
|
|
a3e08e |
+{
|
|
|
a3e08e |
+ Bool ret = FALSE;
|
|
|
a3e08e |
+ drmVersionPtr v = drmGetVersion(ms->fd);
|
|
|
a3e08e |
+
|
|
|
a3e08e |
+ /*
|
|
|
a3e08e |
+ * This is horrific, don't hate me. The _runtime_ fallback to software
|
|
|
a3e08e |
+ * cursor doesn't seem to take on the first try; you get no cursor in
|
|
|
a3e08e |
+ * gdm, but it works once you log in. However just bombing out at
|
|
|
a3e08e |
+ * init time seems to work fine. So for drivers without hardware cursors
|
|
|
a3e08e |
+ * (or for G200SE, where they're basically unusable) just default to sw.
|
|
|
a3e08e |
+ */
|
|
|
a3e08e |
+ if (!strcmp(v->name, "udl") ||
|
|
|
a3e08e |
+ !strcmp(v->name, "mgag200") ||
|
|
|
a3e08e |
+ !strcmp(v->name, "cirrus") ||
|
|
|
a3e08e |
+ !strcmp(v->name, "ast"))
|
|
|
a3e08e |
+ ret = TRUE;
|
|
|
a3e08e |
+
|
|
|
a3e08e |
+ drmFreeVersion(v);
|
|
|
a3e08e |
+
|
|
|
a3e08e |
+ return ret;
|
|
|
a3e08e |
+}
|
|
|
a3e08e |
+
|
|
|
a3e08e |
+static Bool
|
|
|
a3e08e |
PreInit(ScrnInfoPtr pScrn, int flags)
|
|
|
a3e08e |
{
|
|
|
a3e08e |
modesettingPtr ms;
|
|
|
a3e08e |
@@ -966,9 +990,9 @@ PreInit(ScrnInfoPtr pScrn, int flags)
|
|
|
a3e08e |
if (!xf86SetDefaultVisual(pScrn, -1))
|
|
|
a3e08e |
return FALSE;
|
|
|
a3e08e |
|
|
|
a3e08e |
- if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR, FALSE)) {
|
|
|
a3e08e |
- ms->drmmode.sw_cursor = TRUE;
|
|
|
a3e08e |
- }
|
|
|
a3e08e |
+ if (!xf86GetOptValBool(ms->drmmode.Options, OPTION_SW_CURSOR,
|
|
|
a3e08e |
+ &ms->drmmode.sw_cursor))
|
|
|
a3e08e |
+ ms->drmmode.sw_cursor = msDefaultSoftwareCursor(ms);
|
|
|
a3e08e |
|
|
|
a3e08e |
ms->cursor_width = 64;
|
|
|
a3e08e |
ms->cursor_height = 64;
|
|
|
a3e08e |
--
|
|
|
a3e08e |
2.12.0
|
|
|
a3e08e |
|