From c2c62559e702e7de1fa2ef309fa647ab13564dc3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 3 Mar 2007 23:12:54 -0800 Subject: Move single mode setting code to X server. Code to drive the global configuration from a single mode setting operation (from RandR 1.1, XFree86-VidModeExtension or XFree86-DGA) has been included in the X server now, so remove it from this driver. --- src/i830_display.c | 141 ----------------------------------------------------- 1 file changed, 141 deletions(-) (limited to 'src') 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 @@ -392,107 +392,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. * @@ -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) { -- cgit v1.2.3