From 1ba4cbb15919759aadd71960c5c057af9ba94fe3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 15 Dec 2008 11:36:43 -0800 Subject: [PATCH] Clean up rotation data when crtc is turned off The shadow frame buffer and other data used for rotation need to be freed when the crtc is disabled, not just when rotation is disabled. Signed-off-by: Keith Packard --- hw/xfree86/modes/xf86Crtc.c | 1 + hw/xfree86/modes/xf86Crtc.h | 7 +++++++ hw/xfree86/modes/xf86Rotate.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index d580ada02..4f8cbb5fa 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -2750,6 +2750,7 @@ xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) { crtc->funcs->dpms(crtc, DPMSModeOff); memset(&crtc->mode, 0, sizeof(crtc->mode)); + xf86RotateDestroy(crtc); } } if (pScrn->pScreen) diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index fcf022b5b..e44996fba 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -707,6 +707,13 @@ xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y); extern _X_EXPORT Bool xf86CrtcRotate (xf86CrtcPtr crtc); +/* + * Clean up any rotation data, used when a crtc is turned off + * as well as when rotation is disabled. + */ +void +xf86RotateDestroy (xf86CrtcPtr crtc); + /* * free shadow memory allocated for all crtcs */ diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 9d7b373ae..793b1a99b 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -294,7 +294,7 @@ xf86RotateBlockHandler(int screenNum, pointer blockData, } } -static void +void xf86RotateDestroy (xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn;