mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
Lcd save function pointer to frame buffer get_address_fn before loops
Calling multiple levels of indirection in a loop slows things down Really these need to be rewritten to take a start and end address like most of the rest of the codebase But this is safer without having test hardware in hand Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
This commit is contained in:
parent
60e5786b48
commit
cfeeb7889d
23 changed files with 78 additions and 40 deletions
|
|
@ -258,6 +258,7 @@ void lcd_update(void)
|
|||
int y;
|
||||
if (initialized)
|
||||
{
|
||||
void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
|
||||
for(y = 0;y < LCD_FBHEIGHT;y++)
|
||||
{
|
||||
/* Copy display bitmap to hardware.
|
||||
|
|
@ -266,7 +267,7 @@ void lcd_update(void)
|
|||
have to update one page at a time. */
|
||||
lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
|
||||
lcd_write_command_e(LCD_SET_COLUMN | 0, 0);
|
||||
lcd_write_data(FBADDR(0, y), LCD_WIDTH);
|
||||
lcd_write_data(fbaddr(0,y), LCD_WIDTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -289,6 +290,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
|||
if(ymax >= LCD_FBHEIGHT)
|
||||
ymax = LCD_FBHEIGHT-1;
|
||||
|
||||
void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
|
||||
/* Copy specified rectangle bitmap to hardware
|
||||
COM48-COM63 are not connected, so we need to skip those */
|
||||
for (; y <= ymax; y++)
|
||||
|
|
@ -296,7 +298,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
|||
lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf));
|
||||
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
|
||||
|
||||
lcd_write_data(FBADDR(x,y), width);
|
||||
lcd_write_data(fbaddr(x,y), width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,6 +200,7 @@ void lcd_update(void)
|
|||
{
|
||||
int y;
|
||||
|
||||
void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
|
||||
/* Copy display bitmap to hardware */
|
||||
for (y = 0; y < LCD_FBHEIGHT; y++)
|
||||
{
|
||||
|
|
@ -207,7 +208,7 @@ void lcd_update(void)
|
|||
lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
|
||||
|
||||
lcd_write_command(LCD_CNTL_DATA_WRITE);
|
||||
lcd_write_data (FBADDR(0, y), LCD_WIDTH);
|
||||
lcd_write_data (fbaddr(0,y), LCD_WIDTH);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -228,6 +229,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
|||
if(ymax >= LCD_FBHEIGHT)
|
||||
ymax = LCD_FBHEIGHT-1;
|
||||
|
||||
void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
|
||||
/* Copy specified rectange bitmap to hardware */
|
||||
for (; y <= ymax; y++)
|
||||
{
|
||||
|
|
@ -235,6 +237,6 @@ void lcd_update_rect(int x, int y, int width, int height)
|
|||
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
|
||||
|
||||
lcd_write_command(LCD_CNTL_DATA_WRITE);
|
||||
lcd_write_data (FBADDR(x,y), width);
|
||||
lcd_write_data (fbaddr(x,y), width);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue