From cfeeb7889d5346e2abaf9b198375df62c58b098f Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 21 Mar 2022 18:54:52 -0400 Subject: 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 --- firmware/target/arm/samsung/yh920/lcd-yh920.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'firmware/target/arm/samsung/yh920') diff --git a/firmware/target/arm/samsung/yh920/lcd-yh920.c b/firmware/target/arm/samsung/yh920/lcd-yh920.c index 06aa3d718d..6a579f382a 100644 --- a/firmware/target/arm/samsung/yh920/lcd-yh920.c +++ b/firmware/target/arm/samsung/yh920/lcd-yh920.c @@ -253,13 +253,14 @@ void lcd_update_rect(int x, int y, int width, int height) if(ymax >= LCD_FBHEIGHT) ymax = LCD_FBHEIGHT-1; + void* (*fbaddr)(int x, int y) = FB_CURRENTVP_BUFFER->get_address_fn; /* Copy specified rectange bitmap to hardware */ for (; y <= ymax; y++) { lcd_write_reg(LCD_CNTL_PAGE, y); lcd_write_reg(LCD_CNTL_COLUMN, x); - addr = FBADDR(x,y); + addr = fbaddr(x,y); lcd_send_cmd(LCD_CNTL_DATA_WRITE); lcd_write_data(addr, width); -- cgit v1.2.3