1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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);
         }