summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-ipodvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-ipodvideo.c')
-rw-r--r--firmware/drivers/lcd-ipodvideo.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-ipodvideo.c b/firmware/drivers/lcd-ipodvideo.c
index 1b9a604990..45ea7bbce0 100644
--- a/firmware/drivers/lcd-ipodvideo.c
+++ b/firmware/drivers/lcd-ipodvideo.c
@@ -153,9 +153,8 @@ void lcd_update_rect(int x, int y, int width, int height)
153 int rect1,rect2,rect3,rect4; 153 int rect1,rect2,rect3,rect4;
154 int newx,newwidth; 154 int newx,newwidth;
155 int count; 155 int count;
156 unsigned int curpixel=0;
157 int c, r; 156 int c, r;
158 unsigned long *addr; 157 unsigned short *src;
159 158
160 /* Ensure x and width are both even - so we can read 32-bit aligned 159 /* Ensure x and width are both even - so we can read 32-bit aligned
161 data from lcd_framebuffer */ 160 data from lcd_framebuffer */
@@ -174,18 +173,23 @@ void lcd_update_rect(int x, int y, int width, int height)
174 count=(width * height) << 1; 173 count=(width * height) << 1;
175 lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count); 174 lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count);
176 175
177 addr = (unsigned long*)&lcd_framebuffer[y][x]; 176 src = (unsigned short*)&lcd_framebuffer[y][x];
177
178 /* write out destination address as two 16bit values */
179 outw((0xE0020 & 0xffff), 0x30010000);
180 outw((0xE0020 >> 16), 0x30010000);
178 181
179 /* for each row */
180 for (r = 0; r < height; r++) { 182 for (r = 0; r < height; r++) {
181 /* for each column */ 183 /* for each column */
182 for (c = 0; c < width; c += 2) { 184 for (c = 0; c < width; c += 2) {
183 /* output 2 pixels */ 185 /* wait for it to be write ready */
184 lcd_bcm_write32(0xE0020 + (curpixel << 2), *(addr++)); 186 while ((inw(0x30030000) & 0x2) == 0);
185 curpixel++;
186 }
187 187
188 addr += (LCD_WIDTH - width)/2; 188 /* write out the value low 16, high 16 */
189 outw(*(src++), 0x30000000);
190 outw(*(src++), 0x30000000);
191 }
192 src += (LCD_WIDTH - width);
189 } 193 }
190 194
191 lcd_bcm_finishup(); 195 lcd_bcm_finishup();