[PATCH] xf86/modes: Fix shadow rotation crashing when screen pixmap changes

Pauli Nieminen suokkos at gmail.com
Thu Sep 22 08:38:53 PDT 2011


From: Pauli Nieminen <pauli.nieminen at linux.intel.com>

Driver may change screen pixmaps after page flipping that would then
make damage lose track of the root pixmap.

Using root window for shadow damages fixes the problem because
SetWindowPixmap is implemented in shadow code.

Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
---

I managed to hit same bug as Chris Following patch fixes the shadow code
with Chris' transformation_in_use fix.

 hw/xfree86/modes/xf86Rotate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 57c3499..1f70cb2 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -194,7 +194,7 @@ xf86RotatePrepare (ScreenPtr pScreen)
 	    if (!xf86_config->rotation_damage_registered)
 	    {
 		/* Hook damage to screen pixmap */
-		DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+		DamageRegister (&pScreen->root->drawable,
 				xf86_config->rotation_damage);
 		xf86_config->rotation_damage_registered = TRUE;
 		EnableLimitedSchedulingLatency();
@@ -301,7 +301,7 @@ xf86RotateDestroy (xf86CrtcPtr crtc)
 	/* Free damage structure */
 	if (xf86_config->rotation_damage_registered)
 	{
-	    DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
+	    DamageUnregister (&pScreen->root->drawable,
 			      xf86_config->rotation_damage);
 	    xf86_config->rotation_damage_registered = FALSE;
 	    DisableLimitedSchedulingLatency();
-- 
1.7.4.1



More information about the xorg-devel mailing list