xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Aug 20 23:25:12 PDT 2007


 hw/xfree86/modes/xf86Cursors.c |   11 +++++++++++
 hw/xfree86/modes/xf86RandR12.c |    4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
diff-tree 265a633cf1fcbf497d6916d9e22403dffdde2e07 (from 7dc8531548cc9573e28bb04363dcbb3af5864c9a)
Author: Keith Packard <keithp at koto.keithp.com>
Date:   Sun Aug 19 20:29:37 2007 -0700

    Screen size changing should leave FB alone when X is inactive.
    
    xf86RandR12ScreenSetSize must protect calls to EnableDisableFBAccess with
    suitable vtSema checks to avoid invoking driver code while the X server is
    inactive.

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 9d74e53..ae0a2ce 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -345,7 +345,7 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScr
 	randrp->virtualX = pScrn->virtualX;
 	randrp->virtualY = pScrn->virtualY;
     }
-    if (pRoot)
+    if (pRoot && pScrn->vtSema)
 	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
 
     /* Let the driver update virtualX and virtualY */
@@ -363,7 +363,7 @@ xf86RandR12ScreenSetSize (ScreenPtr	pScr
     xf86SetViewport (pScreen, 0, 0);
 
 finish:
-    if (pRoot)
+    if (pRoot && pScrn->vtSema)
 	(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
 #if RANDR_12_INTERFACE
     if (WindowTable[pScreen->myNum] && ret)
diff-tree 7dc8531548cc9573e28bb04363dcbb3af5864c9a (from 1f6ddae003ec65d6bc567831bf32bf75dfefdd6c)
Author: Keith Packard <keithp at koto.keithp.com>
Date:   Sun Aug 19 20:28:05 2007 -0700

    Ref count cursors used in hw/xfree86/modes code.
    
    The multi-crtc cursor code in hw/xfree86/modes holds a reference to the
    current cursor. This reference must be correctly ref counted so the cursor
    is not freed out from underneath this code.

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 396bf30..92b90a9 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -447,7 +447,10 @@ xf86_use_hw_cursor (ScreenPtr screen, Cu
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
 
+    if (xf86_config->cursor)
+	FreeCursor (xf86_config->cursor, None);
     xf86_config->cursor = cursor;
+    ++cursor->refcnt;
     
     if (cursor->bits->width > cursor_info->MaxWidth ||
 	cursor->bits->height> cursor_info->MaxHeight)
@@ -463,7 +466,10 @@ xf86_use_hw_cursor_argb (ScreenPtr scree
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
     
+    if (xf86_config->cursor)
+	FreeCursor (xf86_config->cursor, None);
     xf86_config->cursor = cursor;
+    ++cursor->refcnt;
     
     /* Make sure ARGB support is available */
     if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
@@ -632,4 +638,9 @@ xf86_cursors_fini (ScreenPtr screen)
 	xfree (xf86_config->cursor_image);
 	xf86_config->cursor_image = NULL;
     }
+    if (xf86_config->cursor)
+    {
+	FreeCursor (xf86_config->cursor, None);
+	xf86_config->cursor = NULL;
+    }
 }


More information about the xorg-commit mailing list