xserver: Branch 'master' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Fri Mar 16 04:36:53 EET 2007


 hw/xfree86/modes/xf86Crtc.h    |    3 ++-
 hw/xfree86/modes/xf86Cursors.c |   20 ++++++++++++++++----
 hw/xfree86/modes/xf86Rotate.c  |   31 ++++++++++++++++++-------------
 3 files changed, 36 insertions(+), 18 deletions(-)

New commits:
diff-tree 3bffb281260476d2f74f0bf451d85d2f7cacd6c4 (from 9562b6abe1da566cf73a08c4f4c4339fb67fbc71)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Thu Mar 15 16:16:16 2007 -0700

    Don't wedge when rotating more than one CRTC.
    
    Rotation block handler was re-registering the rotation damage structure,
    creating an infinite loop in the damage code. Track registration of the
    damage structure to avoid this.
    (cherry picked from commit b14f003b0ed1252766c9e3b1c086ea2809521047)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index df8a8aa..b751592 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -529,7 +529,8 @@ typedef struct _xf86CrtcConfig {
     int			maxWidth, maxHeight;
     
     /* For crtc-based rotation */
-    DamagePtr   rotationDamage;
+    DamagePtr		rotation_damage;
+    Bool		rotation_damage_registered;
 
     /* DGA */
     unsigned int	dga_flags;
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 6826b62..e82b69e 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -251,9 +251,13 @@ xf86RotatePrepare (ScreenPtr pScreen)
 							     crtc->rotatedData,
 							     crtc->mode.HDisplay,
 							     crtc->mode.VDisplay);
-	    /* Hook damage to screen pixmap */
-	    DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
-			    xf86_config->rotationDamage);
+	    if (!xf86_config->rotation_damage_registered)
+	    {
+		/* Hook damage to screen pixmap */
+		DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+				xf86_config->rotation_damage);
+		xf86_config->rotation_damage_registered = TRUE;
+	    }
 	    
 	    xf86CrtcDamageShadow (crtc);
 	}
@@ -265,7 +269,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
 {
     ScrnInfoPtr		pScrn = xf86Screens[pScreen->myNum];
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    DamagePtr		damage = xf86_config->rotationDamage;
+    DamagePtr		damage = xf86_config->rotation_damage;
     RegionPtr		region;
 
     if (!damage)
@@ -334,13 +338,14 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	    crtc->rotatedData = NULL;
 	}
 
-	if (xf86_config->rotationDamage)
+	if (xf86_config->rotation_damage)
 	{
 	    /* Free damage structure */
 	    DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
-			      xf86_config->rotationDamage);
-	    DamageDestroy (xf86_config->rotationDamage);
-	    xf86_config->rotationDamage = NULL;
+			      xf86_config->rotation_damage);
+	    xf86_config->rotation_damage_registered = FALSE;
+	    DamageDestroy (xf86_config->rotation_damage);
+	    xf86_config->rotation_damage = NULL;
 	    /* Free block/wakeup handler */
 	    RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler,
 					  xf86RotateWakeupHandler,
@@ -382,13 +387,13 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	    xf86CrtcDamageShadow (crtc);
 	}
 	
-	if (!xf86_config->rotationDamage)
+	if (!xf86_config->rotation_damage)
 	{
 	    /* Create damage structure */
-	    xf86_config->rotationDamage = DamageCreate (NULL, NULL,
+	    xf86_config->rotation_damage = DamageCreate (NULL, NULL,
 						DamageReportNone,
 						TRUE, pScreen, pScreen);
-	    if (!xf86_config->rotationDamage)
+	    if (!xf86_config->rotation_damage)
 		goto bail2;
 	    
 	    /* Assign block/wakeup handler */
@@ -402,8 +407,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, Displa
 	if (0)
 	{
 bail3:
-	    DamageDestroy (xf86_config->rotationDamage);
-	    xf86_config->rotationDamage = NULL;
+	    DamageDestroy (xf86_config->rotation_damage);
+	    xf86_config->rotation_damage = NULL;
 	    
 bail2:
 	    if (shadow || shadowData)
diff-tree 9562b6abe1da566cf73a08c4f4c4339fb67fbc71 (from 3b71b0f89f1db837da91650baa0ef4bb7ef2e98f)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Thu Mar 15 10:50:45 2007 -0700

    Allow xf86_reload_cursors during server init.
    
    xf86_reload_cursors is supposed to be called from the crtc mode setting
    commit hook; as that happens during server initialization, check for this
    case.
    (cherry picked from commit 5b77bf2d020b1ee56c1c5f2db089a8f7f64a76a6)

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 095df48..009cccf 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -548,12 +548,24 @@ xf86_cursors_init (ScreenPtr screen, int
 void
 xf86_reload_cursors (ScreenPtr screen)
 {
-    ScrnInfoPtr		scrn = xf86Screens[screen->myNum];
-    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-    xf86CursorInfoPtr	cursor_info = xf86_config->cursor_info;
-    CursorPtr		cursor = xf86_config->cursor;
+    ScrnInfoPtr		scrn;
+    xf86CrtcConfigPtr   xf86_config;
+    xf86CursorInfoPtr   cursor_info;
+    CursorPtr		cursor;
     int			x, y;
     
+    /* initial mode setting will not have set a screen yet */
+    if (!screen)
+	return;
+    scrn = xf86Screens[screen->myNum];
+    xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
+
+    /* make sure the cursor code has been initialized */
+    cursor_info = xf86_config->cursor_info;
+    if (!cursor_info)
+	return;
+    
+    cursor = xf86_config->cursor;
     GetSpritePosition (&x, &y);
     if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
 	(*cursor_info->HideCursor)(scrn);



More information about the xorg-commit mailing list