diff options
author | Keith Packard <keithp@neko.keithp.com> | 2007-03-05 11:28:46 -0800 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-03-05 11:28:46 -0800 |
commit | 50aa09425f54c4eeca7f8b0fae9579209b10b9c4 (patch) | |
tree | a3a8f1f80fe542d1ca3226b0400e5e218de73a33 | |
parent | d717d9d566fe3c0866b06840114e1c1990bd7be0 (diff) | |
parent | c2c62559e702e7de1fa2ef309fa647ab13564dc3 (diff) |
Merge branch 'modesetting'
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/i830_display.c | 141 |
2 files changed, 1 insertions, 142 deletions
diff --git a/configure.ac b/configure.ac index 772b40bd..c8b99c74 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-video-intel], - 1.9.90, + 1.9.91, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-intel) diff --git a/src/i830_display.c b/src/i830_display.c index d0b21a92..e9c997ab 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -393,107 +393,6 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y) } /** - * In the current world order, there are lists of modes per output, which may - * or may not include the mode that was asked to be set by XFree86's mode - * selection. Find the closest one, in the following preference order: - * - * - Equality - * - Closer in size to the requested mode, but no larger - * - Closer in refresh rate to the requested mode. - */ -DisplayModePtr -i830PipeFindClosestMode(xf86CrtcPtr crtc, DisplayModePtr pMode) -{ - ScrnInfoPtr pScrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - DisplayModePtr pBest = NULL, pScan = NULL; - int i; - - /* Assume that there's only one output connected to the given CRTC. */ - for (i = 0; i < xf86_config->num_output; i++) - { - xf86OutputPtr output = xf86_config->output[i]; - if (output->crtc == crtc && output->probed_modes != NULL) - { - pScan = output->probed_modes; - break; - } - } - - /* If the pipe doesn't have any detected modes, just let the system try to - * spam the desired mode in. - */ - if (pScan == NULL) { - I830CrtcPrivatePtr intel_crtc = crtc->driver_private; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "No pipe mode list for pipe %d," - "continuing with desired mode\n", intel_crtc->pipe); - return pMode; - } - - for (; pScan != NULL; pScan = pScan->next) { - assert(pScan->VRefresh != 0.0); - - /* If there's an exact match, we're done. */ - if (xf86ModesEqual(pScan, pMode)) { - pBest = pMode; - break; - } - - /* Reject if it's larger than the desired mode. */ - if (pScan->HDisplay > pMode->HDisplay || - pScan->VDisplay > pMode->VDisplay) - { - continue; - } - - if (pBest == NULL) { - pBest = pScan; - continue; - } - - /* Find if it's closer to the right size than the current best - * option. - */ - if ((pScan->HDisplay > pBest->HDisplay && - pScan->VDisplay >= pBest->VDisplay) || - (pScan->HDisplay >= pBest->HDisplay && - pScan->VDisplay > pBest->VDisplay)) - { - pBest = pScan; - continue; - } - - /* Find if it's still closer to the right refresh than the current - * best resolution. - */ - if (pScan->HDisplay == pBest->HDisplay && - pScan->VDisplay == pBest->VDisplay && - (fabs(pScan->VRefresh - pMode->VRefresh) < - fabs(pBest->VRefresh - pMode->VRefresh))) { - pBest = pScan; - } - } - - if (pBest == NULL) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "No suitable mode found to program for the pipe.\n" - " continuing with desired mode %dx%d@%.1f\n", - pMode->HDisplay, pMode->VDisplay, pMode->VRefresh); - } else if (!xf86ModesEqual(pBest, pMode)) { - I830CrtcPrivatePtr intel_crtc = crtc->driver_private; - int pipe = intel_crtc->pipe; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Choosing pipe %d's mode %dx%d@%.1f instead of xf86 " - "mode %dx%d@%.1f\n", pipe, - pBest->HDisplay, pBest->VDisplay, pBest->VRefresh, - pMode->HDisplay, pMode->VDisplay, pMode->VRefresh); - pMode = pBest; - } - return pMode; -} - -/** * Sets the power management mode of the pipe and plane. * * This code should probably grow support for turning the cursor off and back @@ -1140,46 +1039,6 @@ i830_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) } -/** - * This function configures the screens in clone mode on - * all active outputs using a mode similar to the specified mode. - */ -Bool -i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, Rotation rotation) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - Bool ok = TRUE; - xf86CrtcPtr crtc = config->output[config->compat_output]->crtc; - - DPRINTF(PFX, "i830SetMode\n"); - - if (crtc && crtc->enabled) - { - ok = xf86CrtcSetMode(crtc, - i830PipeFindClosestMode(crtc, pMode), - rotation, 0, 0); - if (!ok) - goto done; - crtc->desiredMode = *pMode; - } - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Mode bandwidth is %d Mpixel/s\n", - (int)(pMode->HDisplay * pMode->VDisplay * - pMode->VRefresh / 1000000)); - - xf86DisableUnusedFunctions(pScrn); - - i830DescribeOutputConfiguration(pScrn); - -#ifdef XF86DRI - I830DRISetVBlankInterrupt (pScrn, TRUE); -#endif -done: - i830DumpRegs (pScrn); - i830_sdvo_dump(pScrn); - return ok; -} - void i830DescribeOutputConfiguration(ScrnInfoPtr pScrn) { |