summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-02-15 21:07:37 +0000
committerDave Chapman <dave@dchapman.com>2006-02-15 21:07:37 +0000
commitd935679ba69c0349623b39cc3251563c805753ca (patch)
treeb5ee5150e91b2bb29c9e7c93437a04bc62685b76
parent26e598d90e669a38d2d44379cd23031af6713463 (diff)
downloadrockbox-d935679ba69c0349623b39cc3251563c805753ca.zip
rockbox-d935679ba69c0349623b39cc3251563c805753ca.tar.gz
rockbox-d935679ba69c0349623b39cc3251563c805753ca.tar.bz2
rockbox-d935679ba69c0349623b39cc3251563c805753ca.tar.xz
iPod 5G: Further LCD driver optimisations - it is now working at 42fps for full-screen updates
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8696 a1c6a512-1295-4272-9138-f99709370657
-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 1b9a604..45ea7bb 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)
int rect1,rect2,rect3,rect4;
int newx,newwidth;
int count;
- unsigned int curpixel=0;
int c, r;
- unsigned long *addr;
+ unsigned short *src;
/* Ensure x and width are both even - so we can read 32-bit aligned
data from lcd_framebuffer */
@@ -174,18 +173,23 @@ void lcd_update_rect(int x, int y, int width, int height)
count=(width * height) << 1;
lcd_bcm_setup_rect(0x34, rect1, rect2, rect3, rect4, count);
- addr = (unsigned long*)&lcd_framebuffer[y][x];
+ src = (unsigned short*)&lcd_framebuffer[y][x];
+
+ /* write out destination address as two 16bit values */
+ outw((0xE0020 & 0xffff), 0x30010000);
+ outw((0xE0020 >> 16), 0x30010000);
- /* for each row */
for (r = 0; r < height; r++) {
/* for each column */
for (c = 0; c < width; c += 2) {
- /* output 2 pixels */
- lcd_bcm_write32(0xE0020 + (curpixel << 2), *(addr++));
- curpixel++;
- }
+ /* wait for it to be write ready */
+ while ((inw(0x30030000) & 0x2) == 0);
- addr += (LCD_WIDTH - width)/2;
+ /* write out the value low 16, high 16 */
+ outw(*(src++), 0x30000000);
+ outw(*(src++), 0x30000000);
+ }
+ src += (LCD_WIDTH - width);
}
lcd_bcm_finishup();