瀏覽代碼

drm/nv50: fix connector table parsing for some cards

The connector table index in the DCB entry for each output type is an
index into the connector table, and does *not* necessarily match up
with what was previously called "index" in the connector table entries
themselves.

Not real sure what that index is exactly, renamed to "index2" as we
still use it to prevent creating multiple TV connectors.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 15 年之前
父節點
當前提交
d544d623c5

+ 2 - 1
drivers/gpu/drm/nouveau/nouveau_bios.c

@@ -5253,13 +5253,14 @@ parse_dcb_connector_table(struct nvbios *bios)
 	entry = conntab + conntab[1];
 	entry = conntab + conntab[1];
 	cte = &ct->entry[0];
 	cte = &ct->entry[0];
 	for (i = 0; i < conntab[2]; i++, entry += conntab[3], cte++) {
 	for (i = 0; i < conntab[2]; i++, entry += conntab[3], cte++) {
+		cte->index = i;
 		if (conntab[3] == 2)
 		if (conntab[3] == 2)
 			cte->entry = ROM16(entry[0]);
 			cte->entry = ROM16(entry[0]);
 		else
 		else
 			cte->entry = ROM32(entry[0]);
 			cte->entry = ROM32(entry[0]);
 
 
 		cte->type  = (cte->entry & 0x000000ff) >> 0;
 		cte->type  = (cte->entry & 0x000000ff) >> 0;
-		cte->index = (cte->entry & 0x00000f00) >> 8;
+		cte->index2 = (cte->entry & 0x00000f00) >> 8;
 		switch (cte->entry & 0x00033000) {
 		switch (cte->entry & 0x00033000) {
 		case 0x00001000:
 		case 0x00001000:
 			cte->gpio_tag = 0x07;
 			cte->gpio_tag = 0x07;

+ 2 - 1
drivers/gpu/drm/nouveau/nouveau_bios.h

@@ -72,9 +72,10 @@ enum dcb_connector_type {
 };
 };
 
 
 struct dcb_connector_table_entry {
 struct dcb_connector_table_entry {
+	uint8_t index;
 	uint32_t entry;
 	uint32_t entry;
 	enum dcb_connector_type type;
 	enum dcb_connector_type type;
-	uint8_t index;
+	uint8_t index2;
 	uint8_t gpio_tag;
 	uint8_t gpio_tag;
 };
 };
 
 

+ 2 - 2
drivers/gpu/drm/nouveau/nv50_display.c

@@ -522,8 +522,8 @@ int nv50_display_create(struct drm_device *dev)
 	}
 	}
 
 
 	for (i = 0 ; i < dcb->connector.entries; i++) {
 	for (i = 0 ; i < dcb->connector.entries; i++) {
-		if (i != 0 && dcb->connector.entry[i].index ==
-			      dcb->connector.entry[i - 1].index)
+		if (i != 0 && dcb->connector.entry[i].index2 ==
+			      dcb->connector.entry[i - 1].index2)
 			continue;
 			continue;
 		nouveau_connector_create(dev, &dcb->connector.entry[i]);
 		nouveau_connector_create(dev, &dcb->connector.entry[i]);
 	}
 	}