summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()
286 */ 286 */
287void lcd_update() 287void lcd_update()
288{ 288{
289 unsigned int x,y; 289 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
290
291 for (y=0; y<240; y++)
292 for (x=0; x<400; x++)
293 LCD_DATA = lcd_pixel_transform(lcd_framebuffer[y][x]);
294} 290}
295 291
296/* not implemented yet */ 292
297void lcd_update_rect(int x, int y, int width, int height) 293void lcd_update_rect(int x, int y, int width, int height)
298{ 294{
299 (void)x; 295 int px = x, py = y;
300 (void)y; 296 int pxmax = x + width, pymax = y + height;
301 (void)width; 297
302 (void)height; 298 /* addresses setup */
303 lcd_update(); 299 lcd_write_reg(WINDOW_H_START, y);
300 lcd_write_reg(WINDOW_H_END, pymax-1);
301 lcd_write_reg(WINDOW_V_START, x);
302 lcd_write_reg(WINDOW_V_END, pxmax-1);
303 lcd_write_reg(GRAM_H_ADDR, y);
304 lcd_write_reg(GRAM_V_ADDR, x);
305
306 lcd_cmd(GRAM_WRITE);
307
308 for (py=y; py<pymax; py++)
309 {
310 for (px=x; px<pxmax; px++)
311 LCD_DATA = lcd_pixel_transform(lcd_framebuffer[py][px]);
312 }
304} 313}
305 314
306/* Blit a YUV bitmap directly to the LCD */ 315/* Blit a YUV bitmap directly to the LCD */