summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
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/as3525
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/as3525')
-rw-r--r--firmware/target/arm/as3525/lcd-ssd1303.c3
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/arm/as3525/lcd-ssd1303.c b/firmware/target/arm/as3525/lcd-ssd1303.c
index 2aa0b844c5..186fdcacbe 100644
--- a/firmware/target/arm/as3525/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/lcd-ssd1303.c
@@ -310,6 +310,7 @@ static void internal_update_rect(int x, int y, int width, int height)
310 const int column_high = get_column_high_byte(x); 310 const int column_high = get_column_high_byte(x);
311 const int column_low = get_column_low_byte(x); 311 const int column_low = get_column_low_byte(x);
312 312
313 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
313 /* Copy specified rectange bitmap to hardware */ 314 /* Copy specified rectange bitmap to hardware */
314 for (; y <= height; y++) 315 for (; y <= height; y++)
315 { 316 {
@@ -320,7 +321,7 @@ static void internal_update_rect(int x, int y, int width, int height)
320 (column_low) 321 (column_low)
321 ); 322 );
322 323
323 lcd_write_data (FBADDR(x,y), width); 324 lcd_write_data (fbaddr(x,y), width);
324 } 325 }
325 lcd_write_command (LCD_NOP); /* return to command mode */ 326 lcd_write_command (LCD_NOP); /* return to command mode */
326 327
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 03ed1de5d5..48594a2ac9 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -440,9 +440,10 @@ void lcd_update_rect(int x, int y, int width, int height)
440 /* setup GRAM write window */ 440 /* setup GRAM write window */
441 lcd_setup_rect(x, x_end - 1, y, y_end - 1); 441 lcd_setup_rect(x, x_end - 1, y, y_end - 1);
442 442
443 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
443 /* write to GRAM */ 444 /* write to GRAM */
444 for (row = y; row < y_end; row++) { 445 for (row = y; row < y_end; row++) {
445 lcd_write_data(FBADDR(x,row), width); 446 lcd_write_data(fbaddr(x,row), width);
446 } 447 }
447} 448}
448 449