summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2007-03-15 16:16:16 -0700
committerKeith Packard <keithp@neko.keithp.com>2007-03-15 16:16:16 -0700
commitb14f003b0ed1252766c9e3b1c086ea2809521047 (patch)
tree978f87eff6fb71111b5ea6428c6ceb2ac2535b6c
parent5b77bf2d020b1ee56c1c5f2db089a8f7f64a76a6 (diff)
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.
-rw-r--r--hw/xfree86/modes/xf86Crtc.h3
-rw-r--r--hw/xfree86/modes/xf86Rotate.c31
2 files changed, 20 insertions, 14 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index df8a8aad9..b7515928e 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 6826b6277..e82b69e1b 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, DisplayModePtr mode, Rotation rotation)
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, DisplayModePtr mode, Rotation rotation)
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, DisplayModePtr mode, Rotation rotation)
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)