summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.com>2008-06-23 10:38:15 -0400
committerAlex Deucher <alex@botch2.com>2008-06-23 10:38:15 -0400
commit9c2f909ea437a63a408d2398ecabe0b378dbb982 (patch)
tree3bfb027a0f3989dd89d88a2e5ececebbaf89506c /src
parentaea9bf75cf0774afd3e65fcf3fd3851f5fb21ca3 (diff)
RADEON: adjust randr crtc/output prepare/commit ordering
This fixes some occasional mode change problems with multiple heads active. It seems radeons generally like to turn on the whole output/crtc setup in one shot.
Diffstat (limited to 'src')
-rw-r--r--src/radeon.h1
-rw-r--r--src/radeon_crtc.c20
-rw-r--r--src/radeon_output.c37
3 files changed, 39 insertions, 19 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 94611a8a..cdd84ea7 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -880,6 +880,7 @@ extern void RADEONWaitForIdleCP(ScrnInfoPtr pScrn);
extern void RADEONWaitForIdleMMIO(ScrnInfoPtr pScrn);
/* radeon_crtc.c */
+extern void radeon_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 b1e978c0..9eb36ed5 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -59,7 +59,7 @@ extern void atombios_crtc_mode_set(xf86CrtcPtr crtc,
int x, int y);
extern void atombios_crtc_dpms(xf86CrtcPtr crtc, int mode);
-static void
+void
radeon_crtc_dpms(xf86CrtcPtr crtc, int mode)
{
RADEONInfoPtr info = RADEONPTR(crtc->scrn);
@@ -110,7 +110,6 @@ radeon_crtc_mode_prepare(xf86CrtcPtr crtc)
if (radeon_crtc->enabled)
crtc->funcs->hide_cursor(crtc);
- radeon_crtc_dpms(crtc, DPMSModeOff);
}
static uint32_t RADEONDiv(CARD64 n, uint32_t d)
@@ -232,25 +231,8 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
static void
radeon_crtc_mode_commit(xf86CrtcPtr crtc)
{
- RADEONInfoPtr info = RADEONPTR(crtc->scrn);
- RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
- RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
-
- if (info->ChipFamily >= CHIP_FAMILY_R600) {
- xf86CrtcPtr other;
- if (radeon_crtc->crtc_id == 1)
- other = pRADEONEnt->pCrtc[0];
- else
- other = pRADEONEnt->pCrtc[1];
- if (other->enabled)
- radeon_crtc_dpms(other, DPMSModeOn);
- }
-
- radeon_crtc_dpms(crtc, DPMSModeOn);
-
if (crtc->scrn->pScreen != NULL)
xf86_reload_cursors(crtc->scrn->pScreen);
-
}
void
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 1f289cb2..91989205 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -584,8 +584,27 @@ radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
static void
radeon_mode_prepare(xf86OutputPtr output)
{
+ RADEONInfoPtr info = RADEONPTR(output->scrn);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (output->scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ xf86OutputPtr loop_output = config->output[o];
+ if (loop_output == output)
+ continue;
+ else if (loop_output->crtc) {
+ xf86CrtcPtr other_crtc = loop_output->crtc;
+ if (other_crtc->enabled) {
+ radeon_dpms(loop_output, DPMSModeOff);
+ radeon_crtc_dpms(other_crtc, DPMSModeOff);
+ }
+ }
+ }
+
radeon_bios_output_lock(output, TRUE);
radeon_dpms(output, DPMSModeOff);
+ radeon_crtc_dpms(output->crtc, DPMSModeOff);
+
}
static void
@@ -605,7 +624,25 @@ radeon_mode_set(xf86OutputPtr output, DisplayModePtr mode,
static void
radeon_mode_commit(xf86OutputPtr output)
{
+ RADEONInfoPtr info = RADEONPTR(output->scrn);
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (output->scrn);
+ int o;
+
+ for (o = 0; o < config->num_output; o++) {
+ xf86OutputPtr loop_output = config->output[o];
+ if (loop_output == output)
+ continue;
+ else if (loop_output->crtc) {
+ xf86CrtcPtr other_crtc = loop_output->crtc;
+ if (other_crtc->enabled) {
+ radeon_dpms(loop_output, DPMSModeOn);
+ radeon_crtc_dpms(other_crtc, DPMSModeOn);
+ }
+ }
+ }
+
radeon_dpms(output, DPMSModeOn);
+ radeon_crtc_dpms(output->crtc, DPMSModeOn);
radeon_bios_output_lock(output, FALSE);
}