drm/nouveau: Add proper vgaarb support.
authorMarcin Kościelnicki <koriakin@0x04.net>
Mon, 8 Feb 2010 00:20:17 +0000 (00:20 +0000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 9 Feb 2010 02:50:27 +0000 (12:50 +1000)
Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_state.c

index fcd7610..a4851af 100644 (file)
@@ -310,6 +310,14 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
 static unsigned int
 nouveau_vga_set_decode(void *priv, bool state)
 {
+       struct drm_device *dev = priv;
+       struct drm_nouveau_private *dev_priv = dev->dev_private;
+
+       if (dev_priv->chipset >= 0x40)
+               nv_wr32(dev, 0x88054, state);
+       else
+               nv_wr32(dev, 0x1854, state);
+
        if (state)
                return VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM |
                       VGA_RSRC_NORMAL_IO | VGA_RSRC_NORMAL_MEM;