diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_display.c | 21 | ||||
-rw-r--r-- | src/radeon_modes.c | 149 | ||||
-rw-r--r-- | src/radeon_probe.h | 1 | ||||
-rw-r--r-- | src/radeon_randr.c | 33 | ||||
-rw-r--r-- | src/radeon_xf86Crtc.c | 4 |
5 files changed, 105 insertions, 103 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c index 260f5a17..7f17e457 100644 --- a/src/radeon_display.c +++ b/src/radeon_display.c @@ -1149,14 +1149,15 @@ void RADEONSetupConnectors(ScrnInfoPtr pScrn) } } -static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, int connector) +static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr pPort) { RADEONInfoPtr info = RADEONPTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); unsigned char *RADEONMMIO = info->MMIO; + RADEONOutputPrivatePtr pRPort = pPort->driver_private; if (info->IsMobility) { - switch(connector) { + switch(pRPort->num) { case 0: /* non-DDC laptop panel connected on primary */ if (INREG(RADEON_BIOS_4_SCRATCH) & 4) @@ -1177,18 +1178,17 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, int connector) /* Primary Head (DVI or Laptop Int. panel)*/ /* A ddc capable display connected on DVI port */ /* Secondary Head (mostly VGA, can be DVI on some OEM boards)*/ -void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, int connector) +void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr pPort) { RADEONInfoPtr info = RADEONPTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); - xf86OutputPtr pPort = pRADEONEnt->pOutput[connector]; RADEONOutputPrivatePtr pRPort = pPort->driver_private; if (pRPort->MonType == MT_UNKNOWN) { if ((pRPort->MonType = RADEONDisplayDDCConnected(pScrn, pRPort->DDCType, pPort))); - else if((pRPort->MonType = RADEONPortCheckNonDDC(pScrn, connector))); + else if((pRPort->MonType = RADEONPortCheckNonDDC(pScrn, pPort))); else pRPort->MonType = RADEONCrtIsPhysicallyConnected(pScrn, !(pRPort->DACType)); } @@ -1267,8 +1267,8 @@ static void RADEONQueryConnectedDisplays(ScrnInfoPtr pScrn) return; } - RADEONConnectorFindMonitor(pScrn, 0); - RADEONConnectorFindMonitor(pScrn, 1); + RADEONConnectorFindMonitor(pScrn, pRADEONEnt->pOutput[0]); + RADEONConnectorFindMonitor(pScrn, pRADEONEnt->pOutput[1]); } @@ -2470,7 +2470,8 @@ radeon_detect(xf86OutputPtr output) static DisplayModePtr radeon_get_modes(xf86OutputPtr output) { - + RADEONProbeOutputModes(output); + return output->probed_modes; } static void @@ -2550,8 +2551,12 @@ Bool RADEONAllocateConnectors(ScrnInfoPtr pScrn) pRADEONEnt->PortInfo[i]->type = OUTPUT_VGA; pRADEONEnt->pOutput[i]->driver_private = pRADEONEnt->PortInfo[i]; + pRADEONEnt->PortInfo[i]->num = i; + + pRADEONEnt->pOutput[i]->possible_crtcs = (1<<0) | (1<<1); } + return TRUE; } diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 639d39aa..e8e14765 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -593,104 +593,81 @@ int RADEONValidateMergeModes(ScrnInfoPtr pScrn1) } void -RADEONProbeOutputModes(ScrnInfoPtr pScrn) +RADEONProbeOutputModes(xf86OutputPtr output) { + ScrnInfoPtr pScrn = output->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (pScrn); RADEONInfoPtr info = RADEONPTR(pScrn); RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + RADEONOutputPrivatePtr pRPort = output->driver_private; int i; DisplayModePtr ddc_modes, mode; DisplayModePtr test; - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; + /* force reprobe */ + pRPort->MonType = MT_UNKNOWN; - test = output->probed_modes; - while(test != NULL) { - xf86DeleteMode(&test, test); + RADEONConnectorFindMonitor(pScrn, output); + + /* okay we got DDC info */ + if (output->MonInfo) { + /* Debug info for now, at least */ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID for output %d\n", i); + xf86PrintEDID(output->MonInfo); + + ddc_modes = RADEONGetDDCModes(pScrn, output->MonInfo); + + for (mode = ddc_modes; mode != NULL; mode = mode->next) { + if (mode->Flags & V_DBLSCAN) { + if ((mode->CrtcHDisplay >= 1024) || (mode->CrtcVDisplay >= 768)) + mode->status = MODE_CLOCK_RANGE; } - - output->probed_modes = test; - - /* force reprobe */ - pRADEONEnt->PortInfo[i]->MonType = MT_UNKNOWN; + } + RADEONxf86PruneInvalidModes(pScrn, &ddc_modes, TRUE); + + /* do some physcial size stuff */ + } + + + if (output->probed_modes == NULL) { + MonRec fixed_mon; + DisplayModePtr modes; + + switch(pRPort->MonType) { + case MT_CRT: + case MT_DFP: - RADEONConnectorFindMonitor(pScrn, i); + /* We've got a potentially-connected monitor that we can't DDC. Return a + * fixed set of VESA plus user modes for a presumed multisync monitor with + * some reasonable limits. + */ + fixed_mon.nHsync = 1; + fixed_mon.hsync[0].lo = 31.0; + fixed_mon.hsync[0].hi = 100.0; + fixed_mon.nVrefresh = 1; + fixed_mon.vrefresh[0].lo = 50.0; + fixed_mon.vrefresh[0].hi = 70.0; - /* okay we got DDC info */ - if (output->MonInfo) { - /* Debug info for now, at least */ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "EDID for output %d\n", i); - xf86PrintEDID(pRADEONEnt->pOutput[i]->MonInfo); - - ddc_modes = RADEONGetDDCModes(pScrn, pRADEONEnt->pOutput[i]->MonInfo); - - for (mode = ddc_modes; mode != NULL; mode = mode->next) { - if (mode->Flags & V_DBLSCAN) { - if ((mode->CrtcHDisplay >= 1024) || (mode->CrtcVDisplay >= 768)) - mode->status = MODE_CLOCK_RANGE; - } - } - RADEONxf86PruneInvalidModes(pScrn, &ddc_modes, TRUE); - - /* do some physcial size stuff */ - } - - - if (output->probed_modes == NULL) { - MonRec fixed_mon; - DisplayModePtr modes; - - switch(pRADEONEnt->PortInfo[i]->MonType) { - case MT_CRT: - case MT_DFP: - - /* We've got a potentially-connected monitor that we can't DDC. Return a - * fixed set of VESA plus user modes for a presumed multisync monitor with - * some reasonable limits. - */ - fixed_mon.nHsync = 1; - fixed_mon.hsync[0].lo = 31.0; - fixed_mon.hsync[0].hi = 100.0; - fixed_mon.nVrefresh = 1; - fixed_mon.vrefresh[0].lo = 50.0; - fixed_mon.vrefresh[0].hi = 70.0; - - modes = RADEONxf86DuplicateModes(pScrn, pScrn->monitor->Modes); - RADEONxf86ValidateModesSync(pScrn, modes, &fixed_mon); - RADEONxf86PruneInvalidModes(pScrn, &modes, TRUE); - /* fill out CRT of FP mode table */ - pRADEONEnt->pOutput[i]->probed_modes = modes; - break; - - case MT_LCD: - RADEONValidateFPModes(pScrn, pScrn->display->modes, &pRADEONEnt->pOutput[i]->probed_modes); - break; - default: - break; - } - } - - if (output->probed_modes) { - RADEONxf86ValidateModesUserConfig(pScrn, - output->probed_modes); - RADEONxf86PruneInvalidModes(pScrn, &output->probed_modes, - FALSE); - } - - - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - { - /* The code to choose the best mode per pipe later on will require - * VRefresh to be set. - */ - mode->VRefresh = RADEONxf86ModeVRefresh(mode); - RADEONxf86SetModeCrtc(mode, INTERLACE_HALVE_V); - -#ifdef DEBUG_REPROBE - PrintModeline(pScrn->scrnIndex, mode); -#endif - } + modes = RADEONxf86DuplicateModes(pScrn, pScrn->monitor->Modes); + RADEONxf86ValidateModesSync(pScrn, modes, &fixed_mon); + RADEONxf86PruneInvalidModes(pScrn, &modes, TRUE); + /* fill out CRT of FP mode table */ + pRADEONEnt->pOutput[i]->probed_modes = modes; + break; + + case MT_LCD: + RADEONValidateFPModes(pScrn, pScrn->display->modes, &output->probed_modes); + break; + default: + break; + } + } + + if (output->probed_modes) { + RADEONxf86ValidateModesUserConfig(pScrn, + output->probed_modes); + RADEONxf86PruneInvalidModes(pScrn, &output->probed_modes, + FALSE); } } diff --git a/src/radeon_probe.h b/src/radeon_probe.h index a7175047..959d4dd1 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -124,6 +124,7 @@ typedef struct _RADEONCrtcPrivateRec { } RADEONCrtcPrivateRec, *RADEONCrtcPrivatePtr; typedef struct _RADEONOutputPrivateRec { + int num; RADEONOutputType type; void *dev_priv; RADEONDDCType DDCType; diff --git a/src/radeon_randr.c b/src/radeon_randr.c index baa92072..ce28e7b7 100644 --- a/src/radeon_randr.c +++ b/src/radeon_randr.c @@ -66,12 +66,31 @@ static Bool xf86RandR12CreateScreenResources12 (ScreenPtr pScreen); #endif -static int RADEONRandRIndex; -static int RADEONRandRGeneration; +static int xf86RandR12Index; +static int xf86RandR12Generation; -#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[RADEONRandRIndex].ptr) +#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandR12Index].ptr) #if RANDR_12_INTERFACE + +void +xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) +{ + ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + + if (xf86RandR12Generation != serverGeneration || + XF86RANDRINFO(pScreen)->virtualX == -1) + { + *x = pScrn->virtualX; + *y = pScrn->virtualY; + } else { + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + + *x = randrp->virtualX; + *y = randrp->virtualY; + } +} + static int xf86RandR12ModeRefresh (DisplayModePtr mode) { @@ -811,10 +830,10 @@ RADEONRandRInit (ScreenPtr pScreen, int rotation) if (!noPanoramiXExtension) return TRUE; #endif - if (RADEONRandRGeneration != serverGeneration) + if (xf86RandR12Generation != serverGeneration) { - RADEONRandRIndex = AllocateScreenPrivateIndex(); - RADEONRandRGeneration = serverGeneration; + xf86RandR12Index = AllocateScreenPrivateIndex(); + xf86RandR12Generation = serverGeneration; } randrp = xalloc (sizeof (XF86RandRInfoRec)); @@ -841,7 +860,7 @@ RADEONRandRInit (ScreenPtr pScreen, int rotation) randrp->maxX = randrp->maxY = 0; - pScreen->devPrivates[RADEONRandRIndex].ptr = randrp; + pScreen->devPrivates[xf86RandR12Index].ptr = randrp; #if RANDR_12_INTERFACE if (!RADEONRandRInit12 (pScreen)) diff --git a/src/radeon_xf86Crtc.c b/src/radeon_xf86Crtc.c index 22f7ae47..76b03f5c 100644 --- a/src/radeon_xf86Crtc.c +++ b/src/radeon_xf86Crtc.c @@ -548,12 +548,12 @@ xf86SetScrnInfoModes (ScrnInfoPtr pScrn) /* Disable modes in the XFree86 DDX list that are larger than the current * virtual size. */ - i830xf86ValidateModesSize(pScrn, pScrn->modes, + RADEONxf86ValidateModesSize(pScrn, pScrn->modes, originalVirtualX, originalVirtualY, pScrn->displayWidth); /* Strip out anything that we threw out for virtualX/Y. */ - i830xf86PruneInvalidModes(pScrn, &pScrn->modes, TRUE); + RADEONxf86PruneInvalidModes(pScrn, &pScrn->modes, TRUE); for (mode = pScrn->modes; mode; mode = mode->next) if (xf86ModesEqual (mode, &crtc->desiredMode)) |