diff options
author | Alex Deucher <alex@cube.(none)> | 2008-04-29 21:01:41 -0400 |
---|---|---|
committer | Alex Deucher <alex@cube.(none)> | 2008-04-29 21:01:41 -0400 |
commit | 445b71021843665ba32f37b2ce5c9d2857c07cc7 (patch) | |
tree | 40c09b9e054694369daecbec3d53a31b4da37d74 /src | |
parent | 070cce5255a5c311f9d8b85ec54bd56655014933 (diff) |
RADEON: assorted fixes
- free rotate pixmaps on VT switch
- save crtc/output status so we only turn on
crtcs/outputs if they are off
- show/hide cursors when changing modes
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_crtc.c | 16 | ||||
-rw-r--r-- | src/radeon_driver.c | 21 | ||||
-rw-r--r-- | src/radeon_output.c | 9 | ||||
-rw-r--r-- | src/radeon_probe.h | 3 |
4 files changed, 48 insertions, 1 deletions
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c index e2d31eba..6a9a76d0 100644 --- a/src/radeon_crtc.c +++ b/src/radeon_crtc.c @@ -67,6 +67,9 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode) RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; xf86CrtcPtr crtc0 = pRADEONEnt->pCrtc[0]; + if ((mode == DPMSModeOn) && radeon_crtc->enabled) + return; + if (IS_AVIVO_VARIANT) { atombios_crtc_dpms(crtc, mode); } else { @@ -86,6 +89,11 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode) legacy_crtc_dpms(crtc0, mode); } } + + if (mode == DPMSModeOn) + radeon_crtc->enabled = TRUE; + else + radeon_crtc->enabled = FALSE; } static Bool @@ -98,6 +106,10 @@ radeon_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode, static void radeon_crtc_mode_prepare(xf86CrtcPtr crtc) { + RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private; + + if (radeon_crtc->enabled) + crtc->funcs->hide_cursor(crtc); radeon_crtc_dpms(crtc, DPMSModeOff); } @@ -235,6 +247,10 @@ radeon_crtc_mode_commit(xf86CrtcPtr crtc) } radeon_crtc_dpms(crtc, DPMSModeOn); + + if (crtc->scrn->pScreen != NULL) + xf86_reload_cursors(crtc->scrn->pScreen); + } void diff --git a/src/radeon_driver.c b/src/radeon_driver.c index e77ea160..202a1904 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -5253,6 +5253,10 @@ void RADEONLeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RADEONInfoPtr info = RADEONPTR(pScrn); +#ifndef HAVE_FREE_SHADOW + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int o; +#endif xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "RADEONLeaveVT\n"); @@ -5285,6 +5289,23 @@ void RADEONLeaveVT(int scrnIndex, int flags) } #endif +#ifndef HAVE_FREE_SHADOW + 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; + } + } +#else + xf86RotateFreeShadow(pScrn); +#endif + + xf86_hide_cursors (pScrn); + RADEONRestore(pScrn); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, diff --git a/src/radeon_output.c b/src/radeon_output.c index 28539d48..907d8248 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -481,6 +481,10 @@ static void radeon_dpms(xf86OutputPtr output, int mode) { RADEONInfoPtr info = RADEONPTR(output->scrn); + RADEONOutputPrivatePtr radeon_output = output->driver_private; + + if ((mode == DPMSModeOn) && radeon_output->enabled) + return; if (IS_AVIVO_VARIANT) { atombios_output_dpms(output, mode); @@ -489,6 +493,11 @@ radeon_dpms(xf86OutputPtr output, int mode) } radeon_bios_output_dpms(output, mode); + if (mode == DPMSModeOn) + radeon_output->enabled = TRUE; + else + radeon_output->enabled = FALSE; + } static void diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 0096ce02..79839700 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -193,6 +193,7 @@ typedef struct _RADEONCrtcPrivateRec { uint32_t crtc_offset; int can_tile; + Bool enabled; } RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr; typedef struct { @@ -261,6 +262,7 @@ typedef struct _RADEONOutputPrivateRec { char *name; int output_id; int devices; + Bool enabled; } RADEONOutputPrivateRec, *RADEONOutputPrivatePtr; struct avivo_pll_state { @@ -274,7 +276,6 @@ struct avivo_pll_state { CARD32 int_ss_cntl; }; - struct avivo_crtc_state { CARD32 pll_source; CARD32 h_total; |