Lines Matching defs:dcb
915 * The TMDS table is typically found just before the DCB table, with a
928 * "or" from the DCB.
1107 * Make sure that 0x36 is blank and can't be mistaken for a DCB
1256 u8 *dcb = NULL;
1259 dcb = ROMPTR(dev, drm->vbios.data[0x36]);
1260 if (!dcb) {
1261 NV_WARN(drm, "No DCB data found in VBIOS\n");
1265 if (dcb[0] >= 0x42) {
1266 NV_WARN(drm, "DCB version 0x%02x unknown\n", dcb[0]);
1269 if (dcb[0] >= 0x30) {
1270 if (ROM32(dcb[6]) == 0x4edcbdcb)
1271 return dcb;
1273 if (dcb[0] >= 0x20) {
1274 if (ROM32(dcb[4]) == 0x4edcbdcb)
1275 return dcb;
1277 if (dcb[0] >= 0x15) {
1278 if (!memcmp(&dcb[-7], "DEV_REC", 7))
1279 return dcb;
1298 NV_WARN(drm, "No useful DCB data in VBIOS\n");
1302 NV_WARN(drm, "DCB header validation failed\n");
1309 u8 *dcb = olddcb_table(dev);
1310 if (dcb && dcb[0] >= 0x30) {
1311 if (idx < dcb[2])
1312 return dcb + dcb[1] + (idx * dcb[3]);
1314 if (dcb && dcb[0] >= 0x20) {
1315 u8 *i2c = ROMPTR(dev, dcb[2]);
1316 u8 *ent = dcb + 8 + (idx * 8);
1320 if (dcb && dcb[0] >= 0x15) {
1321 u8 *i2c = ROMPTR(dev, dcb[2]);
1322 u8 *ent = dcb + 4 + (idx * 10);
1338 break; /* seen on an NV11 with DCB v1.5 */
1340 break; /* seen on an NV17 with DCB v2.0 */
1358 u8 *dcb = olddcb_table(dev);
1359 if (dcb && dcb[0] >= 0x30 && dcb[1] >= 0x16) {
1360 u8 *conntab = ROMPTR(dev, dcb[0x14]);
1376 static struct dcb_output *new_dcb_entry(struct dcb_table *dcb)
1378 struct dcb_output *entry = &dcb->entry[dcb->entries];
1381 entry->index = dcb->entries++;
1386 static void fabricate_dcb_output(struct dcb_table *dcb, int type, int i2c,
1389 struct dcb_output *entry = new_dcb_entry(dcb);
1400 parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb,
1420 entry->crtconf.maxfreq = (dcb->version < 0x30) ?
1429 if (dcb->version < 0x22) {
1433 * straps when it does, so assume all DCB 2.0 laptops
1457 if (dcb->version >= 0x40)
1467 if (dcb->version >= 0x30)
1508 if (dcb->version >= 0x40) {
1513 else if (dcb->version >= 0x30)
1515 else if (dcb->version >= 0x22)
1520 dcb->entries--;
1526 if (dcb->version < 0x40) {
1536 /* unsure what DCB version introduces this, 3.0? */
1547 parse_dcb15_entry(struct drm_device *dev, struct dcb_table *dcb,
1570 NV_ERROR(drm, "Unknown DCB type %d\n", conn & 0x0000000f);
1601 void merge_like_dcb_entries(struct drm_device *dev, struct dcb_table *dcb)
1604 * DCB v2.0 lists each output combination separately.
1612 for (i = 0; i < dcb->entries; i++) {
1613 struct dcb_output *ient = &dcb->entry[i];
1616 for (j = i + 1; j < dcb->entries; j++) {
1617 struct dcb_output *jent = &dcb->entry[j];
1627 NV_INFO(drm, "Merging DCB entries %d and %d\n",
1635 /* Compact entries merged into others out of dcb */
1636 for (i = 0; i < dcb->entries; i++) {
1637 if (dcb->entry[i].type == DCB_OUTPUT_MERGED)
1641 dcb->entry[newentries] = dcb->entry[i];
1642 dcb->entry[newentries].index = newentries;
1647 dcb->entries = newentries;
1654 struct dcb_table *dcb = &drm->vbios.dcb;
1657 * DCB entry 2: 02025312 00000010
1658 * DCB entry 3: 02026312 00000020
1675 * DCB reports an LVDS output that should be TMDS:
1676 * DCB entry 1: f2005014 ffffffff
1680 fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 1, 1, 1);
1760 struct dcb_table *dcb = &bios->dcb;
1766 fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS, 0, all_heads, 1);
1767 fabricate_dcb_output(dcb, DCB_OUTPUT_ANALOG, 1, all_heads, 2);
1773 fabricate_dcb_output(dcb, DCB_OUTPUT_ANALOG,
1777 fabricate_dcb_output(dcb, DCB_OUTPUT_TV,
1783 fabricate_dcb_output(dcb, DCB_OUTPUT_TMDS,
1792 struct dcb_table *dcb = &drm->vbios.dcb;
1793 u32 conf = (dcb->version >= 0x20) ? ROM32(outp[4]) : ROM32(outp[6]);
1798 struct dcb_output *entry = new_dcb_entry(dcb);
1800 NV_INFO(drm, "DCB outp %02d: %08x %08x\n", idx, conn, conf);
1802 if (dcb->version >= 0x20)
1803 ret = parse_dcb20_entry(dev, dcb, conn, conf, entry);
1805 ret = parse_dcb15_entry(dev, dcb, conn, conf, entry);
1824 struct dcb_table *dcbt = &bios->dcb;
1871 struct dcb_table *dcb = &bios->dcb;
1877 /* handle pre-DCB boards */
1886 NV_INFO(drm, "DCB version %d.%d\n", dcbt[0] >> 4, dcbt[0] & 0xf);
1888 dcb->version = dcbt[0];
1895 if (dcb->version < 0x21)
1896 merge_like_dcb_entries(dev, dcb);
1903 NV_INFO(drm, "DCB conn %02d: %04x\n",
1906 NV_INFO(drm, "DCB conn %02d: %08x\n",