diff options
author | Daniel Stone <daniel@fooishbar.org> | 2009-09-09 15:48:33 +1000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-09-09 15:59:00 +1000 |
commit | f4350c66b493d63fa06be87caa958d7033232ea4 (patch) | |
tree | 2b2b8c14a9afab13f3aca8f457fda1c94752846c | |
parent | 72f6be540840b46aa4b158b98fac11a6f90dc9d1 (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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 00ebd6b39..880f0a20e 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) | |||
306 | pPci->domain, pPci->bus, pPci->dev, pPci->func, i); | 306 | pPci->domain, pPci->bus, pPci->dev, pPci->func, i); |
307 | 307 | ||
308 | fd = open(filename, O_RDONLY, 0); | 308 | fd = open(filename, O_RDONLY, 0); |
309 | if (fd != -1) { | 309 | if (fd < 0) { |
310 | sprintf(filename, | ||
311 | "/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d", | ||
312 | pPci->domain, pPci->bus, pPci->dev, pPci->func, i); | ||
313 | fd = open(filename, O_RDONLY, 0); | ||
314 | } | ||
315 | if (fd >= 0) { | ||
310 | close(fd); | 316 | close(fd); |
311 | sprintf(filename, "/dev/fb%d", i); | 317 | sprintf(filename, "/dev/fb%d", i); |
312 | 318 | ||