diff options
author | Alex Deucher <alex@cube.(none)> | 2008-03-11 14:10:31 -0400 |
---|---|---|
committer | Alex Deucher <alex@cube.(none)> | 2008-03-11 14:10:31 -0400 |
commit | fbded88a2925f9f049936dad0736721e7b84a6ee (patch) | |
tree | 90c009a88067aa6e723332aed40c1685f4ef3b53 | |
parent | 3263f6e4a410281d620c288a92bb4521f7b6fc06 (diff) |
ATOM: remove some cruft
-rw-r--r-- | src/radeon_atombios.c | 683 |
1 files changed, 0 insertions, 683 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index 4494775a..bb15e875 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1864,689 +1864,6 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) return TRUE; } -#if 0 -#define RHD_CONNECTORS_MAX 4 -#define MAX_OUTPUTS_PER_CONNECTOR 2 - -#define Limit(n,max,name) ((n >= max) ? ( \ - xf86DrvMsg(handle->scrnIndex,X_ERROR,"%s: %s %i exceeds maximum %i\n", \ - __func__,name,n,max), TRUE) : FALSE) - -static const struct _rhd_connector_objs -{ - char *name; - RADEONConnectorTypeATOM con; -} rhd_connector_objs[] = { - { "NONE", CONNECTOR_NONE_ATOM }, - { "SINGLE_LINK_DVI_I", CONNECTOR_DVI_I_ATOM }, - { "DUAL_LINK_DVI_I", CONNECTOR_DVI_I_ATOM }, - { "SINGLE_LINK_DVI_D", CONNECTOR_DVI_D_ATOM }, - { "DUAL_LINK_DVI_D", CONNECTOR_DVI_D_ATOM }, - { "VGA", CONNECTOR_VGA_ATOM }, - { "COMPOSITE", CONNECTOR_CTV_ATOM }, - { "SVIDEO", CONNECTOR_STV_ATOM }, - { "D_CONNECTOR", CONNECTOR_NONE_ATOM }, - { "9PIN_DIN", CONNECTOR_NONE_ATOM }, - { "SCART", CONNECTOR_SCART_ATOM }, - { "HDMI_TYPE_A", CONNECTOR_HDMI_TYPE_A_ATOM }, - { "HDMI_TYPE_B", CONNECTOR_HDMI_TYPE_B_ATOM }, - { "HDMI_TYPE_B", CONNECTOR_HDMI_TYPE_B_ATOM }, - { "LVDS", CONNECTOR_LVDS_ATOM }, - { "7PIN_DIN", CONNECTOR_STV_ATOM }, - { "PCIE_CONNECTOR", CONNECTOR_NONE_ATOM }, - { "CROSSFIRE", CONNECTOR_NONE_ATOM }, - { "HARDCODE_DVI", CONNECTOR_NONE_ATOM }, - { "DISPLAYPORT", CONNECTOR_DISPLAY_PORT_ATOM } -}; -static const int n_rhd_connector_objs = sizeof (rhd_connector_objs) / sizeof(struct _rhd_connector_objs); - -static const struct _rhd_encoders -{ - char *name; - RADEONOutputTypeATOM ot; -} rhd_encoders[] = { - { "NONE", OUTPUT_NONE_ATOM }, - { "INTERNAL_LVDS", OUTPUT_LVDS_ATOM }, - { "INTERNAL_TMDS1", OUTPUT_TMDSA_ATOM }, - { "INTERNAL_TMDS2", OUTPUT_TMDSB_ATOM }, - { "INTERNAL_DAC1", OUTPUT_DACA_ATOM }, - { "INTERNAL_DAC2", OUTPUT_DACB_ATOM }, - { "INTERNAL_SDVOA", OUTPUT_NONE_ATOM }, - { "INTERNAL_SDVOB", OUTPUT_NONE_ATOM }, - { "SI170B", OUTPUT_NONE_ATOM }, - { "CH7303", OUTPUT_NONE_ATOM }, - { "CH7301", OUTPUT_NONE_ATOM }, - { "INTERNAL_DVO1", OUTPUT_NONE_ATOM }, - { "EXTERNAL_SDVOA", OUTPUT_NONE_ATOM }, - { "EXTERNAL_SDVOB", OUTPUT_NONE_ATOM }, - { "TITFP513", OUTPUT_NONE_ATOM }, - { "INTERNAL_LVTM1", OUTPUT_LVTMA_ATOM }, - { "VT1623", OUTPUT_NONE_ATOM }, - { "HDMI_SI1930", OUTPUT_NONE_ATOM }, - { "HDMI_INTERNAL", OUTPUT_NONE_ATOM }, - { "INTERNAL_KLDSCP_TMDS1", OUTPUT_TMDSA_ATOM }, - { "INTERNAL_KLSCP_DVO1", OUTPUT_NONE_ATOM }, - { "INTERNAL_KLDSCP_DAC1", OUTPUT_DACA_ATOM }, - { "INTERNAL_KLDSCP_DAC2", OUTPUT_DACB_ATOM }, - { "SI178", OUTPUT_NONE_ATOM }, - { "MVPU_FPGA", OUTPUT_NONE_ATOM }, - { "INTERNAL_DDI", OUTPUT_NONE_ATOM }, - { "VT1625", OUTPUT_NONE_ATOM }, - { "HDMI_SI1932", OUTPUT_NONE_ATOM }, - { "AN9801", OUTPUT_NONE_ATOM }, - { "DP501", OUTPUT_NONE_ATOM }, -}; -static const int n_rhd_encoders = sizeof (rhd_encoders) / sizeof(struct _rhd_encoders); - -static const struct _rhd_connectors -{ - char *name; - RADEONConnectorTypeATOM con; - Bool dual; -} rhd_connectors[] = { - {"NONE", CONNECTOR_NONE_ATOM, FALSE }, - {"VGA", CONNECTOR_VGA_ATOM, FALSE }, - {"DVI-I", CONNECTOR_DVI_I_ATOM, TRUE }, - {"DVI-D", CONNECTOR_DVI_D_ATOM, FALSE }, - {"DVI-A", CONNECTOR_DVI_A_ATOM, FALSE }, - {"SVIDEO", CONNECTOR_STV_ATOM, FALSE }, - {"COMPOSITE", CONNECTOR_CTV_ATOM, FALSE }, - {"PANEL", CONNECTOR_LVDS_ATOM, FALSE }, - {"DIGITAL_LINK", CONNECTOR_DIGITAL_ATOM, FALSE }, - {"SCART", CONNECTOR_SCART_ATOM, FALSE }, - {"HDMI Type A", CONNECTOR_HDMI_TYPE_A_ATOM, FALSE }, - {"HDMI Type B", CONNECTOR_HDMI_TYPE_B_ATOM, FALSE }, - {"UNKNOWN", CONNECTOR_NONE_ATOM, FALSE }, - {"UNKNOWN", CONNECTOR_NONE_ATOM, FALSE }, - {"DVI+DIN", CONNECTOR_NONE_ATOM, FALSE } -}; -static const int n_rhd_connectors = sizeof(rhd_connectors) / sizeof(struct _rhd_connectors); - -static const struct _rhd_devices -{ - char *name; - RADEONOutputTypeATOM ot; -} rhd_devices[] = { - {" CRT1", OUTPUT_NONE_ATOM }, - {" LCD1", OUTPUT_LVTMA_ATOM }, - {" TV1", OUTPUT_NONE_ATOM }, - {" DFP1", OUTPUT_TMDSA_ATOM }, - {" CRT2", OUTPUT_NONE_ATOM }, - {" LCD2", OUTPUT_LVTMA_ATOM }, - {" TV2", OUTPUT_NONE_ATOM }, - {" DFP2", OUTPUT_LVTMA_ATOM }, - {" CV", OUTPUT_NONE_ATOM }, - {" DFP3", OUTPUT_LVTMA_ATOM } -}; -static const int n_rhd_devices = sizeof(rhd_devices) / sizeof(struct _rhd_devices); - -static const rhdDDC hwddc[] = { RHD_DDC_0, RHD_DDC_1, RHD_DDC_2, RHD_DDC_3 }; -static const int n_hwddc = sizeof(hwddc) / sizeof(rhdDDC); - -static const rhdOutputType acc_dac[] = { OUTPUT_NONE_ATOM, - OUTPUT_DACA_ATOM, - OUTPUT_DACB_ATOM, - OUTPUT_DAC_EXTERNAL_ATOM }; -static const int n_acc_dac = sizeof(acc_dac) / sizeof (rhdOutputType); - -/* - * - */ -static Bool -rhdAtomInterpretObjectID(atomBiosHandlePtr handle, - CARD16 id, CARD8 *obj_type, CARD8 *obj_id, - CARD8 *num, char **name) -{ - *obj_id = (id & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; - *num = (id & ENUM_ID_MASK) >> ENUM_ID_SHIFT; - *obj_type = (id & OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; - - *name = NULL; - - switch (*obj_type) { - case GRAPH_OBJECT_TYPE_CONNECTOR: - if (!Limit(*obj_id, n_rhd_connector_objs, "obj_id")) - *name = rhd_connector_objs[*obj_id].name; - break; - case GRAPH_OBJECT_TYPE_ENCODER: - if (!Limit(*obj_id, n_rhd_encoders, "obj_id")) - *name = rhd_encoders[*obj_id].name; - break; - default: - break; - } - return TRUE; -} - -/* - * - */ -static void -rhdAtomDDCFromI2CRecord(atomBiosHandlePtr handle, - ATOM_I2C_RECORD *Record, rhdDDC *DDC) -{ - RHDDebug(handle->scrnIndex, - " %s: I2C Record: %s[%x] EngineID: %x I2CAddr: %x\n", - __func__, - Record->sucI2cId.bfHW_Capable ? "HW_Line" : "GPIO_ID", - Record->sucI2cId.bfI2C_LineMux, - Record->sucI2cId.bfHW_EngineID, - Record->ucI2CAddr); - - if (!*(unsigned char *)&(Record->sucI2cId)) - *DDC = RHD_DDC_NONE; - else { - - if (Record->ucI2CAddr != 0) - return; - - if (Record->sucI2cId.bfHW_Capable) { - - *DDC = (rhdDDC)Record->sucI2cId.bfI2C_LineMux; - if (*DDC >= RHD_DDC_MAX) - *DDC = RHD_DDC_NONE; - - } else { - *DDC = RHD_DDC_GPIO; - /* add GPIO pin parsing */ - } - } -} - -/* - * - */ -static void -rhdAtomParseGPIOLutForHPD(atomBiosHandlePtr handle, - CARD8 pinID, rhdHPD *HPD) -{ - atomDataTablesPtr atomDataPtr; - ATOM_GPIO_PIN_LUT *gpio_pin_lut; - unsigned short size; - int i = 0; - - //RHDFUNC(handle); - - atomDataPtr = handle->atomDataPtr; - - *HPD = RHD_HPD_NONE; - - if (!rhdAtomGetTableRevisionAndSize( - &atomDataPtr->GPIO_Pin_LUT->sHeader, NULL, NULL, &size)) { - xf86DrvMsg(handle->scrnIndex, X_ERROR, - "%s: No valid GPIO pin LUT in AtomBIOS\n",__func__); - return; - } - gpio_pin_lut = atomDataPtr->GPIO_Pin_LUT; - - while (1) { - if (gpio_pin_lut->asGPIO_Pin[i].ucGPIO_ID == pinID) { - - if ((sizeof(ATOM_COMMON_TABLE_HEADER) - + (i * sizeof(ATOM_GPIO_PIN_ASSIGNMENT))) > size) - return; - - RHDDebug(handle->scrnIndex, - " %s: GPIO PinID: %i Index: %x Shift: %i\n", - __func__, - pinID, - gpio_pin_lut->asGPIO_Pin[i].usGpioPin_AIndex, - gpio_pin_lut->asGPIO_Pin[i].ucGpioPinBitShift); - - /* grr... map backwards: register indices -> line numbers */ - if (gpio_pin_lut->asGPIO_Pin[i].usGpioPin_AIndex - == (DC_GPIO_HPD_A >> 2)) { - switch (gpio_pin_lut->asGPIO_Pin[i].ucGpioPinBitShift) { - case 0: - *HPD = RHD_HPD_0; - return; - case 8: - *HPD = RHD_HPD_1; - return; - case 16: - *HPD = RHD_HPD_2; - return; - } - } - } - i++; - } -} - -/* - * - */ -static void -rhdAtomHPDFromRecord(atomBiosHandlePtr handle, - ATOM_HPD_INT_RECORD *Record, rhdHPD *HPD) -{ - RHDDebug(handle->scrnIndex, - " %s: HPD Record: GPIO ID: %x Plugged_PinState: %x\n", - __func__, - Record->ucHPDIntGPIOID, - Record->ucPluggged_PinState); - rhdAtomParseGPIOLutForHPD(handle, Record->ucHPDIntGPIOID, HPD); -} - -/* - * - */ -static char * -rhdAtomDeviceTagsFromRecord(atomBiosHandlePtr handle, - ATOM_CONNECTOR_DEVICE_TAG_RECORD *Record) -{ - int i, j, k; - char *devices; - - //RHDFUNC(handle); - - RHDDebug(handle->scrnIndex," NumberOfDevice: %i\n", - Record->ucNumberOfDevice); - - if (!Record->ucNumberOfDevice) return NULL; - - devices = (char *)xcalloc(Record->ucNumberOfDevice * 4 + 1,1); - - for (i = 0; i < Record->ucNumberOfDevice; i++) { - k = 0; - j = Record->asDeviceTag[i].usDeviceID; - - while (!(j & 0x1)) { j >>= 1; k++; }; - - if (!Limit(k,n_rhd_devices,"usDeviceID")) - strcat(devices, rhd_devices[k].name); - } - - RHDDebug(handle->scrnIndex," Devices:%s\n",devices); - - return devices; -} - -/* - * - */ -static AtomBiosResult -rhdAtomConnectorInfoFromObjectHeader(atomBiosHandlePtr handle, - rhdConnectorInfoPtr *ptr) -{ - atomDataTablesPtr atomDataPtr; - CARD8 crev, frev; - ATOM_CONNECTOR_OBJECT_TABLE *con_obj; - rhdConnectorInfoPtr cp; - unsigned long object_header_end; - int ncon = 0; - int i,j; - unsigned short object_header_size; - - //RHDFUNC(handle); - - atomDataPtr = handle->atomDataPtr; - - if (!rhdAtomGetTableRevisionAndSize( - &atomDataPtr->Object_Header->sHeader, - &crev,&frev,&object_header_size)) { - return ATOM_NOT_IMPLEMENTED; - } - - if (crev < 2) /* don't bother with anything below rev 2 */ - return ATOM_NOT_IMPLEMENTED; - - if (!(cp = (rhdConnectorInfoPtr)xcalloc(sizeof(struct rhdConnectorInfo), - RHD_CONNECTORS_MAX))) - return ATOM_FAILED; - - object_header_end = - atomDataPtr->Object_Header->usConnectorObjectTableOffset - + object_header_size; - - RHDDebug(handle->scrnIndex,"ObjectTable - size: %u, BIOS - size: %u " - "TableOffset: %u object_header_end: %u\n", - object_header_size, handle->BIOSImageSize, - atomDataPtr->Object_Header->usConnectorObjectTableOffset, - object_header_end); - - if ((object_header_size > handle->BIOSImageSize) - || (atomDataPtr->Object_Header->usConnectorObjectTableOffset - > handle->BIOSImageSize) - || object_header_end > handle->BIOSImageSize) { - xf86DrvMsg(handle->scrnIndex, X_ERROR, - "%s: Object table information is bogus\n",__func__); - return ATOM_FAILED; - } - - if (((unsigned long)&atomDataPtr->Object_Header->sHeader - + object_header_end) > ((unsigned long)handle->BIOSBase - + handle->BIOSImageSize)) { - xf86DrvMsg(handle->scrnIndex, X_ERROR, - "%s: Object table extends beyond BIOS Image\n",__func__); - return ATOM_FAILED; - } - - con_obj = (ATOM_CONNECTOR_OBJECT_TABLE *) - ((char *)&atomDataPtr->Object_Header->sHeader + - atomDataPtr->Object_Header->usConnectorObjectTableOffset); - - for (i = 0; i < con_obj->ucNumberOfObjects; i++) { - ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *SrcDstTable; - ATOM_COMMON_RECORD_HEADER *Record; - int record_base; - CARD8 obj_type, obj_id, num; - char *name; - int nout = 0; - - rhdAtomInterpretObjectID(handle, con_obj->asObjects[i].usObjectID, - &obj_type, &obj_id, &num, &name); - - RHDDebug(handle->scrnIndex, "Object: ID: %x name: %s type: %x id: %x\n", - con_obj->asObjects[i].usObjectID, name ? name : "", - obj_type, obj_id); - - - if (obj_type != GRAPH_OBJECT_TYPE_CONNECTOR) - continue; - - SrcDstTable = (ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *) - ((char *)&atomDataPtr->Object_Header->sHeader - + con_obj->asObjects[i].usSrcDstTableOffset); - - if (con_obj->asObjects[i].usSrcDstTableOffset - + (SrcDstTable->ucNumberOfSrc - * sizeof(ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT)) - > handle->BIOSImageSize) { - xf86DrvMsg(handle->scrnIndex, X_ERROR, "%s: SrcDstTable[%i] extends " - "beyond Object_Header table\n",__func__,i); - continue; - } - - cp[ncon].Type = rhd_connector_objs[obj_id].con; - cp[ncon].Name = RhdAppendString(cp[ncon].Name,name); - - for (j = 0; j < SrcDstTable->ucNumberOfSrc; j++) { - CARD8 stype, sobj_id, snum; - char *sname; - - rhdAtomInterpretObjectID(handle, SrcDstTable->usSrcObjectID[j], - &stype, &sobj_id, &snum, &sname); - - RHDDebug(handle->scrnIndex, " * SrcObject: ID: %x name: %s\n", - SrcDstTable->usSrcObjectID[j], sname); - - cp[ncon].Output[nout] = rhd_encoders[sobj_id].ot; - if (++nout >= MAX_OUTPUTS_PER_CONNECTOR) - break; - } - - Record = (ATOM_COMMON_RECORD_HEADER *) - ((char *)&atomDataPtr->Object_Header->sHeader - + con_obj->asObjects[i].usRecordOffset); - - record_base = con_obj->asObjects[i].usRecordOffset; - - while (Record->ucRecordType > 0 - && Record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER ) { - char *taglist; - - if ((record_base += Record->ucRecordSize) - > object_header_size) { - xf86DrvMsg(handle->scrnIndex, X_ERROR, - "%s: Object Records extend beyond Object Table\n", - __func__); - break; - } - - RHDDebug(handle->scrnIndex, " - Record Type: %x\n", - Record->ucRecordType); - - switch (Record->ucRecordType) { - - case ATOM_I2C_RECORD_TYPE: - rhdAtomDDCFromI2CRecord(handle, - (ATOM_I2C_RECORD *)Record, - &cp[ncon].DDC); - break; - - case ATOM_HPD_INT_RECORD_TYPE: - rhdAtomHPDFromRecord(handle, - (ATOM_HPD_INT_RECORD *)Record, - &cp[ncon].HPD); - break; - - case ATOM_CONNECTOR_DEVICE_TAG_RECORD_TYPE: - taglist = rhdAtomDeviceTagsFromRecord(handle, - (ATOM_CONNECTOR_DEVICE_TAG_RECORD *)Record); - if (taglist) { - cp[ncon].Name = RhdAppendString(cp[ncon].Name,taglist); - xfree(taglist); - } - break; - - default: - break; - } - - Record = (ATOM_COMMON_RECORD_HEADER*) - ((char *)Record + Record->ucRecordSize); - - } - - if ((++ncon) == RHD_CONNECTORS_MAX) - break; - } - *ptr = cp; - - RhdPrintConnectorInfo(handle->scrnIndex, cp); - - return ATOM_SUCCESS; -} - -/* - * - */ -static AtomBiosResult -rhdAtomConnectorInfoFromSupportedDevices(atomBiosHandlePtr handle, - rhdConnectorInfoPtr *ptr) -{ - atomDataTablesPtr atomDataPtr; - CARD8 crev, frev; - rhdConnectorInfoPtr cp; - struct { - rhdOutputType ot; - rhdConnectorType con; - rhdDDC ddc; - rhdHPD hpd; - Bool dual; - char *name; - char *outputName; - } devices[ATOM_MAX_SUPPORTED_DEVICE]; - int ncon = 0; - int n; - - //RHDFUNC(handle); - - atomDataPtr = handle->atomDataPtr; - - if (!rhdAtomGetTableRevisionAndSize( - &(atomDataPtr->SupportedDevicesInfo.SupportedDevicesInfo->sHeader), - &crev,&frev,NULL)) { - return ATOM_NOT_IMPLEMENTED; - } - - if (!(cp = (rhdConnectorInfoPtr)xcalloc(RHD_CONNECTORS_MAX, - sizeof(struct rhdConnectorInfo)))) - return ATOM_FAILED; - - for (n = 0; n < ATOM_MAX_SUPPORTED_DEVICE; n++) { - ATOM_CONNECTOR_INFO_I2C ci - = atomDataPtr->SupportedDevicesInfo.SupportedDevicesInfo->asConnInfo[n]; - - devices[n].ot = OUTPUT_NONE_ATOM; - - if (!(atomDataPtr->SupportedDevicesInfo - .SupportedDevicesInfo->usDeviceSupport & (1 << n))) - continue; - - if (Limit(ci.sucConnectorInfo.sbfAccess.bfConnectorType, - n_rhd_connectors, "bfConnectorType")) - continue; - - devices[n].con - = rhd_connectors[ci.sucConnectorInfo.sbfAccess.bfConnectorType].con; - if (devices[n].con == RHD_CONNECTOR_NONE) - continue; - - devices[n].dual - = rhd_connectors[ci.sucConnectorInfo.sbfAccess.bfConnectorType].dual; - devices[n].name - = rhd_connectors[ci.sucConnectorInfo.sbfAccess.bfConnectorType].name; - - RHDDebug(handle->scrnIndex,"AtomBIOS Connector[%i]: %s Device:%s ",n, - rhd_connectors[ci.sucConnectorInfo - .sbfAccess.bfConnectorType].name, - rhd_devices[n].name); - - devices[n].outputName = rhd_devices[n].name; - - if (!Limit(ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC, - n_acc_dac, "bfAssociatedDAC")) { - if ((devices[n].ot - = acc_dac[ci.sucConnectorInfo.sbfAccess.bfAssociatedDAC]) - == OUTPUT_NONE_ATOM) { - devices[n].ot = rhd_devices[n].ot; - } - } else - devices[n].ot = OUTPUT_NONE_ATOM; - - RHDDebugCont("Output: %x ",devices[n].ot); - - if (ci.sucI2cId.sbfAccess.bfHW_Capable) { - - RHDDebugCont("HW DDC %i ", - ci.sucI2cId.sbfAccess.bfI2C_LineMux); - - if (Limit(ci.sucI2cId.sbfAccess.bfI2C_LineMux, - n_hwddc, "bfI2C_LineMux")) - devices[n].ddc = RHD_DDC_NONE; - else - devices[n].ddc = hwddc[ci.sucI2cId.sbfAccess.bfI2C_LineMux]; - - } else if (ci.sucI2cId.sbfAccess.bfI2C_LineMux) { - - RHDDebugCont("GPIO DDC "); - devices[n].ddc = RHD_DDC_GPIO; - - /* add support for GPIO line */ - } else { - - RHDDebugCont("NO DDC "); - devices[n].ddc = RHD_DDC_NONE; - - } - - if (crev > 1) { - ATOM_CONNECTOR_INC_SRC_BITMAP isb - = atomDataPtr->SupportedDevicesInfo - .SupportedDevicesInfo_HD->asIntSrcInfo[n]; - - switch (isb.ucIntSrcBitmap) { - case 0x4: - RHDDebugCont("HPD 0\n"); - devices[n].hpd = RHD_HPD_0; - break; - case 0xa: - RHDDebugCont("HPD 1\n"); - devices[n].hpd = RHD_HPD_1; - break; - default: - RHDDebugCont("NO HPD\n"); - devices[n].hpd = RHD_HPD_NONE; - break; - } - } else { - RHDDebugCont("NO HPD\n"); - devices[n].hpd = RHD_HPD_NONE; - } - } - /* sort devices for connectors */ - for (n = 0; n < ATOM_MAX_SUPPORTED_DEVICE; n++) { - int i; - - if (devices[n].ot == OUTPUT_NONE_ATOM) - continue; - if (devices[n].con == CONNECTOR_NONE_ATOM) - continue; - - cp[ncon].DDC = devices[n].ddc; - cp[ncon].HPD = devices[n].hpd; - cp[ncon].Output[0] = devices[n].ot; - cp[ncon].Output[1] = OUTPUT_NONE_ATOM; - cp[ncon].Type = devices[n].con; - cp[ncon].Name = xf86strdup(devices[n].name); - cp[ncon].Name = RhdAppendString(cp[ncon].Name, devices[n].outputName); - - if (devices[n].dual) { - if (devices[n].ddc == RHD_DDC_NONE) - xf86DrvMsg(handle->scrnIndex, X_ERROR, - "No DDC channel for device %s found." - " Cannot find matching device.\n",devices[n].name); - else { - for (i = n + 1; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { - - if (!devices[i].dual) - continue; - - if (devices[n].ddc != devices[i].ddc) - continue; - - if (((devices[n].ot == OUTPUT_DACA_ATOM - || devices[n].ot == OUTPUT_DACB_ATOM) - && (devices[i].ot == OUTPUT_LVTMA_ATOM - || devices[i].ot == OUTPUT_TMDSA_ATOM)) - || ((devices[i].ot == OUTPUT_DACA_ATOM - || devices[i].ot == OUTPUT_DACB_ATOM) - && (devices[n].ot == OUTPUT_LVTMA_ATOM - || devices[n].ot == OUTPUT_TMDSA_ATOM))) { - - cp[ncon].Output[1] = devices[i].ot; - - if (cp[ncon].HPD == RHD_HPD_NONE) - cp[ncon].HPD = devices[i].hpd; - - cp[ncon].Name = RhdAppendString(cp[ncon].Name, - devices[i].outputName); - devices[i].ot = OUTPUT_NONE_ATOM; /* zero the device */ - } - } - } - } - - if ((++ncon) == RHD_CONNECTORS_MAX) - break; - } - *ptr = cp; - - RhdPrintConnectorInfo(handle->scrnIndex, cp); - - return ATOM_SUCCESS; -} - -/* - * - */ -static AtomBiosResult -rhdAtomConnectorInfo(atomBiosHandlePtr handle, - AtomBiosRequestID unused, AtomBiosArgPtr data) -{ - data->connectorInfo = NULL; - - if (rhdAtomConnectorInfoFromObjectHeader(handle,&data->connectorInfo) - == ATOM_SUCCESS) - return ATOM_SUCCESS; - else - return rhdAtomConnectorInfoFromSupportedDevices(handle, - &data->connectorInfo); -} -#endif - # ifdef ATOM_BIOS_PARSER static AtomBiosResult rhdAtomExec (atomBiosHandlePtr handle, |