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/arm/s5l8700 | |
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/arm/s5l8700')
-rw-r--r-- | firmware/target/arm/s5l8700/yps3/lcd-yps3.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c index a9830bca57..eec11e34b8 100644 --- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c +++ b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c | |||
@@ -299,14 +299,15 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
299 | { | 299 | { |
300 | fb_data* p; | 300 | fb_data* p; |
301 | int h, w; | 301 | int h, w; |
302 | 302 | ||
303 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
303 | if (lcd_type == 1) { | 304 | if (lcd_type == 1) { |
304 | /* TODO implement and test */ | 305 | /* TODO implement and test */ |
305 | lcd_set_window1(x, y, width, height); | 306 | lcd_set_window1(x, y, width, height); |
306 | lcd_set_position1(x, y); | 307 | lcd_set_position1(x, y); |
307 | 308 | ||
308 | for (h = 0; h < height; h++) { | 309 | for (h = 0; h < height; h++) { |
309 | p = FBADDR(0,y); | 310 | p = fbaddr(0,y); |
310 | for (w = 0; w < LCD_WIDTH; w++) { | 311 | for (w = 0; w < LCD_WIDTH; w++) { |
311 | while (LCD_STATUS & 0x10); | 312 | while (LCD_STATUS & 0x10); |
312 | LCD_WDATA = *p++; | 313 | LCD_WDATA = *p++; |
@@ -317,9 +318,9 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
317 | else { | 318 | else { |
318 | lcd_set_window2(x, y, width, height); | 319 | lcd_set_window2(x, y, width, height); |
319 | lcd_set_position2(x, y); | 320 | lcd_set_position2(x, y); |
320 | 321 | ||
321 | for (h = 0; h < height; h++) { | 322 | for (h = 0; h < height; h++) { |
322 | p = FBADDR(x,y); | 323 | p = fbaddr(x,y); |
323 | for (w = 0; w < width; w++) { | 324 | for (w = 0; w < width; w++) { |
324 | while (LCD_STATUS & 0x10); | 325 | while (LCD_STATUS & 0x10); |
325 | LCD_WDATA = *p++; | 326 | LCD_WDATA = *p++; |