summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2013-09-21 17:41:57 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2013-10-29 21:04:38 +0000
commit2a87647c6adca73400e3f9f9e9ef7624c7837082 (patch)
tree53aa5d57c444ebb0e348c5d4bd16580caf2bb8ee
parentc9e6e6382f8c38b47691495e5a710935115b6702 (diff)
targets/xorg-nouveau: drop usage of dri1 function DRICreatePCIBusID
The function should have never used it in the first place as it was a left over from the DRI1 days of the nouveau ddx. While we're around check if KMS is supported before opening the nouveau device, and add support for Fermi & Kepler cards. Compile tested only due to the lack of a Fermi/Kepler card. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--src/gallium/targets/xorg-nouveau/nouveau_xorg.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
index 454aea6d48b..2e44ddb3c3b 100644
--- a/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
+++ b/src/gallium/targets/xorg-nouveau/nouveau_xorg.c
@@ -30,7 +30,6 @@
#include "../../state_trackers/xorg/xorg_winsys.h"
#include <nouveau.h>
-#include <dri.h>
#include <xf86drmMode.h>
static void nouveau_xorg_identify(int flags);
@@ -129,32 +128,31 @@ nouveau_xorg_pci_probe(DriverPtr driver,
char *busid;
int chipset, ret;
- if (device->vendor_id != 0x10DE)
+ busid = malloc(64);
+ if (!busid)
return FALSE;
- if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
- xf86DrvMsg(-1, X_ERROR, "[drm] No DRICreatePCIBusID symbol\n");
+ sprintf(busid, "pci:%04x:%02x:%02x.%d",
+ device->domain, device->bus,
+ device->dev, device->func);
+
+ ret = drmCheckModesettingSupported(busid);
+ if (ret) {
+ xf86DrvMsg(-1, X_ERROR, "[drm] KMS not enabled\n");
+ free(busid);
return FALSE;
}
- busid = DRICreatePCIBusID(device);
ret = nouveau_device_open(busid, &dev);
+ free(busid);
if (ret) {
xf86DrvMsg(-1, X_ERROR, "[drm] failed to open device\n");
- free(busid);
return FALSE;
}
chipset = dev->chipset;
nouveau_device_del(&dev);
- ret = drmCheckModesettingSupported(busid);
- free(busid);
- if (ret) {
- xf86DrvMsg(-1, X_ERROR, "[drm] KMS not enabled\n");
- return FALSE;
- }
-
switch (chipset & 0xf0) {
case 0x00:
case 0x10:
@@ -169,6 +167,9 @@ nouveau_xorg_pci_probe(DriverPtr driver,
case 0x90:
case 0xa0:
case 0xc0:
+ case 0xd0:
+ case 0xe0:
+ case 0xf0:
xf86DrvMsg(-1, X_INFO, "Detected chipset: NV%02x\n", chipset);
break;
default: