prepare for external gpu plugins
[pcsx_rearmed.git] / frontend / plat_omap.c
index 034e9e5..e6a1105 100644 (file)
@@ -91,7 +91,7 @@ static int omap_setup_layer_(int fd, int enabled, int x, int y, int w, int h, in
        }
 
        if (first_call) {
-               mi.size = 640*512*2*3;
+               mi.size = 640*512*3*3;
                ret = ioctl(fd, OMAPFB_SETUP_MEM, &mi);
                if (ret != 0) {
                        perror("SETUP_MEM");
@@ -122,6 +122,10 @@ int omap_enable_layer(int enabled)
 
 void plat_video_menu_enter(int is_rom_loaded)
 {
+       g_menuscreen_ptr = vout_fbdev_resize(main_fb,
+               g_menuscreen_w, g_menuscreen_h, 16, 0, 0, 0, 0, 3);
+       if (g_menuscreen_ptr == NULL)
+               fprintf(stderr, "warning: vout_fbdev_resize failed\n");
 }
 
 void plat_video_menu_begin(void)
@@ -133,6 +137,17 @@ void plat_video_menu_end(void)
        g_menuscreen_ptr = vout_fbdev_flip(main_fb);
 }
 
+void plat_video_menu_leave(void)
+{
+       /* have to get rid of panning so that plugins that
+        * use fb0 and don't ever pan can work. */
+       vout_fbdev_clear(main_fb);
+       g_menuscreen_ptr = vout_fbdev_resize(main_fb,
+               g_menuscreen_w, g_menuscreen_h, 16, 0, 0, 0, 0, 1);
+       if (g_menuscreen_ptr == NULL)
+               fprintf(stderr, "warning: vout_fbdev_resize failed\n");
+}
+
 void plat_init(void)
 {
        const char *main_fb_name, *layer_fb_name;
@@ -155,7 +170,7 @@ void plat_init(void)
                exit(1);
        }
 
-       ret = omap_setup_layer_(fd, 1, g_layer_x, g_layer_y, g_layer_w, g_layer_h, 1);
+       ret = omap_setup_layer_(fd, 0, g_layer_x, g_layer_y, g_layer_w, g_layer_h, 1);
        close(fd);
        if (ret != 0) {
                fprintf(stderr, "failed to set up layer, exiting.\n");
@@ -189,7 +204,6 @@ void plat_init(void)
                goto fail1;
        }
        g_menubg_ptr = temp_frame;
-       g_menubg_src_ptr = temp_frame;
 
        in_set_config(in_name_to_id("evdev:gpio-keys"), IN_CFG_KEY_NAMES,
                      pandora_gpio_keys, sizeof(pandora_gpio_keys));