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/mips/ingenic_jz47xx | |
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/mips/ingenic_jz47xx')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/xduoo_x3/lcd-xduoo_x3.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/lcd-xduoo_x3.c b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/lcd-xduoo_x3.c index 47b646be34..2c1c3a226e 100644 --- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/lcd-xduoo_x3.c +++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/lcd-xduoo_x3.c | |||
@@ -532,6 +532,7 @@ void lcd_update(void) | |||
532 | const int column_high = get_column_high_byte(0); | 532 | const int column_high = get_column_high_byte(0); |
533 | const int column_low = get_column_low_byte(0); | 533 | const int column_low = get_column_low_byte(0); |
534 | 534 | ||
535 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
535 | /* Copy display bitmap to hardware */ | 536 | /* Copy display bitmap to hardware */ |
536 | for (y = 0; y < LCD_FBHEIGHT; y++) | 537 | for (y = 0; y < LCD_FBHEIGHT; y++) |
537 | { | 538 | { |
@@ -542,7 +543,7 @@ void lcd_update(void) | |||
542 | (column_low) | 543 | (column_low) |
543 | ); | 544 | ); |
544 | 545 | ||
545 | lcd_write_data (FBADDR(0, y), LCD_WIDTH); | 546 | lcd_write_data (fbaddr(0,y), LCD_WIDTH); |
546 | } | 547 | } |
547 | } | 548 | } |
548 | 549 | ||
@@ -586,6 +587,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
586 | ymax = (y + height-1) >> 3; | 587 | ymax = (y + height-1) >> 3; |
587 | y >>= 3; | 588 | y >>= 3; |
588 | 589 | ||
590 | void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; | ||
589 | /* Copy specified rectange bitmap to hardware */ | 591 | /* Copy specified rectange bitmap to hardware */ |
590 | for (; y <= ymax; y++) | 592 | for (; y <= ymax; y++) |
591 | { | 593 | { |
@@ -596,6 +598,6 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
596 | (column_low) | 598 | (column_low) |
597 | ); | 599 | ); |
598 | 600 | ||
599 | lcd_write_data (FBADDR(x,y), width); | 601 | lcd_write_data (fbaddr(x,y), width); |
600 | } | 602 | } |
601 | } | 603 | } |