/*
- * (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.
#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;
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;
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;
}
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;
const char *fbname;
int ret;
- bpp = 16; // FIXME
-
fbname = get_fb_device();
if (pdata->fbdev != NULL) {
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;
pdata->saved_layer = NULL;
}
- if (pdata->oshide_done) {
- oshide_finish();
- pdata->oshide_done = 0;
+ if (pdata->xenv_up) {
+ xenv_finish();
+ pdata->xenv_up = 0;
}
}