summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-03-07 08:56:20 +1000
committerDave Airlie <airlied@redhat.com>2008-03-07 08:56:20 +1000
commitadd7d21c79e2bd2012d92bb0043023230ec9aa74 (patch)
treeb91acd5d4bc350afb40d60460c8355349c381518 /libdrm
parent48a166af14d7455835b9dc2ffd831347d18635d2 (diff)
drm: fixup for new sysfs API
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drmMode.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libdrm/xf86drmMode.c b/libdrm/xf86drmMode.c
index 07b14dbf..f86cc48f 100644
--- a/libdrm/xf86drmMode.c
+++ b/libdrm/xf86drmMode.c
@@ -568,6 +568,25 @@ int drmCheckModesettingSupported(const char *busid)
if (ret != 4)
return -EINVAL;
+ sprintf(pci_dev_dir, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/drm",
+ domain, bus, dev, func);
+
+ sysdir = opendir(pci_dev_dir);
+ if (sysdir) {
+ dent = readdir(sysdir);
+ while (dent) {
+ if (!strncmp(dent->d_name, "controlD", 8)) {
+ found = 1;
+ break;
+ }
+
+ dent = readdir(sysdir);
+ }
+ closedir(sysdir);
+ if (found)
+ return 0;
+ }
+
sprintf(pci_dev_dir, "/sys/bus/pci/devices/%04x:%02x:%02x.%d/",
domain, bus, dev, func);