drm/nouveau: check for supported chipset before booting fbdev off the hw
authorBen Skeggs <bskeggs@redhat.com>
Tue, 12 Jul 2016 01:57:07 +0000 (11:57 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 14 Jul 2016 01:55:10 +0000 (11:55 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/nouveau/nouveau_drm.c

index 05915c10d07e0d2afa1b6b8856de918262bef448..6dd396f56884850738a7fe05d3eefcbd0dd900d5 100644 (file)
@@ -317,7 +317,16 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
        if (vga_switcheroo_client_probe_defer(pdev))
                return -EPROBE_DEFER;
 
-       /* remove conflicting drivers (vesafb, efifb etc) */
+       /* We need to check that the chipset is supported before booting
+        * fbdev off the hardware, as there's no way to put it back.
+        */
+       ret = nvkm_device_pci_new(pdev, NULL, "error", true, false, 0, &device);
+       if (ret)
+               return ret;
+
+       nvkm_device_del(&device);
+
+       /* Remove conflicting drivers (vesafb, efifb etc). */
        aper = alloc_apertures(3);
        if (!aper)
                return -ENOMEM;