summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2009-09-09 05:48:33 (GMT)
committerDaniel Stone <daniel@fooishbar.org>2009-09-09 05:59:00 (GMT)
commitf4350c66b493d63fa06be87caa958d7033232ea4 (patch)
tree2b2b8c14a9afab13f3aca8f457fda1c94752846c
parent72f6be540840b46aa4b158b98fac11a6f90dc9d1 (diff)
fbdevhw: Test for graphics:fb%d as well as graphics/fb%d
Apparently the kernel can't decide on an API to expose to userspace, so let's just try both in the hope that one will work. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Michel Dänzer <michel@daenzer.net>
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 00ebd6b..880f0a2 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -306,7 +306,13 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
fd = open(filename, O_RDONLY, 0);
- if (fd != -1) {
+ if (fd < 0) {
+ sprintf(filename,
+ "/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d",
+ pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
+ fd = open(filename, O_RDONLY, 0);
+ }
+ if (fd >= 0) {
close(fd);
sprintf(filename, "/dev/fb%d", i);