summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorHong Liu <hong.liu@intel.com>2008-03-12 21:55:56 +0800
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-03-12 21:55:56 +0800
commita8f4108bea0966406b0fcae8d062ae1cfb4afbb3 (patch)
tree08cb333aca1e14e7120e2669d003205dc40ad2a0 /src/i830_driver.c
parent5f272471878c896038b2c3f2bf704655d908828d (diff)
Fix rotation mem with kernel memory manager in VT switch
Unbind and bind a DRM BO may change the buffer offset, thus crtc may reference a wrong rotated memory after a VT switch cycle. Destroying it here will cause its reallocation when entering VT.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 4c282679..644a11c9 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3088,6 +3088,8 @@ I830LeaveVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+ int o;
DPRINTF(PFX, "Leave VT\n");
@@ -3115,6 +3117,17 @@ I830LeaveVT(int scrnIndex, int flags)
}
#endif
+ for (o = 0; o < config->num_crtc; o++) {
+ xf86CrtcPtr crtc = config->crtc[o];
+
+ if (crtc->rotatedPixmap || crtc->rotatedData) {
+ crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
+ crtc->rotatedData);
+ crtc->rotatedPixmap = NULL;
+ crtc->rotatedData = NULL;
+ }
+ }
+
xf86_hide_cursors (pScrn);
RestoreHWState(pScrn);