|
|
@ -417,22 +417,33 @@ bool is_linux_console(int fd, unsigned no_font_changes, bool* quadrants){
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int get_linux_fb_pixelgeom(int fd, unsigned* ypix, unsigned *xpix){
|
|
|
|
|
|
|
|
struct fb_var_screeninfo fbi = {};
|
|
|
|
|
|
|
|
if(ioctl(fd, FBIOGET_VSCREENINFO, &fbi)){
|
|
|
|
|
|
|
|
logwarn("Couldn't get framebuffer info from %d (%s?)\n", fd, strerror(errno));
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
loginfo("Linux framebuffer geometry: %dx%d\n", fbi.yres, fbi.xres);
|
|
|
|
|
|
|
|
*ypix = fbi.yres;
|
|
|
|
|
|
|
|
*xpix = fbi.xres;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool is_linux_framebuffer(tinfo* ti){
|
|
|
|
bool is_linux_framebuffer(tinfo* ti){
|
|
|
|
// FIXME there might be multiple framebuffers present; how do we determine
|
|
|
|
// FIXME there might be multiple framebuffers present; how do we determine
|
|
|
|
// which one is ours?
|
|
|
|
// which one is ours?
|
|
|
|
const char* dev = "/dev/fb0";
|
|
|
|
const char* dev = "/dev/fb0";
|
|
|
|
|
|
|
|
loginfo("Checking for Linux framebuffer at %s\n", dev);
|
|
|
|
int fd = open(dev, O_RDWR | O_CLOEXEC);
|
|
|
|
int fd = open(dev, O_RDWR | O_CLOEXEC);
|
|
|
|
if(fd < 0){
|
|
|
|
if(fd < 0){
|
|
|
|
logdebug("Couldn't open framebuffer device %s\n", dev);
|
|
|
|
logdebug("Couldn't open framebuffer device %s\n", dev);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
struct fb_var_screeninfo fbi = {};
|
|
|
|
unsigned y, x;
|
|
|
|
if(ioctl(fd, FBIOGET_VSCREENINFO, &fbi)){
|
|
|
|
if(get_linux_fb_pixelgeom(fd, &y, &x)){
|
|
|
|
logdebug("Couldn't get framebuffer info from %s (%s?)\n", dev, strerror(errno));
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
close(fd);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
loginfo("Linux framebuffer detected at %s: %dx%d\n", dev, fbi.yres, fbi.xres);
|
|
|
|
|
|
|
|
ti->linux_fb_fd = fd;
|
|
|
|
ti->linux_fb_fd = fd;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -448,4 +459,11 @@ bool is_linux_framebuffer(tinfo* ti){
|
|
|
|
(void)ti;
|
|
|
|
(void)ti;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int get_linux_fb_pixelgeom(int fd, unsigned* ypix, unsigned *xpix){
|
|
|
|
|
|
|
|
(void)fd;
|
|
|
|
|
|
|
|
(void)ypix;
|
|
|
|
|
|
|
|
(void)xpix;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|