summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-02-26 09:40:00 +1100
committerKeith Packard <keithp@neko.keithp.com>2007-03-04 19:10:26 -0800
commit90f5e77eab88522d64c6e20cd77a7a680eab3b1b (patch)
treef661ca752f2ea86d9f94adb818a156753d8596f5
parente6af7569f201842b4754aec6e72b30dc2daefdfb (diff)
modes: add commit/prepare hooks
(cherry picked from commit 2e31872e05c2408d53ba0182bcddc5dabb3615fe)
-rw-r--r--hw/xfree86/modes/xf86Crtc.c10
-rw-r--r--hw/xfree86/modes/xf86Crtc.h24
2 files changed, 29 insertions, 5 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c53d2a87b..8b13e2bdb 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -282,7 +282,7 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
goto done;
}
- /* Disable the outputs and CRTCs before setting the mode. */
+ /* Prepare the outputs and CRTCs before setting the mode. */
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];
@@ -290,10 +290,10 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
continue;
/* Disable the output as the first thing we do. */
- output->funcs->dpms(output, DPMSModeOff);
+ output->funcs->prepare(output);
}
- crtc->funcs->dpms(crtc, DPMSModeOff);
+ crtc->funcs->prepare(crtc);
/* Set up the DPLL and any output state that needs to adjust or depend
* on the DPLL.
@@ -307,12 +307,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation,
}
/* Now, enable the clocks, plane, pipe, and outputs that we set up. */
- crtc->funcs->dpms(crtc, DPMSModeOn);
+ crtc->funcs->commit(crtc);
for (i = 0; i < xf86_config->num_output; i++)
{
xf86OutputPtr output = xf86_config->output[i];
if (output->crtc == crtc)
- output->funcs->dpms(output, DPMSModeOn);
+ output->funcs->commit(output);
}
/* XXX free adjustedmode */
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index b04f7f3f1..c8aafc1ea 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -97,6 +97,12 @@ typedef struct _xf86CrtcFuncs {
DisplayModePtr adjusted_mode);
/**
+ * Prepare CRTC for an upcoming mode set.
+ */
+ void
+ (*prepare)(xf86CrtcPtr crtc);
+
+ /**
* Callback for setting up a video mode after fixups have been made.
*/
void
@@ -105,6 +111,12 @@ typedef struct _xf86CrtcFuncs {
DisplayModePtr adjusted_mode,
int x, int y);
+ /**
+ * Commit mode changes to a CRTC
+ */
+ void
+ (*commit)(xf86CrtcPtr crtc);
+
/* Set the color ramps for the CRTC to the given values. */
void
(*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
@@ -264,6 +276,18 @@ typedef struct _xf86OutputFuncs {
DisplayModePtr adjusted_mode);
/**
+ * Callback for preparing mode changes on an output
+ */
+ void
+ (*prepare)(xf86OutputPtr output);
+
+ /**
+ * Callback for committing mode changes on an output
+ */
+ void
+ (*commit)(xf86OutputPtr output);
+
+ /**
* Callback for setting up a video mode after fixups have been made.
*
* This is only called while the output is disabled. The dpms callback