X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=pandora%2Fpicorestore.c;h=950b98ed5ffb351dff3adffb7f8b1be7d5f0e2a4;hb=c66f49e61a09926e828b2685cc997a6ebee7cdb4;hp=a278abc3e79cb59beedf21fd5ca081430f96ff7e;hpb=b6b7d1b1c53e6c0be6c9cc01519bdf9541c49ba4;p=libpicofe.git diff --git a/pandora/picorestore.c b/pandora/picorestore.c index a278abc..950b98e 100644 --- a/pandora/picorestore.c +++ b/pandora/picorestore.c @@ -5,6 +5,7 @@ #include #include #include +#include #include int main() @@ -14,14 +15,14 @@ int main() fbdev = open("/dev/fb0", O_RDWR); if (fbdev == -1) { - perror("open"); - return 1; + perror("open fb0"); + goto end_fb0; } ret = ioctl(fbdev, FBIOGET_VSCREENINFO, &fbvar); if (ret == -1) { perror("FBIOGET_VSCREENINFO ioctl"); - goto end_fb; + goto end_fb0; } if (fbvar.yoffset != 0) { @@ -34,8 +35,34 @@ int main() printf("ok\n"); } -end_fb: - close(fbdev); +end_fb0: + if (fbdev >= 0) + close(fbdev); + + fbdev = open("/dev/fb1", O_RDWR); + if (fbdev == -1) { + perror("open fb1"); + goto end_fb1; + } + + ret = ioctl(fd, OMAPFB_QUERY_PLANE, &pi); + ret |= ioctl(fd, OMAPFB_QUERY_MEM, &mi); + if (ret != 0) + perror("QUERY_*"); + + pi.enabled = 0; + ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi); + if (ret != 0) + perror("SETUP_PLANE"); + + mi.size = 0; + ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi); + if (ret != 0) + perror("SETUP_MEM"); + +end_fb1: + if (fbdev >= 0) + close(fbdev); kbdfd = open("/dev/tty", O_RDWR); if (kbdfd == -1) {