Skip to content

Commit

Permalink
drm/nouveau: Don't try to parse a GPIO table on early DCBv2.2 BIOSes.
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Francisco Jerez authored and Ben Skeggs committed Sep 24, 2010
1 parent bb338bb commit 5e6a744
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -5809,14 +5809,27 @@ parse_dcb_gpio_table(struct nvbios *bios)
entries = gpio[2];
recordlen = gpio[3];
} else
if (dcb[0] >= 0x22) {
if (dcb[0] >= 0x22 && dcb[-1] >= 0x13) {
gpio = ROMPTR(bios, dcb[-15]);
if (!gpio)
goto no_table;

headerlen = 3;
entries = gpio[2];
recordlen = gpio[1];
} else
if (dcb[0] >= 0x22) {
/* No GPIO table present, parse the TVDAC GPIO data. */
uint8_t *tvdac_gpio = &dcb[-5];

if (tvdac_gpio[0] & 1) {
e = new_gpio_entry(bios);
e->tag = DCB_GPIO_TVDAC0;
e->line = tvdac_gpio[1] >> 4;
e->invert = tvdac_gpio[0] & 2;
}

goto no_table;
} else {
NV_DEBUG(dev, "no/unknown gpio table on DCB 0x%02x\n", dcb[0]);
goto no_table;
Expand Down

0 comments on commit 5e6a744

Please sign in to comment.