summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233
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/imx233
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/imx233')
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c4
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zenv.c3
-rw-r--r--firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c3
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c3
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c3
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c3
-rw-r--r--firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c3
-rw-r--r--firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c3
8 files changed, 17 insertions, 8 deletions
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
index c1bc379a49..ab4466300b 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zenmozaic.c
@@ -149,6 +149,8 @@ void lcd_update_rect(int x, int y, int w, int h)
149 lcd_write_reg(0x17, y | (y + h - 1) << 8); 149 lcd_write_reg(0x17, y | (y + h - 1) << 8);
150 lcd_write_reg(0x21, y * LCD_WIDTH + x); 150 lcd_write_reg(0x21, y * LCD_WIDTH + x);
151 lcd_write_reg(0x22, 0); 151 lcd_write_reg(0x22, 0);
152
153 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
152 for(int yy = y; yy < y + h; yy++) 154 for(int yy = y; yy < y + h; yy++)
153 imx233_lcdif_pio_send(true, 2 * w, FBADDR(x, yy)); 155 imx233_lcdif_pio_send(true, 2 * w, fbaddr(x,yy));
154} 156}
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
index 06b0f158f3..75d2775814 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zenv.c
@@ -172,8 +172,9 @@ void lcd_update_rect(int x, int y, int w, int h)
172 lcd_send(false, 0x75); lcd_send(true, y); lcd_send(true, y + h - 1); 172 lcd_send(false, 0x75); lcd_send(true, y); lcd_send(true, y + h - 1);
173 lcd_send(false, 0x5c); 173 lcd_send(false, 0x5c);
174 imx233_lcdif_set_word_length(16); 174 imx233_lcdif_set_word_length(16);
175 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
175 for(int yy = y; yy < y + h; yy++) 176 for(int yy = y; yy < y + h; yy++)
176 imx233_lcdif_pio_send(true, w, FBADDR(x, yy)); 177 imx233_lcdif_pio_send(true, w, fbaddr(x,yy));
177} 178}
178 179
179#ifndef BOOTLOADER 180#ifndef BOOTLOADER
diff --git a/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c
index ce0bcc3885..825b0072a3 100644
--- a/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c
+++ b/firmware/target/arm/imx233/creative-zen/lcd-zenxfistyle.c
@@ -282,8 +282,9 @@ void lcd_update_rect(int x, int y, int w, int h)
282 } 282 }
283 else 283 else
284 { 284 {
285 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
285 for(int i = 0; i < h; i++) 286 for(int i = 0; i < h; i++)
286 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 287 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
287 } 288 }
288 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 289 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
289 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 290 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
index 890ff0b586..d0084900e7 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
@@ -241,8 +241,9 @@ void lcd_update_rect(int x, int y, int w, int h)
241 } 241 }
242 else 242 else
243 { 243 {
244 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
244 for(int i = 0; i < h; i++) 245 for(int i = 0; i < h; i++)
245 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 246 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
246 } 247 }
247 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 248 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
248 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 249 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
index 59496f2d24..d5f25a523c 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
+++ b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
@@ -188,8 +188,9 @@ void lcd_update_rect(int x, int y, int w, int h)
188 } 188 }
189 else 189 else
190 { 190 {
191 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
191 for(int i = 0; i < h; i++) 192 for(int i = 0; i < h; i++)
192 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 193 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
193 } 194 }
194 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 195 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
195 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 196 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
index 92864c9ed7..ceb7b4e090 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
@@ -637,8 +637,9 @@ void lcd_update_rect(int x, int y, int w, int h)
637 } 637 }
638 else 638 else
639 { 639 {
640 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
640 for(int i = 0; i < h; i++) 641 for(int i = 0; i < h; i++)
641 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 642 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
642 } 643 }
643 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 644 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
644 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 645 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
diff --git a/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c b/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c
index cfcf85bfc0..8f49bfa3eb 100644
--- a/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c
+++ b/firmware/target/arm/imx233/sony-nwz/lcd-nwze360.c
@@ -228,8 +228,9 @@ void lcd_update_rect(int x, int y, int w, int h)
228 } 228 }
229 else 229 else
230 { 230 {
231 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
231 for(int i = 0; i < h; i++) 232 for(int i = 0; i < h; i++)
232 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 233 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
233 } 234 }
234 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 235 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
235 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 236 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
diff --git a/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c b/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c
index 999f4ee525..862522da15 100644
--- a/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c
+++ b/firmware/target/arm/imx233/sony-nwz/lcd-nwze370.c
@@ -189,8 +189,9 @@ void lcd_update_rect(int x, int y, int w, int h)
189 } 189 }
190 else 190 else
191 { 191 {
192 void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
192 for(int i = 0; i < h; i++) 193 for(int i = 0; i < h; i++)
193 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data)); 194 memcpy((fb_data *)FRAME + i * w, fbaddr(x,y + i), w * sizeof(fb_data));
194 } 195 }
195 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 196 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
196 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 197 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count