[PATCH 2/2] rotate: Mark the transform as unsed before destroying it.

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 25 06:46:08 PDT 2011


xf86RotateDestroy() will only free an unused transformation, so when
tearing down a rotation we first need to mark the current crtc as
untransformed prior to calling destroy. Similarly for CloseScreen we
have the same issue and would leave stale values for the next server
generation.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 hw/xfree86/modes/xf86Rotate.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index da8a8f4..ebf93d3 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -340,8 +340,10 @@ xf86RotateCloseScreen (ScreenPtr screen)
     xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int			c;
 
-    for (c = 0; c < xf86_config->num_crtc; c++)
+    for (c = 0; c < xf86_config->num_crtc; c++) {
+	xf86_config->crtc[c]->transform_in_use = FALSE;
 	xf86RotateDestroy (xf86_config->crtc[c]);
+    }
 }
 
 static Bool
@@ -407,8 +409,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
 	 * If the untranslated transformation is the identity,
 	 * disable the shadow buffer
 	 */
-	xf86RotateDestroy (crtc);
 	crtc->transform_in_use = FALSE;
+	xf86RotateDestroy (crtc);
 	free(new_params);
 	new_params = NULL;
 	new_nparams = 0;
-- 
1.7.5.4



More information about the xorg-devel mailing list