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 |