diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 0b69a9628c95..e4f33a4edea1 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -2166,7 +2166,7 @@ peek_fb(struct drm_device *dev, struct io_mapping *fb, | |||
2166 | uint32_t val = 0; | 2166 | uint32_t val = 0; |
2167 | 2167 | ||
2168 | if (off < pci_resource_len(dev->pdev, 1)) { | 2168 | if (off < pci_resource_len(dev->pdev, 1)) { |
2169 | uint32_t __iomem *p = | 2169 | uint8_t __iomem *p = |
2170 | io_mapping_map_atomic_wc(fb, off & PAGE_MASK, KM_USER0); | 2170 | io_mapping_map_atomic_wc(fb, off & PAGE_MASK, KM_USER0); |
2171 | 2171 | ||
2172 | val = ioread32(p + (off & ~PAGE_MASK)); | 2172 | val = ioread32(p + (off & ~PAGE_MASK)); |
@@ -2182,7 +2182,7 @@ poke_fb(struct drm_device *dev, struct io_mapping *fb, | |||
2182 | uint32_t off, uint32_t val) | 2182 | uint32_t off, uint32_t val) |
2183 | { | 2183 | { |
2184 | if (off < pci_resource_len(dev->pdev, 1)) { | 2184 | if (off < pci_resource_len(dev->pdev, 1)) { |
2185 | uint32_t __iomem *p = | 2185 | uint8_t __iomem *p = |
2186 | io_mapping_map_atomic_wc(fb, off & PAGE_MASK, KM_USER0); | 2186 | io_mapping_map_atomic_wc(fb, off & PAGE_MASK, KM_USER0); |
2187 | 2187 | ||
2188 | iowrite32(val, p + (off & ~PAGE_MASK)); | 2188 | iowrite32(val, p + (off & ~PAGE_MASK)); |
@@ -4587,7 +4587,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
4587 | return 1; | 4587 | return 1; |
4588 | } | 4588 | } |
4589 | 4589 | ||
4590 | NV_TRACE(dev, "0x%04X: parsing output script 0\n", script); | 4590 | NV_DEBUG_KMS(dev, "0x%04X: parsing output script 0\n", script); |
4591 | nouveau_bios_run_init_table(dev, script, dcbent); | 4591 | nouveau_bios_run_init_table(dev, script, dcbent); |
4592 | } else | 4592 | } else |
4593 | if (pxclk == -1) { | 4593 | if (pxclk == -1) { |
@@ -4597,7 +4597,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
4597 | return 1; | 4597 | return 1; |
4598 | } | 4598 | } |
4599 | 4599 | ||
4600 | NV_TRACE(dev, "0x%04X: parsing output script 1\n", script); | 4600 | NV_DEBUG_KMS(dev, "0x%04X: parsing output script 1\n", script); |
4601 | nouveau_bios_run_init_table(dev, script, dcbent); | 4601 | nouveau_bios_run_init_table(dev, script, dcbent); |
4602 | } else | 4602 | } else |
4603 | if (pxclk == -2) { | 4603 | if (pxclk == -2) { |
@@ -4610,7 +4610,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
4610 | return 1; | 4610 | return 1; |
4611 | } | 4611 | } |
4612 | 4612 | ||
4613 | NV_TRACE(dev, "0x%04X: parsing output script 2\n", script); | 4613 | NV_DEBUG_KMS(dev, "0x%04X: parsing output script 2\n", script); |
4614 | nouveau_bios_run_init_table(dev, script, dcbent); | 4614 | nouveau_bios_run_init_table(dev, script, dcbent); |
4615 | } else | 4615 | } else |
4616 | if (pxclk > 0) { | 4616 | if (pxclk > 0) { |
@@ -4622,7 +4622,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
4622 | return 1; | 4622 | return 1; |
4623 | } | 4623 | } |
4624 | 4624 | ||
4625 | NV_TRACE(dev, "0x%04X: parsing clock script 0\n", script); | 4625 | NV_DEBUG_KMS(dev, "0x%04X: parsing clock script 0\n", script); |
4626 | nouveau_bios_run_init_table(dev, script, dcbent); | 4626 | nouveau_bios_run_init_table(dev, script, dcbent); |
4627 | } else | 4627 | } else |
4628 | if (pxclk < 0) { | 4628 | if (pxclk < 0) { |
@@ -4634,7 +4634,7 @@ nouveau_bios_run_display_table(struct drm_device *dev, struct dcb_entry *dcbent, | |||
4634 | return 1; | 4634 | return 1; |
4635 | } | 4635 | } |
4636 | 4636 | ||
4637 | NV_TRACE(dev, "0x%04X: parsing clock script 1\n", script); | 4637 | NV_DEBUG_KMS(dev, "0x%04X: parsing clock script 1\n", script); |
4638 | nouveau_bios_run_init_table(dev, script, dcbent); | 4638 | nouveau_bios_run_init_table(dev, script, dcbent); |
4639 | } | 4639 | } |
4640 | 4640 | ||
@@ -5357,19 +5357,17 @@ static int parse_bit_tmds_tbl_entry(struct drm_device *dev, struct nvbios *bios, | |||
5357 | } | 5357 | } |
5358 | 5358 | ||
5359 | tmdstableptr = ROM16(bios->data[bitentry->offset]); | 5359 | tmdstableptr = ROM16(bios->data[bitentry->offset]); |
5360 | 5360 | if (!tmdstableptr) { | |
5361 | if (tmdstableptr == 0x0) { | ||
5362 | NV_ERROR(dev, "Pointer to TMDS table invalid\n"); | 5361 | NV_ERROR(dev, "Pointer to TMDS table invalid\n"); |
5363 | return -EINVAL; | 5362 | return -EINVAL; |
5364 | } | 5363 | } |
5365 | 5364 | ||
5365 | NV_INFO(dev, "TMDS table version %d.%d\n", | ||
5366 | bios->data[tmdstableptr] >> 4, bios->data[tmdstableptr] & 0xf); | ||
5367 | |||
5366 | /* nv50+ has v2.0, but we don't parse it atm */ | 5368 | /* nv50+ has v2.0, but we don't parse it atm */ |
5367 | if (bios->data[tmdstableptr] != 0x11) { | 5369 | if (bios->data[tmdstableptr] != 0x11) |
5368 | NV_WARN(dev, | ||
5369 | "TMDS table revision %d.%d not currently supported\n", | ||
5370 | bios->data[tmdstableptr] >> 4, bios->data[tmdstableptr] & 0xf); | ||
5371 | return -ENOSYS; | 5370 | return -ENOSYS; |
5372 | } | ||
5373 | 5371 | ||
5374 | /* | 5372 | /* |
5375 | * These two scripts are odd: they don't seem to get run even when | 5373 | * These two scripts are odd: they don't seem to get run even when |
@@ -5809,6 +5807,22 @@ parse_dcb_gpio_table(struct nvbios *bios) | |||
5809 | gpio->line = tvdac_gpio[1] >> 4; | 5807 | gpio->line = tvdac_gpio[1] >> 4; |
5810 | gpio->invert = tvdac_gpio[0] & 2; | 5808 | gpio->invert = tvdac_gpio[0] & 2; |
5811 | } | 5809 | } |
5810 | } else { | ||
5811 | /* | ||
5812 | * No systematic way to store GPIO info on pre-v2.2 | ||
5813 | * DCBs, try to match the PCI device IDs. | ||
5814 | */ | ||
5815 | |||
5816 | /* Apple iMac G4 NV18 */ | ||
5817 | if (dev->pdev->device == 0x0189 && | ||
5818 | dev->pdev->subsystem_vendor == 0x10de && | ||
5819 | dev->pdev->subsystem_device == 0x0010) { | ||
5820 | struct dcb_gpio_entry *gpio = new_gpio_entry(bios); | ||
5821 | |||
5822 | gpio->tag = DCB_GPIO_TVDAC0; | ||
5823 | gpio->line = 4; | ||
5824 | } | ||
5825 | |||
5812 | } | 5826 | } |
5813 | 5827 | ||
5814 | if (!gpio_table_ptr) | 5828 | if (!gpio_table_ptr) |