Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 62702
Collapse All | Expand All

(-)radeon_bios.c (-11 / +64 lines)
Lines 198-210 Link Here
198
	    return FALSE;
198
	    return FALSE;
199
	}
199
	}
200
    } else {
200
    } else {
201
	/* Some laptops only have one connector (VGA) listed in the connector table, 
202
	 * we need to add LVDS in as a non-DDC display. 
203
	 * Note, we can't assume the listed VGA will be filled in PortInfo[0],
204
	 * when walking through connector table. connector_found has following meaning: 
205
	 * 0 -- nothing found, 
206
	 * 1 -- only PortInfo[0] filled, 
207
	 * 2 -- only PortInfo[1] filled,
208
	 * 3 -- both are filled.
209
	 */
210
	int connector_found = 0;
211
201
	if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x50))) {
212
	if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x50))) {
202
	    for (i = 1; i < 4; i++) {
213
	    for (i = 1; i < 4; i++) {
203
214
204
		if (!RADEON_BIOS8(tmp + i*2) && i > 1) break; /* end of table */
215
		if (!RADEON_BIOS8(tmp + i*2) && i > 1) break; /* end of table */
205
		
216
		
206
		tmp0 = RADEON_BIOS16(tmp + i*2);
217
		tmp0 = RADEON_BIOS16(tmp + i*2);
207
		if (((tmp0 >> 12) & 0x1f) == 0) continue; /* no connector */
218
		if (((tmp0 >> 12) & 0x0f) == 0) continue;     /* no connector */
219
		if (connector_found > 0) {
220
		    if (pRADEONEnt->PortInfo[tmp1].DDCType == ((tmp0 >> 8) & 0x0f))
221
			continue;                             /* same connector */
222
		}
208
223
209
		/* internal DDC_DVI port will get assigned to PortInfo[0], or if there is no DDC_DVI (like in some IGPs). */
224
		/* internal DDC_DVI port will get assigned to PortInfo[0], or if there is no DDC_DVI (like in some IGPs). */
210
		tmp1 = ((((tmp0 >> 8) & 0xf) == DDC_DVI) || (tmp1 == 1)) ? 0 : 1; /* determine port info index */
225
		tmp1 = ((((tmp0 >> 8) & 0xf) == DDC_DVI) || (tmp1 == 1)) ? 0 : 1; /* determine port info index */
Lines 222-230 Link Here
222
		    pRADEONEnt->PortInfo[tmp1].TMDSType == TMDS_INT)
237
		    pRADEONEnt->PortInfo[tmp1].TMDSType == TMDS_INT)
223
		    pRADEONEnt->PortInfo[tmp1].TMDSType = TMDS_UNKNOWN;
238
		    pRADEONEnt->PortInfo[tmp1].TMDSType = TMDS_UNKNOWN;
224
		
239
		
225
		xf86DrvMsg(0, X_INFO, "Connector%d: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
240
		connector_found += (tmp1 + 1);
226
			   tmp1, pRADEONEnt->PortInfo[tmp1].DDCType, pRADEONEnt->PortInfo[tmp1].DACType,
227
			   pRADEONEnt->PortInfo[tmp1].TMDSType, pRADEONEnt->PortInfo[tmp1].ConnectorType);
228
	    }
241
	    }
229
	} else {
242
	} else {
230
	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No Connector Info Table found!\n");
243
	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No Connector Info Table found!\n");
Lines 232-245 Link Here
232
	}
245
	}
233
246
234
	if (info->IsMobility) {
247
	if (info->IsMobility) {
235
	  if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x42))) {
248
	    /* For the cases where only one VGA connector is found, 
236
	    if ((tmp0 = RADEON_BIOS16(tmp + 0x15))) {
249
	       we assume LVDS is not listed in the connector table, 
237
	      if ((tmp1 = RADEON_BIOS8(tmp0+2) & 0x07)) {	    
250
	       add it in here as the first port.
238
		pRADEONEnt->PortInfo[0].DDCType	= tmp1;      
251
	    */
239
		xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "LCD DDC Info Table found!\n");
252
	    if ((connector_found < 3) && (pRADEONEnt->PortInfo[tmp1].ConnectorType == CONNECTOR_CRT)) {
240
	      }
253
		if (connector_found == 1) {
254
		    memcpy (&pRADEONEnt->PortInfo[1], &pRADEONEnt->PortInfo[0], 
255
			    sizeof (pRADEONEnt->PortInfo[0]));
256
		}
257
		pRADEONEnt->PortInfo[0].DACType = DAC_TVDAC;
258
		pRADEONEnt->PortInfo[0].TMDSType = TMDS_UNKNOWN;
259
		pRADEONEnt->PortInfo[0].DDCType = DDC_NONE_DETECTED;
260
		pRADEONEnt->PortInfo[0].ConnectorType = CONNECTOR_PROPRIETARY;
261
262
		xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS port is not in connector table, added in.\n");
263
		if (connector_found == 0) connector_found = 1;
264
		else connector_found = 3;
241
	    }
265
	    }
242
	  } 
266
267
	    if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x42))) {
268
	        if ((tmp0 = RADEON_BIOS16(tmp + 0x15))) {
269
		    if ((tmp1 = RADEON_BIOS8(tmp0+2) & 0x07)) {	    
270
			pRADEONEnt->PortInfo[0].DDCType	= tmp1;      
271
			xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "LCD DDC Info Table found!\n");
272
		    }
273
		}
274
	    } 
