summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/rk27xx/lcd-rk27xx.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/firmware/target/arm/rk27xx/lcd-rk27xx.c b/firmware/target/arm/rk27xx/lcd-rk27xx.c
index e98dc4ab86..fda95e3174 100644
--- a/firmware/target/arm/rk27xx/lcd-rk27xx.c
+++ b/firmware/target/arm/rk27xx/lcd-rk27xx.c
@@ -286,21 +286,30 @@ void lcd_init_device()
*/
void lcd_update()
{
- unsigned int x,y;
-
- for (y=0; y<240; y++)
- for (x=0; x<400; x++)
- LCD_DATA = lcd_pixel_transform(lcd_framebuffer[y][x]);
+ lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
}
-/* not implemented yet */
+
void lcd_update_rect(int x, int y, int width, int height)
{
- (void)x;
- (void)y;
- (void)width;
- (void)height;
- lcd_update();
+ int px = x, py = y;
+ int pxmax = x + width, pymax = y + height;
+
+ /* addresses setup */
+ lcd_write_reg(WINDOW_H_START, y);
+ lcd_write_reg(WINDOW_H_END, pymax-1);
+ lcd_write_reg(WINDOW_V_START, x);
+ lcd_write_reg(WINDOW_V_END, pxmax-1);
+ lcd_write_reg(GRAM_H_ADDR, y);
+ lcd_write_reg(GRAM_V_ADDR, x);
+
+ lcd_cmd(GRAM_WRITE);
+
+ for (py=y; py<pymax; py++)
+ {
+ for (px=x; px<pxmax; px++)
+ LCD_DATA = lcd_pixel_transform(lcd_framebuffer[py][px]);
+ }
}
/* Blit a YUV bitmap directly to the LCD */