mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-26 21:14:36 +00:00
xfree86: fbdevhw: try framebuffers 1 through 7 on the fallback probe
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
committed by
Enrico Weigelt
parent
9b30bb93f3
commit
1e7c19a2ec
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user