275
	} else if (connector_found == 2) {
276
	    memcpy (&pRADEONEnt->PortInfo[0], &pRADEONEnt->PortInfo[1], 
277
		    sizeof (pRADEONEnt->PortInfo[0]));	
278
	    pRADEONEnt->PortInfo[1].DACType = DAC_UNKNOWN;
279
	    pRADEONEnt->PortInfo[1].TMDSType = TMDS_UNKNOWN;
280
	    pRADEONEnt->PortInfo[1].DDCType = DDC_NONE_DETECTED;
281
	    pRADEONEnt->PortInfo[1].ConnectorType = CONNECTOR_NONE;
282
	    connector_found = 1;
283
	}
284
285
	if (connector_found == 0) {
286
	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No connector found in Connector Info Table.\n");
287
	} else {
288
	    xf86DrvMsg(0, X_INFO, "Connector0: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
289
		       pRADEONEnt->PortInfo[0].DDCType, pRADEONEnt->PortInfo[0].DACType,
290
		       pRADEONEnt->PortInfo[0].TMDSType, pRADEONEnt->PortInfo[0].ConnectorType);
291
	}
292
	if (connector_found == 3) {
293
	    xf86DrvMsg(0, X_INFO, "Connector1: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
294
		       pRADEONEnt->PortInfo[1].DDCType, pRADEONEnt->PortInfo[1].DACType,
295
		       pRADEONEnt->PortInfo[1].TMDSType, pRADEONEnt->PortInfo[1].ConnectorType);
243
	}
296
	}
244
297
245
#if 0
298
#if 0
(-)radeon_driver.c (-17 / +37 lines)
Lines 1726-1731 Link Here
1726
		break;
1726
		break;
1727
	    }
1727
	    }
1728
	}
1728
	}
1729
	for (i = 0; i < max_mt; i++) {
1730
	    if (strcmp(s2, MonTypeName[i]) == 0) {
1731
		pRADEONEnt->PortInfo[1].MonType = MonTypeID[i];
1732
		break;
1733
	    }
1734
	}
1735
1729
	if (i ==  max_mt)
1736
	if (i ==  max_mt)
1730
	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
1737
	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
1731
		       "Invalid Monitor type specified for 2nd port \n");
1738
		       "Invalid Monitor type specified for 2nd port \n");
Lines 1758-1789 Link Here
1758
1765
1759
    }
1766
    }
1760
1767
1761
    if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN || pRADEONEnt->PortInfo[1].MonType == MT_UNKNOWN) {
1768
    if(((!info->HasCRTC2) || info->IsDellServer)) {
1762
1769
	if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {
1763
	if(((!info->HasCRTC2) || info->IsDellServer) && 
1764
	   (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN)) {
1765
	    if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_DVI, &pRADEONEnt->PortInfo[0])));
1770
	    if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_DVI, &pRADEONEnt->PortInfo[0])));
1766
	    else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_VGA, &pRADEONEnt->PortInfo[0])));
1771
	    else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_VGA, &pRADEONEnt->PortInfo[0])));
1767
	    else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_CRT2, &pRADEONEnt->PortInfo[0])));
1772
	    else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_CRT2, &pRADEONEnt->PortInfo[0])));
1768
	    else
1773
	    else
1769
		pRADEONEnt->PortInfo[0].MonType = MT_CRT;
1774
		pRADEONEnt->PortInfo[0].MonType = MT_CRT;
1775
	}
1770
1776
1771
	    if (!ignore_edid) {
1777
	if (!ignore_edid) {
1772
		if (pRADEONEnt->PortInfo[0].MonInfo) {
1778
	    if (pRADEONEnt->PortInfo[0].MonInfo) {
1773
		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor1 EDID data ---------------------------\n");
1779
		xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor1 EDID data ---------------------------\n");
1774
		    xf86PrintEDID(pRADEONEnt->PortInfo[0].MonInfo );
1780
		xf86PrintEDID(pRADEONEnt->PortInfo[0].MonInfo );
1775
		    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of Monitor1 EDID data --------------------\n");
1781
		xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of Monitor1 EDID data --------------------\n");
1776
		}
1777
	    }
1782
	    }
1778
1779
	    pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
1780
	    pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
1781
	    pRADEONEnt->MonType2 = MT_NONE;
1782
	    pRADEONEnt->MonInfo2 = NULL;
1783
	    info->MergeType = MT_NONE;
1784
	    return TRUE;
1785
	}
1783
	}
1786
1784
1785
	pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
1786
	pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
1787
	pRADEONEnt->MonType2 = MT_NONE;
1788
	pRADEONEnt->MonInfo2 = NULL;
1789
	info->MergeType = MT_NONE;
1790
	info->DisplayType = pRADEONEnt->MonType1;
1791
1792
	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
1793
		   "Primary:\n Monitor   -- %s\n Connector -- %s\n DAC Type  -- %s\n TMDS Type -- %s\n DDC Type  -- %s\n",
1794
		   MonTypeName[pRADEONEnt->PortInfo[0].MonType+1],
1795
		   info->IsAtomBios ?
1796
		   ConnectorTypeNameATOM[pRADEONEnt->PortInfo[0].ConnectorType]:
1797
		   ConnectorTypeName[pRADEONEnt->PortInfo[0].ConnectorType],
1798
		   DACTypeName[pRADEONEnt->PortInfo[0].DACType+1],
1799
		   TMDSTypeName[pRADEONEnt->PortInfo[0].TMDSType+1],
1800
		   DDCTypeName[pRADEONEnt->PortInfo[0].DDCType]);
1801
1802
	return TRUE;
1803
    }
1804
1805
    if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN || pRADEONEnt->PortInfo[1].MonType == MT_UNKNOWN) {
1806
1787
	/* Primary Head (DVI or Laptop Int. panel)*/
1807
	/* Primary Head (DVI or Laptop Int. panel)*/
1788
	/* A ddc capable display connected on DVI port */
1808
	/* A ddc capable display connected on DVI port */
1789
	if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {
1809
	if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {

Return to bug 62702