summaryrefslogtreecommitdiff
path: root/firmware/target/arm/lcd-ssd1815.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-03-21 18:54:52 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2022-03-21 23:53:48 -0400
commitcfeeb7889d5346e2abaf9b198375df62c58b098f (patch)
treef9956033372abe7d8bffa4e04bef0662dfb0da02 /firmware/target/arm/lcd-ssd1815.c
parent60e5786b481a26ca7c0c810d812bf5664a58cb44 (diff)
downloadrockbox-cfeeb7889d5346e2abaf9b198375df62c58b098f.tar.gz
rockbox-cfeeb7889d5346e2abaf9b198375df62c58b098f.zip
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
Diffstat (limited to 'firmware/target/arm/lcd-ssd1815.c')
-rw-r--r--firmware/target/arm/lcd-ssd1815.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/arm/lcd-ssd1815.c b/firmware/target/arm/lcd-ssd1815.c
index 028362f91c..0af20cd34f 100644
--- a/firmware/target/arm/lcd-ssd1815.c
+++ b/firmware/target/arm/lcd-ssd1815.c
@@ -221,6 +221,7 @@ void lcd_update(void)
221{ 221{
222 int y; 222 int y;
223 223
224 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
224 /* Copy display bitmap to hardware */ 225 /* Copy display bitmap to hardware */
225 for (y = 0; y < LCD_FBHEIGHT; y++) 226 for (y = 0; y < LCD_FBHEIGHT; y++)
226 { 227 {
@@ -228,7 +229,7 @@ void lcd_update(void)
228 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); 229 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
229 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf)); 230 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
230 231
231 lcd_write_data (FBADDR(0, y), LCD_WIDTH); 232 lcd_write_data (fbaddr(0,y), LCD_WIDTH);
232 } 233 }
233} 234}
234 235
@@ -249,6 +250,7 @@ void lcd_update_rect(int x, int y, int width, int height)
249 if(ymax >= LCD_FBHEIGHT) 250 if(ymax >= LCD_FBHEIGHT)
250 ymax = LCD_FBHEIGHT-1; 251 ymax = LCD_FBHEIGHT-1;
251 252
253 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
252 /* Copy specified rectange bitmap to hardware */ 254 /* Copy specified rectange bitmap to hardware */
253 for (; y <= ymax; y++) 255 for (; y <= ymax; y++)
254 { 256 {
@@ -256,6 +258,6 @@ void lcd_update_rect(int x, int y, int width, int height)
256 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); 258 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
257 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); 259 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
258 260
259 lcd_write_data (FBADDR(x,y), width); 261 lcd_write_data (fbaddr(x,y), width);
260 } 262 }
261} 263}