aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bios.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-02-23 20:53:59 -0500
committerBen Skeggs <bskeggs@redhat.com>2010-02-25 00:09:30 -0500
commitdc5bc4ed3815dfec2f3ecfbf6f7983440040fe22 (patch)
tree976c0fd8af1754919d7f8ae8835ba8808af308af /drivers/gpu/drm/nouveau/nouveau_bios.c
parentf66fa771d5046fd8c3e3c6f09407e9168e261b8d (diff)
drm/nouveau: construct a connector table for cards that lack a real one
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 8dd97b28df36..bcf843f22b7d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -5754,7 +5754,7 @@ static void
5754fixup_legacy_connector(struct nvbios *bios) 5754fixup_legacy_connector(struct nvbios *bios)
5755{ 5755{
5756 struct dcb_table *dcb = &bios->dcb; 5756 struct dcb_table *dcb = &bios->dcb;
5757 int high = 0, i; 5757 int i, i2c, i2c_conn[DCB_MAX_NUM_I2C_ENTRIES] = { };
5758 5758
5759 /* 5759 /*
5760 * DCB 3.0 also has the table in most cases, but there are some cards 5760 * DCB 3.0 also has the table in most cases, but there are some cards
@@ -5765,6 +5765,8 @@ fixup_legacy_connector(struct nvbios *bios)
5765 if (dcb->version >= 0x40) 5765 if (dcb->version >= 0x40)
5766 return; 5766 return;
5767 5767
5768 dcb->connector.entries = 0;
5769
5768 /* 5770 /*
5769 * No known connector info before v3.0, so make it up. the rule here 5771 * No known connector info before v3.0, so make it up. the rule here
5770 * is: anything on the same i2c bus is considered to be on the same 5772 * is: anything on the same i2c bus is considered to be on the same
@@ -5772,30 +5774,31 @@ fixup_legacy_connector(struct nvbios *bios)
5772 * its own unique connector index. 5774 * its own unique connector index.
5773 */ 5775 */
5774 for (i = 0; i < dcb->entries; i++) { 5776 for (i = 0; i < dcb->entries; i++) {
5775 if (dcb->entry[i].i2c_index == 0xf)
5776 continue;
5777
5778 /* 5777 /*
5779 * Ignore the I2C index for on-chip TV-out, as there 5778 * Ignore the I2C index for on-chip TV-out, as there
5780 * are cards with bogus values (nv31m in bug 23212), 5779 * are cards with bogus values (nv31m in bug 23212),
5781 * and it's otherwise useless. 5780 * and it's otherwise useless.
5782 */ 5781 */
5783 if (dcb->entry[i].type == OUTPUT_TV && 5782 if (dcb->entry[i].type == OUTPUT_TV &&
5784 dcb->entry[i].location == DCB_LOC_ON_CHIP) { 5783 dcb->entry[i].location == DCB_LOC_ON_CHIP)
5785 dcb->entry[i].i2c_index = 0xf; 5784 dcb->entry[i].i2c_index = 0xf;
5785 i2c = dcb->entry[i].i2c_index;
5786
5787 if (i2c_conn[i2c]) {
5788 dcb->entry[i].connector = i2c_conn[i2c] - 1;
5786 continue; 5789 continue;
5787 } 5790 }
5788 5791
5789 dcb->entry[i].connector = dcb->entry[i].i2c_index; 5792 dcb->entry[i].connector = dcb->connector.entries++;
5790 if (dcb->entry[i].connector > high) 5793 if (i2c != 0xf)
5791 high = dcb->entry[i].connector; 5794 i2c_conn[i2c] = dcb->connector.entries;
5792 } 5795 }
5793 5796
5794 for (i = 0; i < dcb->entries; i++) { 5797 /* Fake the connector table as well as just connector indices */
5795 if (dcb->entry[i].i2c_index != 0xf) 5798 for (i = 0; i < dcb->connector.entries; i++) {
5796 continue; 5799 dcb->connector.entry[i].index = i;
5797 5800 dcb->connector.entry[i].type = divine_connector_type(bios, i);
5798 dcb->entry[i].connector = ++high; 5801 dcb->connector.entry[i].gpio_tag = 0xff;
5799 } 5802 }
5800} 5803}
5801 5804