summaryrefslogtreecommitdiff
path: root/src/i830_driver.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@guitar.keithp.com>2007-03-05 22:32:52 -0800
committerKeith Packard <keithp@guitar.keithp.com>2007-03-05 22:34:13 -0800
commit4042b27f01fdb94e7fc0d4e991e054fff88479ea (patch)
tree1a9160de3d92ce7d9700ae58654574b7108eba5b /src/i830_driver.c
parent55ee46aebbf1ec1a8ce914fbd0c8894fc857db8f (diff)
Move EnterVT mode setting code to xf86SetDesiredModes.
Make the application of crtc desiredModes generic code instead of per-driver by creating xf86SetDesiredModes from the code that was in EnterVT and calling it. Also, move the frame buffer clear until just before mode setting to make sure things are mapped correctly.
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r--src/i830_driver.c45
1 files changed, 7 insertions, 38 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7ab2cdc8..0977511f 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2885,9 +2885,7 @@ static Bool
I830EnterVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
I830Ptr pI830 = I830PTR(pScrn);
- int i;
DPRINTF(PFX, "Enter VT\n");
@@ -2902,12 +2900,6 @@ I830EnterVT(int scrnIndex, int flags)
pI830->leaving = FALSE;
-#if 1
- /* Clear the framebuffer */
- memset(pI830->FbBase + pScrn->fbOffset, 0,
- pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
-#endif
-
if (I830IsPrimary(pScrn))
if (!i830_bind_all_memory(pScrn))
return FALSE;
@@ -2920,27 +2912,13 @@ I830EnterVT(int scrnIndex, int flags)
ResetState(pScrn, FALSE);
SetHWOperatingState(pScrn);
- for (i = 0; i < xf86_config->num_crtc; i++)
- {
- xf86CrtcPtr crtc = xf86_config->crtc[i];
-
- /* Mark that we'll need to re-set the mode for sure */
- memset(&crtc->mode, 0, sizeof(crtc->mode));
- if (!crtc->desiredMode.CrtcHDisplay)
- {
- crtc->desiredMode = *i830PipeFindClosestMode (crtc, pScrn->currentMode);
- crtc->desiredRotation = RR_Rotate_0;
- crtc->desiredX = 0;
- crtc->desiredY = 0;
- }
-
- if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation,
- crtc->desiredX, crtc->desiredY))
- return FALSE;
- }
-
- xf86DisableUnusedFunctions(pScrn);
+ /* Clear the framebuffer */
+ memset(pI830->FbBase + pScrn->fbOffset, 0,
+ pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
+ if (!xf86SetDesiredModes (pScrn))
+ return FALSE;
+
i830DumpRegs (pScrn);
i830DescribeOutputConfiguration(pScrn);
@@ -3003,8 +2981,6 @@ I830EnterVT(int scrnIndex, int flags)
if (pI830->checkDevices)
pI830->devicesTimer = TimerSet(NULL, 0, 1000, I830CheckDevicesTimer, pScrn);
- pI830->currentMode = pScrn->currentMode;
-
/* Force invarient 3D state to be emitted */
*pI830->used3D = 1<<31;
@@ -3014,17 +2990,10 @@ I830EnterVT(int scrnIndex, int flags)
static Bool
I830SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
{
-
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
I830Ptr pI830 = I830PTR(pScrn);
- Bool ret = TRUE;
- DPRINTF(PFX, "I830SwitchMode: mode == %p\n", mode);
-
- if (!i830SetMode(pScrn, mode, pI830->rotation))
- pI830->currentMode = mode;
-
- return ret;
+ return xf86SetSingleMode (pScrn, mode, pI830->rotation);
}
static Bool