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