X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/966258dd4ca61e0fc632dba295cd0ced1ad0364e..35f4d6b50c5e8c79e57dea6e9ad9403b5ab6fdd5:/lib/gdi/fb.cpp diff --git a/lib/gdi/fb.cpp b/lib/gdi/fb.cpp index 4a801bfe..5d895901 100644 --- a/lib/gdi/fb.cpp +++ b/lib/gdi/fb.cpp @@ -7,7 +7,6 @@ #include #include -#include #include #ifndef FBIO_WAITFORVSYNC @@ -94,12 +93,26 @@ int fbClass::SetMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp) screeninfo.width=0; screeninfo.xoffset=screeninfo.yoffset=0; screeninfo.bits_per_pixel=nbpp; + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) { - perror("FBIOPUT_VSCREENINFO"); - printf("fb failed\n"); - return -1; - } + // try single buffering + screeninfo.yres_virtual=screeninfo.yres=nyRes; + + if (ioctl(fd, FBIOPUT_VSCREENINFO, &screeninfo)<0) + { + perror("FBIOPUT_VSCREENINFO"); + printf("fb failed\n"); + return -1; + } + eDebug(" - double buffering not available."); + } else + eDebug(" - double buffering available!"); + + m_number_of_pages = screeninfo.yres_virtual / nyRes; + + ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo); + if ((screeninfo.xres!=nxRes) && (screeninfo.yres!=nyRes) && (screeninfo.bits_per_pixel!=nbpp)) { eDebug("SetMode failed: wanted: %dx%dx%d, got %dx%dx%d",