diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-12 02:36:42 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:41 -0500 |
commit | b4c26818aeb4159dd537eff6453ae5ebf7a69723 (patch) | |
tree | c88d961c30eb46da840781f5c1173c4cdcf6b8f3 /drivers/gpu/drm/nouveau/nouveau_bios.c | |
parent | befb51e9c97e783c86a1da27bdda3a638d2f02c7 (diff) |
drm/nouveau/mxm: initial implementation of dcb sanitisation
The DCB table provided by the VBIOS on most MXM chips has a number of
entries which either need to be disabled, or modified according to the
MXM-SIS Output Device Descriptors.
The x86 vbios code usually takes care of this for us, however, with the
large number of laptops now with switchable graphics or optimus, a lot
of the time nouveau is responsible for POSTing the card instead - leaving
some fun situations like, plugging in a monitor and having nouveau decide
3 connectors actually just got plugged in..
No MXM-SIS fetching methods implemented yet.
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.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 35b18f4f7c4e..1faa7d9ceb94 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -5382,6 +5382,9 @@ bit_table(struct drm_device *dev, u8 id, struct bit_entry *bit) | |||
5382 | struct nvbios *bios = &dev_priv->vbios; | 5382 | struct nvbios *bios = &dev_priv->vbios; |
5383 | u8 entries, *entry; | 5383 | u8 entries, *entry; |
5384 | 5384 | ||
5385 | if (bios->type != NVBIOS_BIT) | ||
5386 | return -ENODEV; | ||
5387 | |||
5385 | entries = bios->data[bios->offset + 10]; | 5388 | entries = bios->data[bios->offset + 10]; |
5386 | entry = &bios->data[bios->offset + 12]; | 5389 | entry = &bios->data[bios->offset + 12]; |
5387 | while (entries--) { | 5390 | while (entries--) { |
@@ -5832,7 +5835,7 @@ dcb_table(struct drm_device *dev) | |||
5832 | return NULL; | 5835 | return NULL; |
5833 | } | 5836 | } |
5834 | 5837 | ||
5835 | u8 * | 5838 | void * |
5836 | dcb_outp(struct drm_device *dev, u8 idx) | 5839 | dcb_outp(struct drm_device *dev, u8 idx) |
5837 | { | 5840 | { |
5838 | u8 *dcb = dcb_table(dev); | 5841 | u8 *dcb = dcb_table(dev); |
@@ -6663,6 +6666,10 @@ nouveau_bios_init(struct drm_device *dev) | |||
6663 | if (ret) | 6666 | if (ret) |
6664 | return ret; | 6667 | return ret; |
6665 | 6668 | ||
6669 | ret = nouveau_mxm_init(dev); | ||
6670 | if (ret) | ||
6671 | return ret; | ||
6672 | |||
6666 | ret = parse_dcb_table(dev, bios); | 6673 | ret = parse_dcb_table(dev, bios); |
6667 | if (ret) | 6674 | if (ret) |
6668 | return ret; | 6675 | return ret; |
@@ -6703,5 +6710,6 @@ nouveau_bios_init(struct drm_device *dev) | |||
6703 | void | 6710 | void |
6704 | nouveau_bios_takedown(struct drm_device *dev) | 6711 | nouveau_bios_takedown(struct drm_device *dev) |
6705 | { | 6712 | { |
6713 | nouveau_mxm_fini(dev); | ||
6706 | nouveau_i2c_fini(dev); | 6714 | nouveau_i2c_fini(dev); |
6707 | } | 6715 | } |