X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo%2Fomapdss%2Fosdl_video.c;h=108ef8af24303ac6bbba97dfcf8b90e050a9fda9;hb=f9b3f440374c61339a12046b226066658e313065;hp=6cd7b31e65f3e3521bcdc98bfb44acbde3d88b6b;hpb=b9a19b44575168f01926c0b99289a50f334447cf;p=sdl_omap.git diff --git a/src/video/omapdss/osdl_video.c b/src/video/omapdss/osdl_video.c index 6cd7b31..108ef8a 100644 --- a/src/video/omapdss/osdl_video.c +++ b/src/video/omapdss/osdl_video.c @@ -1,5 +1,5 @@ /* - * (C) Gražvydas "notaz" Ignotas, 2010 + * (C) Gražvydas "notaz" Ignotas, 2010-2011 * * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. * See the COPYING file in the top-level directory. @@ -20,7 +20,7 @@ #include "omapsdl.h" #include "omapfb.h" #include "linux/fbdev.h" -#include "linux/oshide.h" +#include "linux/xenv.h" struct omapfb_saved_layer { struct omapfb_plane_info pi; @@ -62,11 +62,13 @@ static int osdl_setup_omapfb(int fd, int enabled, int x, int y, int w, int h, in err_perror("SETUP_PLANE"); } - mi.size = mem; - ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi); - if (ret != 0) { - err_perror("SETUP_MEM"); - return -1; + if (mi.size < mem) { + mi.size = mem; + ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi); + if (ret != 0) { + err_perror("SETUP_MEM"); + return -1; + } } pi.pos_x = x; @@ -78,6 +80,7 @@ static int osdl_setup_omapfb(int fd, int enabled, int x, int y, int w, int h, in ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi); if (ret != 0) { err_perror("SETUP_PLANE"); + err("(%d %d %d %d)\n", x, y, w, h); return -1; } @@ -271,7 +274,7 @@ static int osdl_setup_omap_layer(struct SDL_PrivateVideoData *pdata, x = screen_w / 2 - w / 2; y = screen_h / 2 - h / 2; - ret = osdl_setup_omapfb(fd, 1, x, y, w, h, width * height * ((bpp + 7) / 8) * 3); + ret = osdl_setup_omapfb(fd, 1, x, y, w, h, width * height * ((bpp + 7) / 8) * 2); close(fd); return ret; @@ -282,8 +285,6 @@ int osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, int width, int heigh const char *fbname; int ret; - bpp = 16; // FIXME - fbname = get_fb_device(); if (pdata->fbdev != NULL) { @@ -297,13 +298,14 @@ int osdl_video_set_mode(struct SDL_PrivateVideoData *pdata, int width, int heigh if (ret < 0) return -1; - pdata->fbdev = vout_fbdev_init(fbname, &width, &height, 0); + pdata->fbdev = vout_fbdev_init(fbname, &width, &height, bpp, 2); if (pdata->fbdev == NULL) return -1; - if (!pdata->oshide_done) { - oshide_init(); - pdata->oshide_done = 1; + if (!pdata->xenv_up) { + ret = xenv_init(); + if (ret == 0) + pdata->xenv_up = 1; } return 0; @@ -353,9 +355,9 @@ void osdl_video_finish(struct SDL_PrivateVideoData *pdata) pdata->saved_layer = NULL; } - if (pdata->oshide_done) { - oshide_finish(); - pdata->oshide_done = 0; + if (pdata->xenv_up) { + xenv_finish(); + pdata->xenv_up = 0; } }