diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-01-14 00:58:10 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-01-14 03:48:52 -0500 |
commit | ed42f8240cfea13580fe91195e52c5247275e7df (patch) | |
tree | 69b0d833d0da2c7c41cabbd10c9904f1bcc78bf5 | |
parent | 77cb5c75e89ccfeb993d9dec37f8edb3a855e9f4 (diff) |
drm/nouveau: assume no nv04 board has a DCB table
There's a report of a TNT2 where the DCB table pointer is *not* NULL
(it contains a part of a VBIOS data string), and we assume this means
a DCB table is present, causing all kinds of hilarity.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 9710e69898f6..9dd2efa07f68 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -5523,11 +5523,13 @@ void merge_like_dcb_entries(struct drm_device *dev, struct parsed_dcb *dcb) | |||
5523 | dcb->entries = newentries; | 5523 | dcb->entries = newentries; |
5524 | } | 5524 | } |
5525 | 5525 | ||
5526 | static int parse_dcb_table(struct drm_device *dev, struct nvbios *bios, bool twoHeads) | 5526 | static int |
5527 | parse_dcb_table(struct drm_device *dev, struct nvbios *bios, bool twoHeads) | ||
5527 | { | 5528 | { |
5529 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
5528 | struct bios_parsed_dcb *bdcb = &bios->bdcb; | 5530 | struct bios_parsed_dcb *bdcb = &bios->bdcb; |
5529 | struct parsed_dcb *dcb; | 5531 | struct parsed_dcb *dcb; |
5530 | uint16_t dcbptr, i2ctabptr = 0; | 5532 | uint16_t dcbptr = 0, i2ctabptr = 0; |
5531 | uint8_t *dcbtable; | 5533 | uint8_t *dcbtable; |
5532 | uint8_t headerlen = 0x4, entries = DCB_MAX_NUM_ENTRIES; | 5534 | uint8_t headerlen = 0x4, entries = DCB_MAX_NUM_ENTRIES; |
5533 | bool configblock = true; | 5535 | bool configblock = true; |
@@ -5538,16 +5540,18 @@ static int parse_dcb_table(struct drm_device *dev, struct nvbios *bios, bool two | |||
5538 | dcb->entries = 0; | 5540 | dcb->entries = 0; |
5539 | 5541 | ||
5540 | /* get the offset from 0x36 */ | 5542 | /* get the offset from 0x36 */ |
5541 | dcbptr = ROM16(bios->data[0x36]); | 5543 | if (dev_priv->card_type > NV_04) { |
5544 | dcbptr = ROM16(bios->data[0x36]); | ||
5545 | if (dcbptr == 0x0000) | ||
5546 | NV_WARN(dev, "No output data (DCB) found in BIOS\n"); | ||
5547 | } | ||
5542 | 5548 | ||
5549 | /* this situation likely means a really old card, pre DCB */ | ||
5543 | if (dcbptr == 0x0) { | 5550 | if (dcbptr == 0x0) { |
5544 | NV_WARN(dev, "No output data (DCB) found in BIOS, " | 5551 | NV_INFO(dev, "Assuming a CRT output exists\n"); |
5545 | "assuming a CRT output exists\n"); | ||
5546 | /* this situation likely means a really old card, pre DCB */ | ||
5547 | fabricate_vga_output(dcb, LEGACY_I2C_CRT, 1); | 5552 | fabricate_vga_output(dcb, LEGACY_I2C_CRT, 1); |
5548 | 5553 | ||
5549 | if (nv04_tv_identify(dev, | 5554 | if (nv04_tv_identify(dev, bios->legacy.i2c_indices.tv) >= 0) |
5550 | bios->legacy.i2c_indices.tv) >= 0) | ||
5551 | fabricate_tv_output(dcb, twoHeads); | 5555 | fabricate_tv_output(dcb, twoHeads); |
5552 | 5556 | ||
5553 | return 0; | 5557 | return 0; |