2 * A stupid little program that isn't really useful for anything
3 * and that has to be here because some people use separate /usr
15 #include <sys/ioctl.h>
20 void die(const char *fmt
, ...)
26 vfprintf(stderr
, fmt
, ap
);
31 int main(int argc
, char *argv
[])
33 struct fb_var_screeninfo var
;
37 xres
= getenv("SPLASH_XRES");
38 yres
= getenv("SPLASH_YRES");
40 if (xres
&& yres
&& atoi(xres
) > 0 && atoi(yres
) > 0) {
41 printf("%sx%s\n", xres
, yres
);
45 if ((fh
= open("/dev/fb0", O_RDONLY
)) == -1)
46 if ((fh
= open("/dev/fb/0", O_RDONLY
)) == -1)
47 die("Can't open /dev/fb0 or /dev/fb/0\n");
49 if (ioctl(fh
, FBIOGET_VSCREENINFO
, &var
))
50 die("Can't get fb_var\n");
53 printf("%dx%d\n", var
.xres
, var
.yres
);