Index: firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
===================================================================
--- firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c (revision 28794)
+++ firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c (working copy)
@@ -417,9 +417,7 @@

static inline void lcd_write_pixel(fb_data pixel)
{
- while (LCD_STATUS & 0x10);
- LCD_WDATA = (pixel & 0xff00) >> 8;
- while (LCD_STATUS & 0x10);
+ LCD_WDATA = pixel >> 8;
LCD_WDATA = pixel & 0xff;
}

@@ -470,12 +468,24 @@

/* Copy display bitmap to hardware */
p = &lcd_framebuffer[y0][x0];
- yy = height;
- for (yy = y0; yy <= y1; yy++) {
- for (xx = x0; xx <= x1; xx++) {
+ if (LCD_WIDTH == width)
+ {
+ x1 = height*LCD_WIDTH/4;
+ for (xx = 0; xx < x1; xx++) {
+ while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
lcd_write_pixel(*(p++));
+ lcd_write_pixel(*(p++));
+ lcd_write_pixel(*(p++));
+ lcd_write_pixel(*(p++));
}
- p += LCD_WIDTH - width;
+ } else {
+ for (yy = 0; yy < height; yy++) {
+ for (xx = 0; xx < width; xx++) {
+ while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
+ lcd_write_pixel(*(p++));
+ }
+ p += LCD_WIDTH - width;
+ }
}
}

@@ -616,6 +626,7 @@
}

/* output 2 pixels */
+ while (LCD_STATUS & 0x08); /* wait while FIFO is half full */
lcd_write_pixel((red1 << 11) | (green1 << 5) | blue1);
lcd_write_pixel((red2 << 11) | (green2 << 5) | blue2);
}