summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-17 19:52:27 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-17 19:52:27 -0500
commit9a108f0a0b7203458673ce6221e747a166d39617 (patch)
tree8ef53b0769f32b0915096842fe646b3952f49860
parent31bd6d28dd35021e0e706d4f094989deb856c26a (diff)
ATOM: don't unblank uninitialized crtcs
If the crtc timing isn't setup, you might get stuck in a loop in the BlankCRTC command table fixes bug 16781
-rw-r--r--src/atombios_crtc.c2
-rw-r--r--src/legacy_crtc.c4
-rw-r--r--src/radeon_crtc.c2
-rw-r--r--src/radeon_driver.c10
-rw-r--r--src/radeon_output.c20
-rw-r--r--src/radeon_probe.h1
6 files changed, 28 insertions, 11 deletions
diff --git a/src/atombios_crtc.c b/src/atombios_crtc.c
index 432cebe0..5c26ef82 100644
--- a/src/atombios_crtc.c
+++ b/src/atombios_crtc.c
@@ -491,6 +491,8 @@ atombios_crtc_mode_set(xf86CrtcPtr crtc,
if (info->DispPriority)
RADEONInitDispBandwidth(pScrn);
+ radeon_crtc->initialized = TRUE;
+
if (tilingChanged) {
/* need to redraw front buffer, I guess this can be considered a hack ? */
/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
diff --git a/src/legacy_crtc.c b/src/legacy_crtc.c
index cba1b5f3..b8c53806 100644
--- a/src/legacy_crtc.c
+++ b/src/legacy_crtc.c
@@ -1832,7 +1832,9 @@ legacy_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
radeon_update_tv_routing(pScrn, info->ModeReg);
if (info->DispPriority)
- RADEONInitDispBandwidth(pScrn);
+ RADEONInitDispBandwidth(pScrn);
+
+ radeon_crtc->initialized = TRUE;
if (tilingChanged) {
/* need to redraw front buffer, I guess this can be considered a hack ? */
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index e0875a4e..5a7c730a 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -609,6 +609,7 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
pRADEONEnt->pCrtc[0]->driver_private = pRADEONEnt->Controller[0];
pRADEONEnt->Controller[0]->crtc_id = 0;
pRADEONEnt->Controller[0]->crtc_offset = 0;
+ pRADEONEnt->Controller[0]->initialized = FALSE;
if (info->allowColorTiling)
pRADEONEnt->Controller[0]->can_tile = 1;
else
@@ -633,6 +634,7 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask)
pRADEONEnt->pCrtc[1]->driver_private = pRADEONEnt->Controller[1];
pRADEONEnt->Controller[1]->crtc_id = 1;
pRADEONEnt->Controller[1]->crtc_offset = AVIVO_D2CRTC_H_TOTAL - AVIVO_D1CRTC_H_TOTAL;
+ pRADEONEnt->Controller[1]->initialized = FALSE;
if (info->allowColorTiling)
pRADEONEnt->Controller[1]->can_tile = 1;
else
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index d22db58d..32608a4c 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5601,18 +5601,24 @@ void RADEONLeaveVT(int scrnIndex, int flags)
}
#endif
-#ifndef HAVE_FREE_SHADOW
+
for (i = 0; i < config->num_crtc; i++) {
xf86CrtcPtr crtc = config->crtc[i];
+ RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+ radeon_crtc->initialized = FALSE;
+
+#ifndef HAVE_FREE_SHADOW
if (crtc->rotatedPixmap || crtc->rotatedData) {
crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
crtc->rotatedData);
crtc->rotatedPixmap = NULL;
crtc->rotatedData = NULL;
}
+#endif
}
-#else
+
+#ifdef HAVE_FREE_SHADOW
xf86RotateFreeShadow(pScrn);
#endif
diff --git a/src/radeon_output.c b/src/radeon_output.c
index ba4cb7f1..2128dab2 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -510,10 +510,12 @@ radeon_mode_prepare(xf86OutputPtr output)
xf86CrtcPtr other_crtc = loop_output->crtc;
RADEONCrtcPrivatePtr other_radeon_crtc = other_crtc->driver_private;
if (other_crtc->enabled) {
- radeon_crtc_dpms(other_crtc, DPMSModeOff);
- if (IS_AVIVO_VARIANT)
- atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 1);
- radeon_dpms(loop_output, DPMSModeOff);
+ if (other_radeon_crtc->initialized) {
+ radeon_crtc_dpms(other_crtc, DPMSModeOff);
+ if (IS_AVIVO_VARIANT)
+ atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 1);
+ radeon_dpms(loop_output, DPMSModeOff);
+ }
}
}
}
@@ -553,10 +555,12 @@ radeon_mode_commit(xf86OutputPtr output)
xf86CrtcPtr other_crtc = loop_output->crtc;
RADEONCrtcPrivatePtr other_radeon_crtc = other_crtc->driver_private;
if (other_crtc->enabled) {
- radeon_crtc_dpms(other_crtc, DPMSModeOn);
- if (IS_AVIVO_VARIANT)
- atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 0);
- radeon_dpms(loop_output, DPMSModeOn);
+ if (other_radeon_crtc->initialized) {
+ radeon_crtc_dpms(other_crtc, DPMSModeOn);
+ if (IS_AVIVO_VARIANT)
+ atombios_lock_crtc(info->atomBIOS, other_radeon_crtc->crtc_id, 0);
+ radeon_dpms(loop_output, DPMSModeOn);
+ }
}
}
}
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 1b6ed7b1..447ef573 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -157,6 +157,7 @@ typedef struct _RADEONCrtcPrivateRec {
uint32_t crtc_offset;
int can_tile;
Bool enabled;
+ Bool initialized;
} RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr;
typedef struct _radeon_encoder {