diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index a9f70d151d..853482aa2a 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -374,13 +374,20 @@ fbdev_open(int scrnIndex, const char *dev, char **namep) dev = "/dev/fb0"; fd = open(dev, O_RDWR); if (fd == -1) { - /* last try: default device symlink */ + /* second try: default device symlink */ /* TODO: we should try this one before /dev/fb0, but we keep it like this to not change old behavior */ dev = "/dev/fb"; fd = open(dev, O_RDWR); } + /* last tries, framebuffers 1 through 7 */ + char devbuf[] = "/dev/fb1"; + for (int i = 1; i < 8 && fd == -1; i++) { + devbuf[sizeof(devbuf) - 2] = i + '0'; + fd = open(devbuf, O_RDWR); + } + if (fd == -1) { xf86DrvMsg(scrnIndex, X_ERROR, "open %s: %s\n", dev, strerror(errno)); return -1;