|
[code:1]
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
int main(int argc, char *argv[])
{
int fd;
struct fb_var_screeninfo vinfo;
fd = open("/dev/fb0", O_RDWR);
if (!fd){
printf("Cannot open FB device");
exit(1);
}
if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)){
printf("Error Var\n");
exit(1);
}
printf("varinfo-xres: %d\n", vinfo.xres);
printf("varinfo-yres: %d\n", vinfo.yres);
printf("varinfo-xresvirtual: %d\n", vinfo.xres_virtual);
printf("varinfo-yresvirtual: %d\n", vinfo.yres_virtual);
printf("varinfo-xoffset: %d\n", vinfo.xoffset);
printf("varinfo-yoffset: %d\n", vinfo.yoffset);
printf("varinfo-bits_per_pixel: %d\n", vinfo.bits_per_pixel);
close(fd);
return 0;
}[/code:1]
这个程序中,在我机器上得到frambuffer的分辨率是1024x768,
运行cce后,实际分辨率只有640x480, 可运行该程序,显示的还是1024x768。
问下这是为什么?难道运行cce后不是用/dev/fb0了? |
|