diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-03-21 18:54:52 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2022-03-21 23:53:48 -0400 |
commit | cfeeb7889d5346e2abaf9b198375df62c58b098f (patch) | |
tree | f9956033372abe7d8bffa4e04bef0662dfb0da02 /firmware/target/coldfire/iaudio/m5 | |
parent | 60e5786b481a26ca7c0c810d812bf5664a58cb44 (diff) | |
download | rockbox-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/coldfire/iaudio/m5')
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/lcd-m5.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/coldfire/iaudio/m5/lcd-m5.c b/firmware/target/coldfire/iaudio/m5/lcd-m5.c index 8f022adf96..35fd173f18 100644 --- a/firmware/target/coldfire/iaudio/m5/lcd-m5.c +++ b/firmware/target/coldfire/iaudio/m5/lcd-m5.c | |||
@@ -200,6 +200,7 @@ void lcd_update(void) | |||
200 | { | 200 | { |
201 | int y; | 201 | int y; |
202 | 202 | ||
203 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
203 | /* Copy display bitmap to hardware */ | 204 | /* Copy display bitmap to hardware */ |
204 | for (y = 0; y < LCD_FBHEIGHT; y++) | 205 | for (y = 0; y < LCD_FBHEIGHT; y++) |
205 | { | 206 | { |
@@ -207,7 +208,7 @@ void lcd_update(void) | |||
207 | lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1); | 208 | lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1); |
208 | 209 | ||
209 | lcd_write_command(LCD_CNTL_DATA_WRITE); | 210 | lcd_write_command(LCD_CNTL_DATA_WRITE); |
210 | lcd_write_data (FBADDR(0, y), LCD_WIDTH); | 211 | lcd_write_data (fbaddr(0,y), LCD_WIDTH); |
211 | } | 212 | } |
212 | } | 213 | } |
213 | 214 | ||
@@ -228,6 +229,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
228 | if(ymax >= LCD_FBHEIGHT) | 229 | if(ymax >= LCD_FBHEIGHT) |
229 | ymax = LCD_FBHEIGHT-1; | 230 | ymax = LCD_FBHEIGHT-1; |
230 | 231 | ||
232 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
231 | /* Copy specified rectange bitmap to hardware */ | 233 | /* Copy specified rectange bitmap to hardware */ |
232 | for (; y <= ymax; y++) | 234 | for (; y <= ymax; y++) |
233 | { | 235 | { |
@@ -235,6 +237,6 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
235 | lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); | 237 | lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); |
236 | 238 | ||
237 | lcd_write_command(LCD_CNTL_DATA_WRITE); | 239 | lcd_write_command(LCD_CNTL_DATA_WRITE); |
238 | lcd_write_data (FBADDR(x,y), width); | 240 | lcd_write_data (fbaddr(x,y), width); |
239 | } | 241 | } |
240 | } | 242 | } |