summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-11-15 15:37:00 +0000
committerDave Chapman <dave@dchapman.com>2005-11-15 15:37:00 +0000
commitc2678666756d8875cdb647dd8de9560c7f547fc2 (patch)
tree34a236af898cbdc9e26fddfd8bfb6d08df084fa5 /firmware/drivers
parent1a316d655b2dcc4b8498592898ae8d418dcb53e8 (diff)
Small optimisation to the lcd_update_rect function - read the framebuffer data as a 32-bit word
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7895 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/lcd-ipod.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c
index 30cd4555ae..69272ccccf 100644
--- a/firmware/drivers/lcd-ipod.c
+++ b/firmware/drivers/lcd-ipod.c
@@ -221,8 +221,11 @@ void lcd_update_rect(int x, int y, int width, int height)
{
int rect1, rect2, rect3, rect4;
- unsigned short *addr = (unsigned short *)lcd_framebuffer;
+ unsigned long *addr = (unsigned long *)lcd_framebuffer;
+ /* TODO: Ensure x is even - so we read 32-bit aligned data from
+ lcd_framebuffer */
+
/* calculate the drawing region */
#if CONFIG_LCD == LCD_IPODCOLOR
rect1 = x; /* start vert */
@@ -277,7 +280,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_send_lo(0x22);
}
- addr += x * LCD_WIDTH + y;
+ addr += x * LCD_WIDTH + y/2;
while (height > 0) {
int c, r;
@@ -300,18 +303,13 @@ void lcd_update_rect(int x, int y, int width, int height)
for (r = 0; r < h; r++) {
/* for each column */
for (c = 0; c < width; c += 2) {
- unsigned two_pixels;
-
- two_pixels = addr[0] | (addr[1] << 16);
- addr += 2;
-
while ((inl(0x70008a20) & 0x1000000) == 0);
/* output 2 pixels */
- outl(two_pixels, 0x70008b00);
+ outl(*(addr++), 0x70008b00);
}
- addr += LCD_WIDTH - width;
+ addr += (LCD_WIDTH - width)/2;
}
while ((inl(0x70008a20) & 0x4000000) == 0);