summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-06-21 14:09:48 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-06-21 14:09:48 +0000
commita98c54f5f121f6323cb230e44b9f1b8d40b07283 (patch)
treeaa313998e0e59231b1bea4bb5cc790632a05dd46
parent04451b436972de653804d0a178de648093453d53 (diff)
downloadrockbox-a98c54f5f121f6323cb230e44b9f1b8d40b07283.zip
rockbox-a98c54f5f121f6323cb230e44b9f1b8d40b07283.tar.gz
rockbox-a98c54f5f121f6323cb230e44b9f1b8d40b07283.tar.bz2
rockbox-a98c54f5f121f6323cb230e44b9f1b8d40b07283.tar.xz
Do not use lcd_blit_yuv() if MEMORYSIZE <= 2, since mpegplayer won't run anyway (and won't build)
Only affected target: Sansa c200v2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21453 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h6
-rw-r--r--apps/plugins/test_fps.c4
-rw-r--r--firmware/export/lcd.h2
-rw-r--r--firmware/target/arm/lcd-c200_c200v2.c18
5 files changed, 16 insertions, 16 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index c4e5a0b..20c7a37 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -126,11 +126,13 @@ static const struct plugin_api rockbox_api = {
#if LCD_DEPTH == 16
lcd_bitmap_transparent_part,
lcd_bitmap_transparent,
+#if MEMORYSIZE > 2
lcd_blit_yuv,
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|| defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2)
lcd_yuv_set_options,
#endif
+#endif /* MEMORYSIZE > 2 */
#elif (LCD_DEPTH < 4) && !defined(SIMULATOR)
lcd_blit_mono,
lcd_blit_grey_phase,
diff --git a/apps/plugin.h b/apps/plugin.h
index 105be0b..2a5b682 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 155
+#define PLUGIN_API_VERSION 156
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 151
+#define PLUGIN_MIN_API_VERSION 156
/* plugin return codes */
enum plugin_status {
@@ -205,6 +205,7 @@ struct plugin_api {
int x, int y, int width, int height);
void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y,
int width, int height);
+#if MEMORYSIZE > 2
void (*lcd_blit_yuv)(unsigned char * const src[3],
int src_x, int src_y, int stride,
int x, int y, int width, int height);
@@ -212,6 +213,7 @@ struct plugin_api {
|| defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2)
void (*lcd_yuv_set_options)(unsigned options);
#endif
+#endif /* MEMORYSIZE > 2 */
#elif (LCD_DEPTH < 4) && !defined(SIMULATOR)
void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width,
int bheight, int stride);
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c
index cba08f2..ddbd51c 100644
--- a/apps/plugins/test_fps.c
+++ b/apps/plugins/test_fps.c
@@ -132,7 +132,7 @@ static void time_main_update(void)
log_text(str);
}
-#ifdef HAVE_LCD_COLOR
+#if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2)
#if LCD_WIDTH >= LCD_HEIGHT
#define YUV_WIDTH LCD_WIDTH
@@ -353,7 +353,7 @@ enum plugin_status plugin_start(const void* parameter)
log_text("Main LCD Update");
time_main_update();
-#ifdef HAVE_LCD_COLOR
+#if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2)
log_text("Main LCD YUV");
time_main_yuv();
#endif
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 870a9d3..11fcc98 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -151,11 +151,13 @@ extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string,
/* performance function */
#if defined(HAVE_LCD_COLOR)
+#if MEMORYSIZE > 2
#define LCD_YUV_DITHER 0x1
extern void lcd_yuv_set_options(unsigned options);
extern void lcd_blit_yuv(unsigned char * const src[3],
int src_x, int src_y, int stride,
int x, int y, int width, int height);
+#endif /* MEMORYSIZE > 2 */
#else
extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
int bheight, int stride);
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c
index 619a03b..6665d6a 100644
--- a/firmware/target/arm/lcd-c200_c200v2.c
+++ b/firmware/target/arm/lcd-c200_c200v2.c
@@ -30,7 +30,9 @@ static bool lcd_busy = false;
#endif
/* Display status */
+#if MEMORYSIZE > 2
static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0;
+#endif
static bool is_lcd_enabled = true;
/* LCD command set for Samsung S6B33B2 */
@@ -328,6 +330,7 @@ void lcd_set_flip(bool yesno)
/*** update functions ***/
+#if MEMORYSIZE > 2
void lcd_yuv_set_options(unsigned options)
{
lcd_yuv_options = options;
@@ -350,10 +353,6 @@ void lcd_blit_yuv(unsigned char * const src[3],
unsigned char const * yuv_src[3];
off_t z;
-#ifdef SANSA_C200V2
- lcd_busy = true;
-#endif
-
/* Sorry, but width and height must be >= 2 or else */
width &= ~1;
height >>= 1;
@@ -377,9 +376,8 @@ void lcd_blit_yuv(unsigned char * const src[3],
lcd_send_command(R_Y_ADDR_AREA, y);
lcd_send_command(y + 1, 0);
-#ifndef SANSA_C200V2 // TODO
lcd_write_yuv420_lines_odither(yuv_src, width, stride, x, y);
-#endif
+
yuv_src[0] += stride << 1; /* Skip down two luma lines */
yuv_src[1] += stride >> 1; /* Skip down one chroma line */
yuv_src[2] += stride >> 1;
@@ -394,9 +392,8 @@ void lcd_blit_yuv(unsigned char * const src[3],
lcd_send_command(R_Y_ADDR_AREA, y);
lcd_send_command(y + 1, 0);
-#ifndef SANSA_C200V2 // TODO
lcd_write_yuv420_lines(yuv_src, width, stride);
-#endif
+
yuv_src[0] += stride << 1; /* Skip down two luma lines */
yuv_src[1] += stride >> 1; /* Skip down one chroma line */
yuv_src[2] += stride >> 1;
@@ -404,11 +401,8 @@ void lcd_blit_yuv(unsigned char * const src[3],
}
while (--height > 0);
}
-
-#ifdef SANSA_C200V2
- lcd_busy = false;
-#endif
}
+#endif /* MEMORYSIZE > 2 */
/* Update the display.
This must be called after all other LCD functions that change the display. */