diff options
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 6 | ||||
-rw-r--r-- | apps/plugins/test_fps.c | 4 | ||||
-rw-r--r-- | firmware/export/lcd.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/lcd-c200_c200v2.c | 18 |
5 files changed, 16 insertions, 16 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index c4e5a0bb0f..20c7a3733c 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -126,11 +126,13 @@ static const struct plugin_api rockbox_api = { | |||
126 | #if LCD_DEPTH == 16 | 126 | #if LCD_DEPTH == 16 |
127 | lcd_bitmap_transparent_part, | 127 | lcd_bitmap_transparent_part, |
128 | lcd_bitmap_transparent, | 128 | lcd_bitmap_transparent, |
129 | #if MEMORYSIZE > 2 | ||
129 | lcd_blit_yuv, | 130 | lcd_blit_yuv, |
130 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ | 131 | #if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \ |
131 | || defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2) | 132 | || defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2) |
132 | lcd_yuv_set_options, | 133 | lcd_yuv_set_options, |
133 | #endif | 134 | #endif |
135 | #endif /* MEMORYSIZE > 2 */ | ||
134 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) | 136 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) |
135 | lcd_blit_mono, | 137 | lcd_blit_mono, |
136 | lcd_blit_grey_phase, | 138 | lcd_blit_grey_phase, |
diff --git a/apps/plugin.h b/apps/plugin.h index 105be0bfe2..2a5b6829c0 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -128,12 +128,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
128 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 128 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
129 | 129 | ||
130 | /* increase this every time the api struct changes */ | 130 | /* increase this every time the api struct changes */ |
131 | #define PLUGIN_API_VERSION 155 | 131 | #define PLUGIN_API_VERSION 156 |
132 | 132 | ||
133 | /* update this to latest version if a change to the api struct breaks | 133 | /* update this to latest version if a change to the api struct breaks |
134 | backwards compatibility (and please take the opportunity to sort in any | 134 | backwards compatibility (and please take the opportunity to sort in any |
135 | new function which are "waiting" at the end of the function table) */ | 135 | new function which are "waiting" at the end of the function table) */ |
136 | #define PLUGIN_MIN_API_VERSION 151 | 136 | #define PLUGIN_MIN_API_VERSION 156 |
137 | 137 | ||
138 | /* plugin return codes */ | 138 | /* plugin return codes */ |
139 | enum plugin_status { | 139 | enum plugin_status { |
@@ -205,6 +205,7 @@ struct plugin_api { | |||
205 | int x, int y, int width, int height); | 205 | int x, int y, int width, int height); |
206 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, | 206 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, |
207 | int width, int height); | 207 | int width, int height); |
208 | #if MEMORYSIZE > 2 | ||
208 | void (*lcd_blit_yuv)(unsigned char * const src[3], | 209 | void (*lcd_blit_yuv)(unsigned char * const src[3], |
209 | int src_x, int src_y, int stride, | 210 | int src_x, int src_y, int stride, |
210 | int x, int y, int width, int height); | 211 | int x, int y, int width, int height); |
@@ -212,6 +213,7 @@ struct plugin_api { | |||
212 | || defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2) | 213 | || defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) || defined(SANSA_FUZE) || defined(SANSA_E200V2) |
213 | void (*lcd_yuv_set_options)(unsigned options); | 214 | void (*lcd_yuv_set_options)(unsigned options); |
214 | #endif | 215 | #endif |
216 | #endif /* MEMORYSIZE > 2 */ | ||
215 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) | 217 | #elif (LCD_DEPTH < 4) && !defined(SIMULATOR) |
216 | void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, | 218 | void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width, |
217 | int bheight, int stride); | 219 | int bheight, int stride); |
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index cba08f28d1..ddbd51c00b 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -132,7 +132,7 @@ static void time_main_update(void) | |||
132 | log_text(str); | 132 | log_text(str); |
133 | } | 133 | } |
134 | 134 | ||
135 | #ifdef HAVE_LCD_COLOR | 135 | #if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2) |
136 | 136 | ||
137 | #if LCD_WIDTH >= LCD_HEIGHT | 137 | #if LCD_WIDTH >= LCD_HEIGHT |
138 | #define YUV_WIDTH LCD_WIDTH | 138 | #define YUV_WIDTH LCD_WIDTH |
@@ -353,7 +353,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
353 | 353 | ||
354 | log_text("Main LCD Update"); | 354 | log_text("Main LCD Update"); |
355 | time_main_update(); | 355 | time_main_update(); |
356 | #ifdef HAVE_LCD_COLOR | 356 | #if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2) |
357 | log_text("Main LCD YUV"); | 357 | log_text("Main LCD YUV"); |
358 | time_main_yuv(); | 358 | time_main_yuv(); |
359 | #endif | 359 | #endif |
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 870a9d3f61..11fcc98a66 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, | |||
151 | 151 | ||
152 | /* performance function */ | 152 | /* performance function */ |
153 | #if defined(HAVE_LCD_COLOR) | 153 | #if defined(HAVE_LCD_COLOR) |
154 | #if MEMORYSIZE > 2 | ||
154 | #define LCD_YUV_DITHER 0x1 | 155 | #define LCD_YUV_DITHER 0x1 |
155 | extern void lcd_yuv_set_options(unsigned options); | 156 | extern void lcd_yuv_set_options(unsigned options); |
156 | extern void lcd_blit_yuv(unsigned char * const src[3], | 157 | extern void lcd_blit_yuv(unsigned char * const src[3], |
157 | int src_x, int src_y, int stride, | 158 | int src_x, int src_y, int stride, |
158 | int x, int y, int width, int height); | 159 | int x, int y, int width, int height); |
160 | #endif /* MEMORYSIZE > 2 */ | ||
159 | #else | 161 | #else |
160 | extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | 162 | extern void lcd_blit_mono(const unsigned char *data, int x, int by, int width, |
161 | int bheight, int stride); | 163 | int bheight, int stride); |
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c index 619a03b61e..6665d6ab33 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; | |||
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | /* Display status */ | 32 | /* Display status */ |
33 | #if MEMORYSIZE > 2 | ||
33 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; | 34 | static unsigned lcd_yuv_options SHAREDBSS_ATTR = 0; |
35 | #endif | ||
34 | static bool is_lcd_enabled = true; | 36 | static bool is_lcd_enabled = true; |
35 | 37 | ||
36 | /* LCD command set for Samsung S6B33B2 */ | 38 | /* LCD command set for Samsung S6B33B2 */ |
@@ -328,6 +330,7 @@ void lcd_set_flip(bool yesno) | |||
328 | 330 | ||
329 | /*** update functions ***/ | 331 | /*** update functions ***/ |
330 | 332 | ||
333 | #if MEMORYSIZE > 2 | ||
331 | void lcd_yuv_set_options(unsigned options) | 334 | void lcd_yuv_set_options(unsigned options) |
332 | { | 335 | { |
333 | lcd_yuv_options = options; | 336 | lcd_yuv_options = options; |
@@ -350,10 +353,6 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
350 | unsigned char const * yuv_src[3]; | 353 | unsigned char const * yuv_src[3]; |
351 | off_t z; | 354 | off_t z; |
352 | 355 | ||
353 | #ifdef SANSA_C200V2 | ||
354 | lcd_busy = true; | ||
355 | #endif | ||
356 | |||
357 | /* Sorry, but width and height must be >= 2 or else */ | 356 | /* Sorry, but width and height must be >= 2 or else */ |
358 | width &= ~1; | 357 | width &= ~1; |
359 | height >>= 1; | 358 | height >>= 1; |
@@ -377,9 +376,8 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
377 | lcd_send_command(R_Y_ADDR_AREA, y); | 376 | lcd_send_command(R_Y_ADDR_AREA, y); |
378 | lcd_send_command(y + 1, 0); | 377 | lcd_send_command(y + 1, 0); |
379 | 378 | ||
380 | #ifndef SANSA_C200V2 // TODO | ||
381 | lcd_write_yuv420_lines_odither(yuv_src, width, stride, x, y); | 379 | lcd_write_yuv420_lines_odither(yuv_src, width, stride, x, y); |
382 | #endif | 380 | |
383 | yuv_src[0] += stride << 1; /* Skip down two luma lines */ | 381 | yuv_src[0] += stride << 1; /* Skip down two luma lines */ |
384 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ | 382 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ |
385 | yuv_src[2] += stride >> 1; | 383 | yuv_src[2] += stride >> 1; |
@@ -394,9 +392,8 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
394 | lcd_send_command(R_Y_ADDR_AREA, y); | 392 | lcd_send_command(R_Y_ADDR_AREA, y); |
395 | lcd_send_command(y + 1, 0); | 393 | lcd_send_command(y + 1, 0); |
396 | 394 | ||
397 | #ifndef SANSA_C200V2 // TODO | ||
398 | lcd_write_yuv420_lines(yuv_src, width, stride); | 395 | lcd_write_yuv420_lines(yuv_src, width, stride); |
399 | #endif | 396 | |
400 | yuv_src[0] += stride << 1; /* Skip down two luma lines */ | 397 | yuv_src[0] += stride << 1; /* Skip down two luma lines */ |
401 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ | 398 | yuv_src[1] += stride >> 1; /* Skip down one chroma line */ |
402 | yuv_src[2] += stride >> 1; | 399 | yuv_src[2] += stride >> 1; |
@@ -404,11 +401,8 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
404 | } | 401 | } |
405 | while (--height > 0); | 402 | while (--height > 0); |
406 | } | 403 | } |
407 | |||
408 | #ifdef SANSA_C200V2 | ||
409 | lcd_busy = false; | ||
410 | #endif | ||
411 | } | 404 | } |
405 | #endif /* MEMORYSIZE > 2 */ | ||
412 | 406 | ||
413 | /* Update the display. | 407 | /* Update the display. |
414 | This must be called after all other LCD functions that change the display. */ | 408 | This must be called after all other LCD functions that change the display. */ |