summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2011-11-15 18:50:56 +0100
committerEgbert Eich <eich@freedesktop.org>2012-01-05 09:28:49 +0100
commiteb6d769a087b2ed5952f477fc3f0b0625810a287 (patch)
tree7b0bc804c4871ed2015712da5dc8e3338e7f2c3b
parentac51e331895b216d288bc7bd108a38b362214668 (diff)
DPMS: Split non-modeset CRTC DPMS function.
RADEONRestore() calls crtc->funcs->dpms() after most of the mode setting subsystems have been restored. This function enables the CRTCs but does more: it calls DRM pre- and post-modeset ioctls and sets up the palettes (LUTs). None of these two things are needed. Accessing the palette registers after restoring the PLLs can even lead to lockups. Thus the CRTC DPMS function is split into two parts: one that just enables /disables the CRTC and one which wraps this function and does the rest. Now the inner function can be called directly from RADEONRestore() as there is no need to go thru the RandR hooks in this function while the RandR hook uses the wrappering function so the full functionality is preserved from an RandR point of view. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
-rw-r--r--src/radeon.h1
-rw-r--r--src/radeon_crtc.c25
-rw-r--r--src/radeon_driver.c4
3 files changed, 19 insertions, 11 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 3f7ad4e6..d99fe3a2 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -1147,6 +1147,7 @@ extern void RADEONWaitForVLineMMIO(ScrnInfoPtr pScrn, PixmapPtr pPix,
/* radeon_crtc.c */
extern void radeon_crtc_dpms(xf86CrtcPtr crtc, int mode);
+extern void radeon_do_crtc_dpms(xf86CrtcPtr crtc, int mode);
extern void radeon_crtc_load_lut(xf86CrtcPtr crtc);
extern void radeon_crtc_modeset_ioctl(xf86CrtcPtr crtc, Bool post);
extern Bool RADEONAllocateControllers(ScrnInfoPtr pScrn, int mask);
diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 9821ab60..d48cbc1e 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -69,18 +69,12 @@ RADEONInitDispBandwidthAVIVO(ScrnInfoPtr pScrn,
DisplayModePtr mode2, int pixel_bytes2);
void
-radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
+radeon_do_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
RADEONInfoPtr info = RADEONPTR(crtc->scrn);
RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
- RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
xf86CrtcPtr crtc0 = pRADEONEnt->pCrtc[0];
-
- if ((mode == DPMSModeOn) && radeon_crtc->enabled)
- return;
-
- if (mode == DPMSModeOff)
- radeon_crtc_modeset_ioctl(crtc, FALSE);
+ RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
if (IS_AVIVO_VARIANT || info->r4xx_atom) {
atombios_crtc_dpms(crtc, mode);
@@ -101,6 +95,20 @@ radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
legacy_crtc_dpms(crtc0, mode);
}
}
+}
+
+void
+radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
+{
+ RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
+
+ if ((mode == DPMSModeOn) && radeon_crtc->enabled)
+ return;
+
+ if (mode == DPMSModeOff)
+ radeon_crtc_modeset_ioctl(crtc, FALSE);
+
+ radeon_do_crtc_dpms(crtc, mode);
if (mode != DPMSModeOff) {
radeon_crtc_modeset_ioctl(crtc, TRUE);
@@ -560,7 +568,6 @@ radeon_crtc_load_lut(xf86CrtcPtr crtc)
if (IS_AVIVO_VARIANT)
OUTREG(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id);
}
-
}
static void
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 04a242a7..077f9a46 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5895,12 +5895,12 @@ static void RADEONRestore(ScrnInfoPtr pScrn)
if (pRADEONEnt->HasCRTC2 && !info->IsSecondary) {
if (info->crtc2_on && xf86_config->num_crtc > 1) {
crtc = xf86_config->crtc[1];
- crtc->funcs->dpms(crtc, DPMSModeOn);
+ radeon_do_crtc_dpms(crtc, DPMSModeOn);
}
}
if (info->crtc_on) {
crtc = xf86_config->crtc[0];
- crtc->funcs->dpms(crtc, DPMSModeOn);
+ radeon_do_crtc_dpms(crtc, DPMSModeOn);
}
#ifdef WITH_VGAHW