From f4350c66b493d63fa06be87caa958d7033232ea4 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 9 Sep 2009 15:48:33 +1000 Subject: fbdevhw: Test for graphics:fb%d as well as graphics/fb%d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Michel Dänzer --- hw/xfree86/fbdevhw/fbdevhw.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) 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); -- cgit v1.2.3