summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-12-12 15:01:36 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-12-12 15:01:36 +0000
commitd192bdf11e06e50645ecb5726658d4b691480a9a (patch)
treec1ed6cf295815ffd89de3b3583c21c55ca2ab2ea
parent9da76f3031a91d24167c93dd818eeaea6a9f0a67 (diff)
downloadrockbox-d192bdf11e06e50645ecb5726658d4b691480a9a.tar.gz
rockbox-d192bdf11e06e50645ecb5726658d4b691480a9a.zip
FS#11708 - Major speedup of iPod nano 2G. Part 1: Loop unrolling and reduction of FIFO register polling. +50% for RGB, +34% for YUV.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28809 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
index 195953979e..5bda9e7387 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
@@ -417,10 +417,8 @@ void lcd_init_device(void)
417 417
418static inline void lcd_write_pixel(fb_data pixel) 418static inline void lcd_write_pixel(fb_data pixel)
419{ 419{
420 while (LCD_STATUS & 0x10); 420 LCD_WDATA = pixel >> 8;
421 LCD_WDATA = (pixel & 0xff00) >> 8; 421 LCD_WDATA = pixel; /* no need to &0xff here, only lower 8 bit used */
422 while (LCD_STATUS & 0x10);
423 LCD_WDATA = pixel & 0xff;
424} 422}
425 423
426/* Update the display. 424/* Update the display.
@@ -435,9 +433,10 @@ void lcd_update(void)
435void lcd_update_rect(int, int, int, int) ICODE_ATTR; 433void lcd_update_rect(int, int, int, int) ICODE_ATTR;
436void lcd_update_rect(int x, int y, int width, int height) 434void lcd_update_rect(int x, int y, int width, int height)
437{ 435{
438 int xx,yy;
439 int y0, x0, y1, x1; 436 int y0, x0, y1, x1;
440 fb_data* p; 437 fb_data* p;
438
439 width = (width + 1) & ~1; /* ensure width is even */
441 440
442 x0 = x; /* start horiz */ 441 x0 = x; /* start horiz */
443 y0 = y; /* start vert */ 442 y0 = y; /* start vert */
@@ -467,15 +466,29 @@ void lcd_update_rect(int x, int y, int width, int height)
467 s5l_lcd_write_cmd(R_MEMORY_WRITE); 466 s5l_lcd_write_cmd(R_MEMORY_WRITE);
468 } 467 }
469 468
470
471 /* Copy display bitmap to hardware */ 469 /* Copy display bitmap to hardware */
472 p = &lcd_framebuffer[y0][x0]; 470 p = &lcd_framebuffer[y0][x0];
473 yy = height; 471 if (LCD_WIDTH == width)
474 for (yy = y0; yy <= y1; yy++) { 472 {
475 for (xx = x0; xx <= x1; xx++) { 473 x1 = height*LCD_WIDTH/4;
474 do {
475 while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
476 lcd_write_pixel(*(p++)); 476 lcd_write_pixel(*(p++));
477 } 477 lcd_write_pixel(*(p++));
478 p += LCD_WIDTH - width; 478 lcd_write_pixel(*(p++));
479 lcd_write_pixel(*(p++));
480 } while (--x1 > 0);
481 } else {
482 y1 = height;
483 do {
484 x1 = width/2; /* width is forced to even to allow speed up */
485 do {
486 while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
487 lcd_write_pixel(*(p++));
488 lcd_write_pixel(*(p++));
489 } while (--x1 > 0 );
490 p += LCD_WIDTH - width;
491 } while (--y1 > 0 );
479 } 492 }
480} 493}
481 494
@@ -616,6 +629,7 @@ void lcd_blit_yuv(unsigned char * const src[3],
616 } 629 }
617 630
618 /* output 2 pixels */ 631 /* output 2 pixels */
632 while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
619 lcd_write_pixel((red1 << 11) | (green1 << 5) | blue1); 633 lcd_write_pixel((red1 << 11) | (green1 << 5) | blue1);
620 lcd_write_pixel((red2 << 11) | (green2 << 5) | blue2); 634 lcd_write_pixel((red2 << 11) | (green2 << 5) | blue2);
621 } 635 }