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
This commit is contained in:
William Wilgus 2022-03-21 18:54:52 -04:00
parent 60e5786b48
commit cfeeb7889d
23 changed files with 78 additions and 40 deletions

View file

@ -149,6 +149,8 @@ void lcd_update_rect(int x, int y, int w, int h)
lcd_write_reg(0x17, y | (y + h - 1) << 8);
lcd_write_reg(0x21, y * LCD_WIDTH + x);
lcd_write_reg(0x22, 0);
void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn;
for(int yy = y; yy < y + h; yy++)
imx233_lcdif_pio_send(true, 2 * w, FBADDR(x, yy));
imx233_lcdif_pio_send(true, 2 * w, fbaddr(x,yy));
}