summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_bios.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-10-12 16:36:42 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 19:01:41 +1000
commitb4c26818aeb4159dd537eff6453ae5ebf7a69723 (patch)
treec88d961c30eb46da840781f5c1173c4cdcf6b8f3 /drivers/gpu/drm/nouveau/nouveau_bios.c
parentbefb51e9c97e783c86a1da27bdda3a638d2f02c7 (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.c10
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)
struct nvbios *bios = &dev_priv->vbios;
u8 entries, *entry;
+ if (bios->type != NVBIOS_BIT)
+ return -ENODEV;
+
entries = bios->data[bios->offset + 10];
entry = &bios->data[bios->offset + 12];
while (entries--) {
@@ -5832,7 +5835,7 @@ dcb_table(struct drm_device *dev)
return NULL;
}
-u8 *
+void *
dcb_outp(struct drm_device *dev, u8 idx)
{
u8 *dcb = dcb_table(dev);
@@ -6663,6 +6666,10 @@ nouveau_bios_init(struct drm_device *dev)
if (ret)
return ret;
+ ret = nouveau_mxm_init(dev);
+ if (ret)
+ return ret;
+
ret = parse_dcb_table(dev, bios);
if (ret)
return ret;
@@ -6703,5 +6710,6 @@ nouveau_bios_init(struct drm_device *dev)
void
nouveau_bios_takedown(struct drm_device *dev)
{
+ nouveau_mxm_fini(dev);
nouveau_i2c_fini(dev);
}