1 Apr 2009 07:17
kkurbjun: r20600 - in trunk: apps apps/plugins/mpegplayer firmware/export firmware/target/arm/tms320dm320/mrobe-500
<mailer <at> svn.rockbox.org>
2009-04-01 05:17:20 GMT
2009-04-01 05:17:20 GMT
Date: 2009-04-01 07:17:20 +0200 (Wed, 01 Apr 2009)
New Revision: 20600
Log Message:
Add initial support for changing the LCD mode in MPEG player for hardware YUV conversion (256 color palette
mode will also be added for doom and rockboy). This fixes the LCD mode/colors when MPEGPlayer exits.
Modified:
trunk/apps/plugin.c
trunk/apps/plugin.h
trunk/apps/plugins/mpegplayer/mpegplayer.c
trunk/firmware/export/config-mrobe500.h
trunk/firmware/export/lcd.h
trunk/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
Modified: trunk/apps/plugin.c
===================================================================
--- trunk/apps/plugin.c 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/apps/plugin.c 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -633,6 +633,10 <at> <at>
appsversion,
/* new stuff at the end, sort into place next time
the API gets incompatible */
+
+#if defined(HAVE_LCD_MODES)
+ lcd_set_mode,
+#endif
};
int plugin_load(const char* plugin, const void* parameter)
Modified: trunk/apps/plugin.h
===================================================================
--- trunk/apps/plugin.h 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/apps/plugin.h 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -791,6 +791,10 <at> <at>
const char *appsversion;
/* new stuff at the end, sort into place next time
the API gets incompatible */
+
+#if defined(HAVE_LCD_MODES)
+ void (*lcd_set_mode)(int mode);
+#endif
};
/* plugin header */
Modified: trunk/apps/plugins/mpegplayer/mpegplayer.c
===================================================================
--- trunk/apps/plugins/mpegplayer/mpegplayer.c 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/apps/plugins/mpegplayer/mpegplayer.c 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -1459,6 +1459,10 <at> <at>
rb->lcd_clear_display();
rb->lcd_update();
+#if (HAVE_LCD_MODES & LCD_MODE_YUV)
+ rb->lcd_set_mode(LCD_MODE_YUV);
+#endif
+
wvs_init();
/* Start playback at the specified starting time */
<at> <at> -1537,6 +1541,10 <at> <at>
stream_show_vo(false);
wvs_backlight_brightness_video_mode(false);
+#if (HAVE_LCD_MODES & LCD_MODE_YUV)
+ rb->lcd_set_mode(LCD_MODE_RGB565);
+#endif
+
result = mpeg_menu(0);
/* The menu can change the font, so restore */
<at> <at> -1549,6 +1557,9 <at> <at>
break;
default:
+#if (HAVE_LCD_MODES & LCD_MODE_YUV)
+ rb->lcd_set_mode(LCD_MODE_YUV);
+#endif
/* If not stopped, show video again */
if (state != STREAM_STOPPED) {
wvs_show(WVS_SHOW);
<at> <at> -1707,6 +1718,10 <at> <at>
rb->splashf(HZ*2, errstring, err);
}
}
+
+#if (HAVE_LCD_MODES & LCD_MODE_YUV)
+ rb->lcd_set_mode(LCD_MODE_RGB565);
+#endif
stream_exit();
Modified: trunk/firmware/export/config-mrobe500.h
===================================================================
--- trunk/firmware/export/config-mrobe500.h 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/firmware/export/config-mrobe500.h 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -44,6 +44,8 <at> <at>
/* define this if you want album art for this target */
//#define HAVE_ALBUMART
+#define HAVE_LCD_MODES LCD_MODE_RGB565 | LCD_MODE_YUV | LCD_MODE_PAL256
+
/* define this if you have access to the quickscreen */
#define HAVE_QUICKSCREEN
Modified: trunk/firmware/export/lcd.h
===================================================================
--- trunk/firmware/export/lcd.h 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/firmware/export/lcd.h 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -92,6 +92,13 <at> <at>
typedef unsigned char fb_data;
#endif
+#if defined(HAVE_LCD_MODES)
+void lcd_set_mode(int mode);
+#define LCD_MODE_RGB565 0x00000001
+#define LCD_MODE_YUV 0x00000002
+#define LCD_MODE_PAL256 0x00000004
+#endif
+
/* common functions */
extern void lcd_write_command(int byte);
extern void lcd_write_command_e(int cmd, int data);
Modified: trunk/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
===================================================================
--- trunk/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c 2009-04-01 03:54:48 UTC (rev 20599)
+++ trunk/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c 2009-04-01 05:17:20 UTC (rev 20600)
<at> <at> -256,6 +256,7 <at> <at>
{
if (!lcd_on)
return;
+
#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
lcd_copy_buffer_rect((fb_data *)FRAME, &lcd_framebuffer[0][0],
LCD_WIDTH*LCD_HEIGHT, 1);
<at> <at> -264,6 +265,30 <at> <at>
#endif
}
+#if defined(HAVE_LCD_MODES)
+void lcd_set_mode(int mode)
+{
+ if(mode==LCD_MODE_YUV)
+ {
+ /* Turn off the RGB buffer and enable the YUV buffer */
+ IO_OSD_OSDWINMD0&=~(0x01);
+ IO_OSD_VIDWINMD|=0x01;
+ memset16(FRAME, 0x0080, LCD_WIDTH*LCD_HEIGHT);
+ }
+ else if(mode==LCD_MODE_RGB565)
+ {
+ /* Turn on the RGB window and the YUV window off (This should probably be
+ * made into a function).
+ */
+ IO_OSD_OSDWINMD0|=0x01;
+ IO_OSD_VIDWINMD&=~(0x01);
+ }
+ else if(mode==LCD_MODE_PAL256)
+ {
+ }
+}
+#endif
+
void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride,
int x, int y, int width,
<at> <at> -280,13 +305,9 <at> <at>
unsigned char const * yuv_src[3];
off_t z;
- /* Turn off the RGB buffer and enable the YUV buffer */
- IO_OSD_OSDWINMD0&=~(0x01);
- IO_OSD_VIDWINMD|=0x01;
-
if (!lcd_on)
return;
-
+
/* y has to be at multiple of 2 or else it will mess up the HW (interleaving) */
y &= ~1;
_______________________________________________
rockbox-cvs mailing list
rockbox-cvs <at> cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
RSS Feed