diff options
author | Dave Airlie <airlied@linux.ie> | 2007-01-21 20:29:56 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2007-01-21 20:29:56 +1100 |
commit | aa9d04ba94a3cd60b248231da517e2817591fc69 (patch) | |
tree | 164fd3afd49b8966e51d3196faa20ed197e5239b /src/radeon_modes.c | |
parent | e8be0056e8ff666f63a294691661f5dab289203e (diff) |
remove alot more mergedfb support
Diffstat (limited to 'src/radeon_modes.c')
-rw-r--r-- | src/radeon_modes.c | 256 |
1 files changed, 0 insertions, 256 deletions
diff --git a/src/radeon_modes.c b/src/radeon_modes.c index b97b6bdf..6036f828 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -55,15 +55,6 @@ #include "xf86DDC.h" #include <randrstr.h> -void -RADEONGetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) -{ - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; - - *x = pScrn->virtualX; - *y = pScrn->virtualY; -} - void RADEONSetPitch (ScrnInfoPtr pScrn) { int dummy = pScrn->virtualX; @@ -85,167 +76,6 @@ void RADEONSetPitch (ScrnInfoPtr pScrn) pScrn->displayWidth = dummy; } -/* XFree86's xf86ValidateModes routine doesn't work well with DDC modes, - * so here is our own validation routine. - */ -int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName, - RADEONMonitorType DisplayType, int crtc2) -{ - RADEONInfoPtr info = RADEONPTR(pScrn1); - DisplayModePtr p; - DisplayModePtr last = NULL; - DisplayModePtr first = NULL; - DisplayModePtr ddcModes = NULL; - int count = 0; - int i, width, height; - ScrnInfoPtr pScrn = pScrn1; - - if (crtc2) - pScrn = info->CRT2pScrn; - - pScrn->virtualX = pScrn1->display->virtualX; - pScrn->virtualY = pScrn1->display->virtualY; - - if (pScrn->monitor->DDC) { - int maxVirtX = pScrn->virtualX; - int maxVirtY = pScrn->virtualY; - - /* Collect all of the DDC modes */ - first = last = ddcModes = xf86DDCGetModes(pScrn->scrnIndex, pScrn->monitor->DDC); - - for (p = ddcModes; p; p = p->next) { - - /* If primary head is a flat panel, use RMX by default */ - if ((!info->IsSecondary && DisplayType != MT_CRT) && - (!info->ddc_mode) && (!crtc2)) { - /* These values are effective values after expansion. - * They are not really used to set CRTC registers. - */ - p->HTotal = info->PanelXRes + info->HBlank; - p->HSyncStart = info->PanelXRes + info->HOverPlus; - p->HSyncEnd = p->HSyncStart + info->HSyncWidth; - p->VTotal = info->PanelYRes + info->VBlank; - p->VSyncStart = info->PanelYRes + info->VOverPlus; - p->VSyncEnd = p->VSyncStart + info->VSyncWidth; - p->Clock = info->DotClock; - - p->Flags |= RADEON_USE_RMX; - } - - maxVirtX = MAX(maxVirtX, p->HDisplay); - maxVirtY = MAX(maxVirtY, p->VDisplay); - count++; - - last = p; - } - - /* Match up modes that are specified in the XF86Config file */ - if (ppModeName[0]) { - DisplayModePtr next; - - /* Reset the max virtual dimensions */ - maxVirtX = pScrn->virtualX; - maxVirtY = pScrn->virtualY; - - /* Reset list */ - first = last = NULL; - - for (i = 0; ppModeName[i]; i++) { - /* FIXME: Use HDisplay and VDisplay instead of mode string */ - if (sscanf(ppModeName[i], "%dx%d", &width, &height) == 2) { - for (p = ddcModes; p; p = next) { - next = p->next; - - if (p->HDisplay == width && p->VDisplay == height) { - /* We found a DDC mode that matches the one - requested in the XF86Config file */ - p->type |= M_T_USERDEF; - - /* Update the max virtual setttings */ - maxVirtX = MAX(maxVirtX, width); - maxVirtY = MAX(maxVirtY, height); - - /* Unhook from DDC modes */ - if (p->prev) p->prev->next = p->next; - if (p->next) p->next->prev = p->prev; - if (p == ddcModes) ddcModes = p->next; - - /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; - - break; - } - } - } - } - - /* - * Add remaining DDC modes if they're smaller than the user - * specified modes - */ - for (p = ddcModes; p; p = next) { - next = p->next; - if (p->HDisplay <= maxVirtX && p->VDisplay <= maxVirtY) { - /* Unhook from DDC modes */ - if (p->prev) p->prev->next = p->next; - if (p->next) p->next->prev = p->prev; - if (p == ddcModes) ddcModes = p->next; - - /* Add to used modes */ - if (last) { - last->next = p; - p->prev = last; - } else { - first = p; - p->prev = NULL; - } - p->next = NULL; - last = p; - } - } - - /* Delete unused modes */ - while (ddcModes) - xf86DeleteMode(&ddcModes, ddcModes); - } else { - /* - * No modes were configured, so we make the DDC modes - * available for the user to cycle through. - */ - for (p = ddcModes; p; p = p->next) - p->type |= M_T_USERDEF; - } - - if (crtc2) { - pScrn->virtualX = maxVirtX; - pScrn->virtualY = maxVirtY; - } else { - pScrn->virtualX = pScrn->display->virtualX = maxVirtX; - pScrn->virtualY = pScrn->display->virtualY = maxVirtY; - } - } - - /* Close the doubly-linked mode list, if we found any usable modes */ - if (last) { - last->next = first; - first->prev = last; - pScrn->modes = first; -// RADEONSetPitch(pScrn); - } - - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Total number of valid DDC mode(s) found: %d\n", count); - - return count; -} /* This is used only when no mode is specified for FP and no ddc is * available. We force it to native mode, if possible. @@ -670,81 +500,6 @@ RADEONProbeOutputModes(xf86OutputPtr output) FALSE); } } - - -/** - * Constructs pScrn->modes from the output mode lists. - * - * Currently it only takes one output's mode list and stuffs it into the - * XFree86 DDX mode list while trimming it for root window size. - * - * This should be obsoleted by RandR 1.2 hopefully. - */ -void -RADEON_set_xf86_modes_from_outputs(ScrnInfoPtr pScrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (pScrn); - RADEONInfoPtr info = RADEONPTR(pScrn); - RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - DisplayModePtr saved_mode, last; - int originalVirtualX, originalVirtualY; - int i; - - /* Remove the current mode from the modelist if we're re-validating, so we - * can find a new mode to map ourselves to afterwards. - */ - saved_mode = info->currentMode; - if (saved_mode != NULL) { - RADEONxf86DeleteModeFromList(&pScrn->modes, saved_mode); - } - - /* Clear any existing modes from pScrn->modes */ - while (pScrn->modes != NULL) - xf86DeleteMode(&pScrn->modes, pScrn->modes); - - /* Set pScrn->modes to the mode list for an arbitrary output. - * pScrn->modes should only be used for XF86VidMode now, which we don't - * care about enough to make some sort of unioned list. - */ - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; - if (output->probed_modes != NULL) { - pScrn->modes = - RADEON_xf86DuplicateModes(pScrn, output->probed_modes); - break; - } - } - - RADEONGetOriginalVirtualSize(pScrn, &originalVirtualX, &originalVirtualY); - - /* Disable modes in the XFree86 DDX list that are larger than the current - * virtual size. - */ - RADEONxf86ValidateModesSize(pScrn, pScrn->modes, - originalVirtualX, originalVirtualY, - pScrn->displayWidth); - - /* Strip out anything that we threw out for virtualX/Y. */ - RADEONxf86PruneInvalidModes(pScrn, &pScrn->modes, TRUE); - - if (pScrn->modes == NULL) { - FatalError("No modes left for XFree86 DDX\n"); - } - - /* For some reason, pScrn->modes is circular, unlike the other mode lists. - * How great is that? - */ - last = RADEONGetModeListTail(pScrn->modes); - last->next = pScrn->modes; - pScrn->modes->prev = last; - - /* Save a pointer to the previous current mode. We can't reset - * pScrn->currentmode, because we rely on xf86SwitchMode's shortcut not - * happening so we can hot-enable devices at SwitchMode. We'll notice this - * case at SwitchMode and free the saved mode. - */ - info->savedCurrentMode = saved_mode; -} /** * Takes the output mode lists and decides the default root window size @@ -785,14 +540,3 @@ RADEON_set_default_screen_size(ScrnInfoPtr pScrn) -int RADEONValidateXF86ModeList(ScrnInfoPtr pScrn, Bool first_time) -{ - - if (first_time) - { - RADEON_set_default_screen_size(pScrn); - } - - RADEON_set_xf86_modes_from_outputs(pScrn); - return 1; -} |