diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2011-10-01 08:57:51 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2011-10-01 08:57:51 +0000 |
commit | 88455968f41004ec19e9ba37731e23de85d7d17a (patch) | |
tree | 857ff77fe7f4965bb2a8b91174a326f0762ac4bc /firmware/target/arm | |
parent | da09f7f0f14f2b6514a1e5dd0e223ff8e9f766d0 (diff) |
rk27xx - implement partial lcd updates
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30624 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/rk27xx/lcd-rk27xx.c | 31 |
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 */ |