summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2009-09-09 15:48:33 +1000
committerKeith Packard <keithp@keithp.com>2009-09-22 12:10:41 -0700
commit9bc4a69040493e589a3811ca5e085e323438996d (patch)
tree3cbfb6b527138f1cf555f3d4f55689df6f3375ea
parentd78669c92d751464bc3c8f79f2aa21ca0951e3a9 (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> (cherry picked from commit f4350c66b493d63fa06be87caa958d7033232ea4)
-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 5269277ef..d6e78b9ff 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -318,7 +318,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);