\r
#include <pico/pico_int.h>\r
\r
+#define LAYER_MEM_SIZE (320*240*2 * 4)\r
+\r
static struct vout_fbdev *main_fb, *layer_fb;\r
// g_layer_* - in use, g_layer_c* - configured custom\r
int g_layer_cx, g_layer_cy, g_layer_cw, g_layer_ch;\r
{\r
struct omapfb_plane_info pi;\r
struct omapfb_mem_info mi;\r
+ int is_enabled;\r
+ int retval = 0;\r
int ret;\r
\r
ret = ioctl(fd, OMAPFB_QUERY_PLANE, &pi);\r
}\r
\r
/* must disable when changing stuff */\r
- if (pi.enabled) {\r
+ is_enabled = pi.enabled;\r
+ if (is_enabled) {\r
pi.enabled = 0;\r
ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi);\r
if (ret != 0)\r
perror("SETUP_PLANE");\r
+ else\r
+ is_enabled = 0;\r
}\r
\r
- mi.size = 320*240*2*4;\r
- ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);\r
- if (ret != 0) {\r
- perror("SETUP_MEM");\r
- return -1;\r
+ if (mi.size < LAYER_MEM_SIZE) {\r
+ unsigned int size_old = mi.size;\r
+\r
+ mi.size = LAYER_MEM_SIZE;\r
+ ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);\r
+ if (ret != 0) {\r
+ perror("SETUP_MEM");\r
+ fprintf(stderr, "(requested %u, had %u)\n",\r
+ mi.size, size_old);\r
+ return -1;\r
+ }\r
}\r
\r
pi.pos_x = x;\r
pi.enabled = enabled;\r
\r
ret = ioctl(fd, OMAPFB_SETUP_PLANE, &pi);\r
- if (ret != 0) {\r
+ if (ret == 0) {\r
+ is_enabled = pi.enabled;\r
+ }\r
+ else {\r
perror("SETUP_PLANE");\r
- return -1;\r
+ retval = -1;\r
}\r
\r
- return 0;\r
+ plat_target_switch_layer(1, is_enabled);\r
+\r
+ return retval;\r
}\r
\r
int pnd_setup_layer(int enabled, int x, int y, int w, int h)\r
\r
pnd_menu_init();\r
\r
+ // default ROM path\r
+ strcpy(rom_fname_loaded, "/media");\r
+\r
in_evdev_init(in_evdev_defbinds);\r
in_probe();\r
plat_target_setup_input();\r