diff options
-rw-r--r-- | src/atombios_output.c | 13 | ||||
-rw-r--r-- | src/radeon_atombios.c | 146 | ||||
-rw-r--r-- | src/radeon_atombios.h | 3 | ||||
-rw-r--r-- | src/radeon_modes.c | 12 | ||||
-rw-r--r-- | src/radeon_output.c | 23 | ||||
-rw-r--r-- | src/radeon_probe.h | 2 |
6 files changed, 173 insertions, 26 deletions
diff --git a/src/atombios_output.c b/src/atombios_output.c index 45e56960..3b9cfbfe 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -431,6 +431,14 @@ atombios_output_dpms(xf86OutputPtr output, int mode) atombios_device_dpms(output, ATOM_DEVICE_CRT1_SUPPORT, mode); else if (radeon_output->devices & ATOM_DEVICE_CRT2_SUPPORT) atombios_device_dpms(output, ATOM_DEVICE_CRT2_SUPPORT, mode); + } else if (radeon_output->MonType == MT_CV) { + ErrorF("AGD: cv dpms\n"); + if (radeon_output->devices & ATOM_DEVICE_CV_SUPPORT) + atombios_device_dpms(output, ATOM_DEVICE_CV_SUPPORT, mode); + } else if (OUTPUT_IS_TV) { + ErrorF("AGD: tv dpms\n"); + if (radeon_output->devices & ATOM_DEVICE_TV1_SUPPORT) + atombios_device_dpms(output, ATOM_DEVICE_TV1_SUPPORT, mode); } #if 1 @@ -480,9 +488,12 @@ atombios_set_output_crtc_source(xf86OutputPtr output) } else if (radeon_output->MonType == MT_LCD) { if (radeon_output->devices & ATOM_DEVICE_LCD1_SUPPORT) crtc_src_param.ucDevice = ATOM_DEVICE_LCD1_INDEX; - } else if (OUTPUT_IS_TV || (radeon_output->MonType == MT_CV)) { + } else if (OUTPUT_IS_TV) { if (radeon_output->devices & ATOM_DEVICE_TV1_SUPPORT) crtc_src_param.ucDevice = ATOM_DEVICE_TV1_INDEX; + } else if (radeon_output->MonType == MT_CV) { + if (radeon_output->devices & ATOM_DEVICE_CV_SUPPORT) + crtc_src_param.ucDevice = ATOM_DEVICE_CV_INDEX; } break; } diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index ff163689..18088b5b 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -59,6 +59,8 @@ static AtomBiosResult rhdAtomAllocateFbScratch(atomBiosHandlePtr handle, AtomBiosRequestID func, AtomBiosArgPtr data); static AtomBiosResult rhdAtomLvdsGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID unused, AtomBiosArgPtr data); +static AtomBiosResult rhdAtomCVGetTimings(atomBiosHandlePtr handle, + AtomBiosRequestID unused, AtomBiosArgPtr data); static AtomBiosResult rhdAtomLvdsInfoQuery(atomBiosHandlePtr handle, AtomBiosRequestID func, AtomBiosArgPtr data); static AtomBiosResult rhdAtomGPIOI2CInfoQuery(atomBiosHandlePtr handle, @@ -170,6 +172,8 @@ struct atomBIOSRequests { "DAC2_CRTC2 Mux Register Index", MSG_FORMAT_HEX}, {ATOM_DAC2_CRTC2_MUX_REG_INFO,rhdAtomCompassionateDataQuery, "DAC2_CRTC2 Mux Register Info", MSG_FORMAT_HEX}, + {ATOMBIOS_GET_CV_MODES, rhdAtomCVGetTimings, + "AtomBIOS Get CV Mode", MSG_FORMAT_NONE}, {FUNC_END, NULL, NULL, MSG_FORMAT_NONE} }; @@ -713,7 +717,7 @@ rhdAtomTmdsInfoQuery(atomBiosHandlePtr handle, } static DisplayModePtr -rhdAtomLvdsTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd) +rhdAtomDTDTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd) { DisplayModePtr mode; #define NAME_LEN 16 @@ -721,6 +725,9 @@ rhdAtomLvdsTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd) //RHDFUNC(handle); + if (!dtd->usHActive || !dtd->usVActive) + return NULL; + if (!(mode = (DisplayModePtr)xcalloc(1,sizeof(DisplayModeRec)))) return NULL; @@ -737,23 +744,34 @@ rhdAtomLvdsTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd) mode->CrtcVSyncStart = mode->VSyncStart = dtd->usVActive + dtd->usVSyncOffset; mode->CrtcVSyncEnd = mode->VSyncEnd = mode->VSyncStart + dtd->usVSyncWidth; - mode->SynthClock = mode->Clock = dtd->usPixClk * 10; + mode->SynthClock = mode->Clock = dtd->usPixClk * 10; mode->HSync = ((float) mode->Clock) / ((float)mode->HTotal); mode->VRefresh = (1000.0 * ((float) mode->Clock)) / ((float)(((float)mode->HTotal) * ((float)mode->VTotal))); + if (dtd->susModeMiscInfo.sbfAccess.CompositeSync) + mode->Flags |= V_CSYNC; + if (dtd->susModeMiscInfo.sbfAccess.Interlace) + mode->Flags |= V_INTERLACE; + if (dtd->susModeMiscInfo.sbfAccess.DoubleClock) + mode->Flags |= V_DBLSCAN; + if (dtd->susModeMiscInfo.sbfAccess.VSyncPolarity) + mode->Flags |= V_NVSYNC; + if (dtd->susModeMiscInfo.sbfAccess.HSyncPolarity) + mode->Flags |= V_NHSYNC; + snprintf(name, NAME_LEN, "%dx%d", mode->HDisplay, mode->VDisplay); mode->name = xstrdup(name); - RHDDebug(handle->scrnIndex,"%s: LVDS Modeline: %s " - "%2.d %i (%i) %i %i (%i) %i %i (%i) %i %i (%i) %i\n", - __func__, mode->name, mode->Clock, - mode->HDisplay, mode->CrtcHBlankStart, mode->HSyncStart, mode->CrtcHSyncEnd, - mode->CrtcHBlankEnd, mode->HTotal, - mode->VDisplay, mode->CrtcVBlankStart, mode->VSyncStart, mode->VSyncEnd, - mode->CrtcVBlankEnd, mode->VTotal); + ErrorF("DTD Modeline: %s " + "%2.d %i (%i) %i %i (%i) %i %i (%i) %i %i (%i) %i flags: 0x%x\n", + mode->name, mode->Clock, + mode->HDisplay, mode->CrtcHBlankStart, mode->HSyncStart, mode->CrtcHSyncEnd, + mode->CrtcHBlankEnd, mode->HTotal, + mode->VDisplay, mode->CrtcVBlankStart, mode->VSyncStart, mode->VSyncEnd, + mode->CrtcVBlankEnd, mode->VTotal, mode->Flags); return mode; } @@ -825,8 +843,98 @@ rhdAtomLvdsDDC(atomBiosHandlePtr handle, CARD32 offset, unsigned char *record) } static AtomBiosResult +rhdAtomCVGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func, + AtomBiosArgPtr data) +{ + atomDataTablesPtr atomDataPtr; + CARD8 crev, frev; + DisplayModePtr last = NULL; + DisplayModePtr new = NULL; + DisplayModePtr first = NULL; + int i; + + data->modes = NULL; + + atomDataPtr = handle->atomDataPtr; + + if (!rhdAtomGetTableRevisionAndSize( + (ATOM_COMMON_TABLE_HEADER *)(atomDataPtr->ComponentVideoInfo.base), + &frev,&crev,NULL)) { + return ATOM_FAILED; + } + + switch (frev) { + + case 1: + switch (func) { + case ATOMBIOS_GET_CV_MODES: + for (i = 0; i < MAX_SUPPORTED_CV_STANDARDS; i++) { + new = rhdAtomDTDTimings(handle, + &atomDataPtr->ComponentVideoInfo + .ComponentVideoInfo->aModeTimings[i]); + + if (!new) + continue; + + new->type |= M_T_DRIVER; + new->next = NULL; + new->prev = last; + + if (last) last->next = new; + last = new; + if (!first) first = new; + } + if (last) { + last->next = NULL; //first; + first->prev = NULL; //last; + data->modes = first; + } + if (data->modes) + return ATOM_SUCCESS; + default: + return ATOM_FAILED; + } + case 2: + switch (func) { + case ATOMBIOS_GET_CV_MODES: + for (i = 0; i < MAX_SUPPORTED_CV_STANDARDS; i++) { + new = rhdAtomDTDTimings(handle, + &atomDataPtr->ComponentVideoInfo + .ComponentVideoInfo_v21->aModeTimings[i]); + + if (!new) + continue; + + new->type |= M_T_DRIVER; + new->next = NULL; + new->prev = last; + + if (last) last->next = new; + last = new; + if (!first) first = new; + + } + if (last) { + last->next = NULL; //first; + first->prev = NULL; //last; + data->modes = first; + } + if (data->modes) + return ATOM_SUCCESS; + return ATOM_FAILED; + + default: + return ATOM_FAILED; + } + default: + return ATOM_NOT_IMPLEMENTED; + } +/*NOTREACHED*/ +} + +static AtomBiosResult rhdAtomLvdsGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func, - AtomBiosArgPtr data) + AtomBiosArgPtr data) { atomDataTablesPtr atomDataPtr; CARD8 crev, frev; @@ -847,10 +955,10 @@ rhdAtomLvdsGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func, case 1: switch (func) { case ATOMBIOS_GET_PANEL_MODE: - data->mode = rhdAtomLvdsTimings(handle, - &atomDataPtr->LVDS_Info - .LVDS_Info->sLCDTiming); - if (data->mode) + data->modes = rhdAtomDTDTimings(handle, + &atomDataPtr->LVDS_Info + .LVDS_Info->sLCDTiming); + if (data->modes) return ATOM_SUCCESS; default: return ATOM_FAILED; @@ -858,10 +966,10 @@ rhdAtomLvdsGetTimings(atomBiosHandlePtr handle, AtomBiosRequestID func, case 2: switch (func) { case ATOMBIOS_GET_PANEL_MODE: - data->mode = rhdAtomLvdsTimings(handle, - &atomDataPtr->LVDS_Info - .LVDS_Info_v12->sLCDTiming); - if (data->mode) + data->modes = rhdAtomDTDTimings(handle, + &atomDataPtr->LVDS_Info + .LVDS_Info_v12->sLCDTiming); + if (data->modes) return ATOM_SUCCESS; return ATOM_FAILED; @@ -1589,11 +1697,13 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) continue; } +#if 1 if (i == ATOM_DEVICE_CV_INDEX) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Skipping Component Video\n"); info->BiosConnector[i].valid = FALSE; continue; } +#endif info->BiosConnector[i].valid = TRUE; info->BiosConnector[i].output_id = ci.sucI2cId.sbfAccess.bfI2C_LineMux; diff --git a/src/radeon_atombios.h b/src/radeon_atombios.h index d4dc1e4c..4b15ec1c 100644 --- a/src/radeon_atombios.h +++ b/src/radeon_atombios.h @@ -75,6 +75,7 @@ typedef enum _AtomBiosRequestID { ATOM_DAC2_CRTC2_FORCE, ATOM_DAC2_CRTC2_MUX_REG_IND, ATOM_DAC2_CRTC2_MUX_REG_INFO, + ATOMBIOS_GET_CV_MODES, FUNC_END } AtomBiosRequestID; @@ -101,7 +102,7 @@ typedef union AtomBiosArg struct rhdConnectorInfo *connectorInfo; unsigned char* EDIDBlock; atomBiosHandlePtr atomhandle; - DisplayModePtr mode; + DisplayModePtr modes; AtomExecRec exec; AtomFbRec fb; } AtomBiosArgRec, *AtomBiosArgPtr; diff --git a/src/radeon_modes.c b/src/radeon_modes.c index c9e99b8e..e7759936 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -47,8 +47,8 @@ #include "radeon.h" #include "radeon_reg.h" #include "radeon_macros.h" - #include "radeon_version.h" +#include "radeon_atombios.h" #include "xf86Modes.h" /* DDC support */ @@ -211,13 +211,23 @@ DisplayModePtr RADEONProbeOutputModes(xf86OutputPtr output) { RADEONOutputPrivatePtr radeon_output = output->driver_private; + ScrnInfoPtr pScrn = output->scrn; + RADEONInfoPtr info = RADEONPTR(pScrn); DisplayModePtr modes = NULL; + AtomBiosArgRec atomBiosArg; + AtomBiosResult atomBiosResult; ErrorF("in RADEONProbeOutputModes\n"); if (output->status == XF86OutputStatusConnected) { if (OUTPUT_IS_TV) { modes = RADEONTVModes(output); + } else if (radeon_output->type == OUTPUT_CV) { + atomBiosResult = RHDAtomBiosFunc(pScrn->scrnIndex, info->atomBIOS, + ATOMBIOS_GET_CV_MODES, &atomBiosArg); + if (atomBiosResult == ATOM_SUCCESS) { + modes = atomBiosArg.modes; + } } else { if (output->MonInfo) modes = xf86OutputGetEDIDModes (output); diff --git a/src/radeon_output.c b/src/radeon_output.c index 847e69a3..ecbc7b19 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -48,17 +48,20 @@ #include "radeon_tv.h" #include "radeon_atombios.h" -const char *MonTypeName[7] = { +const char *MonTypeName[10] = { "AUTO", "NONE", "CRT", "LVDS", "TMDS", "CTV", - "STV" + "STV", + "CV", + "HDMI", + "DP" }; -const RADEONMonitorType MonTypeID[7] = { +const RADEONMonitorType MonTypeID[10] = { MT_UNKNOWN, /* this is just a dummy value for AUTO DETECTION */ MT_NONE, /* NONE -> NONE */ MT_CRT, /* CRT -> CRT */ @@ -66,6 +69,9 @@ const RADEONMonitorType MonTypeID[7] = { MT_DFP, /* DFPs are driven via TMDS */ MT_CTV, /* CTV -> CTV */ MT_STV, /* STV -> STV */ + MT_CV, + MT_HDMI, + MT_DP }; const char *TMDSTypeName[4] = { @@ -82,7 +88,7 @@ const char *DACTypeName[4] = { "None" }; -const char *ConnectorTypeName[15] = { +const char *ConnectorTypeName[16] = { "None", "VGA", "DVI-I", @@ -95,6 +101,8 @@ const char *ConnectorTypeName[15] = { "SCART", "HDMI-A", "HDMI-B", + "Unsupported", + "Unsupported", "DIN", "DisplayPort", "Unsupported" @@ -1183,6 +1191,11 @@ void RADEONSetOutputType(ScrnInfoPtr pScrn, RADEONOutputPrivatePtr radeon_output case CONNECTOR_DVI_A: output = OUTPUT_DVI_A; break; case CONNECTOR_DIN: + if (radeon_output->devices & ATOM_DEVICE_CV_SUPPORT) + output = OUTPUT_CV; + else if (radeon_output->devices & ATOM_DEVICE_TV1_SUPPORT) + output = OUTPUT_STV; + break; case CONNECTOR_STV: output = OUTPUT_STV; break; case CONNECTOR_CTV: @@ -1704,7 +1717,7 @@ void RADEONInitConnector(xf86OutputPtr output) if (OUTPUT_IS_DVI) { I2CBusPtr pDVOBus; radeon_output->rmx_type = RMX_OFF; - if (radeon_output->TMDSType == TMDS_EXT) { + if ((!IS_AVIVO_VARIANT) && radeon_output->TMDSType == TMDS_EXT) { #if defined(__powerpc__) radeon_output->dvo_i2c_reg = RADEON_GPIO_MONID; radeon_output->dvo_i2c_slave_addr = 0x70; diff --git a/src/radeon_probe.h b/src/radeon_probe.h index a25d6350..2ee5428f 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -81,6 +81,8 @@ typedef enum CONNECTOR_SCART, CONNECTOR_HDMI_TYPE_A, CONNECTOR_HDMI_TYPE_B, + CONNECTOR_0XC, + CONNECTOR_0XD, CONNECTOR_DIN, CONNECTOR_DISPLAY_PORT, CONNECTOR_UNSUPPORTED |