20void QEglFSMaliIntegration::platformInit()
23 QEglFSDeviceIntegration::platformInit();
25 int fd = qt_safe_open(
"/dev/fb0", O_RDWR, 0);
27 qWarning(
"Failed to open fb to detect screen resolution!");
29 struct fb_var_screeninfo vinfo;
30 memset(&vinfo, 0,
sizeof(vinfo));
31 if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1)
32 qWarning(
"Could not get variable screen info");
34 vinfo.bits_per_pixel = 32;
36 vinfo.green.length = 8;
37 vinfo.blue.length = 8;
38 vinfo.transp.length = 8;
39 vinfo.blue.offset = 0;
40 vinfo.green.offset = 8;
41 vinfo.red.offset = 16;
42 vinfo.transp.offset = 24;
44 vinfo.yres_virtual = 2 * vinfo.yres;
47 if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo) == -1)
48 qErrnoWarning(errno,
"Unable to set double buffer mode!");
53EGLNativeWindowType QEglFSMaliIntegration::createNativeWindow(QPlatformWindow *window,
const QSize &size,
const QSurfaceFormat &format)
58 shadow_fbdev_window *fbwin =
reinterpret_cast<shadow_fbdev_window *>(malloc(
sizeof(shadow_fbdev_window)));
62 fbwin->width = size.width();
63 fbwin->height = size.height();
64 return (EGLNativeWindowType)fbwin;