xf86-video-modesetting cursor patch

James Simmons jsimmons at infradead.org
Thu Oct 13 08:28:45 PDT 2011

	I tried the xf86-video-modesetting driver with the new via KMS 
driver. It worked well but I had to turn off the cursor since I haven't 
finished the cursor in the kernel driver yet. By default the SWCursor 
option is set to false but when I placed that option in my xorg.conf file
it never set SWCursor to TRUE. Also a buffer was still being allocated 
even with the software curor. This patch address this issue. 

	I also tried the xorg driver on a i915 device with a LVDS but the
screen was distored. It looks like a incorrect pitch size. I didn't see 
that with my via driver.

diff --git a/src/driver.c b/src/driver.c
index bde690c..1d62b7a 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -471,7 +471,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
     memcpy(ms->Options, Options, sizeof(Options));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
-    if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) {
+    if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, TRUE)) {
 	ms->SWCursor = TRUE;
@@ -551,7 +551,8 @@ CreateScreenResources(ScreenPtr pScreen)
     drmmode_uevent_init(pScrn, &ms->drmmode);
-    drmmode_map_cursor_bos(pScrn, &ms->drmmode);
+    if (!ms->SWCursor)
+	drmmode_map_cursor_bos(pScrn, &ms->drmmode);
     pixels = drmmode_map_front_bo(&ms->drmmode);
     if (!pixels)
 	return FALSE;

More information about the dri-devel mailing list