diff options
author | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-05-08 18:29:17 +0400 |
---|---|---|
committer | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2013-05-08 18:30:32 +0400 |
commit | 83554cce8d8f2cee322f3b7160f4fa8e9930f451 (patch) | |
tree | 65e451807726ee39942a509456f213e0d229e89e /firmware/target/arm/rk27xx | |
parent | fce81a8a74deaa0dae504a3da190d786156a568d (diff) | |
download | rockbox-83554cce8d8f2cee322f3b7160f4fa8e9930f451.tar.gz rockbox-83554cce8d8f2cee322f3b7160f4fa8e9930f451.zip |
hm60x: Implement lcd_update_rect for v2 display.
Change-Id: I9d6b14bcbd26cfd760516f1ef3bf421698507806
Diffstat (limited to 'firmware/target/arm/rk27xx')
-rw-r--r-- | firmware/target/arm/rk27xx/lcd-hifiman.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c index 95cbd358d8..8360a84cff 100644 --- a/firmware/target/arm/rk27xx/lcd-hifiman.c +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c @@ -252,9 +252,6 @@ static void lcd_v2_display_init(void) lcd_write_reg(0x07, 0x1017); - lcd_write_reg(0x20, 0x00AF); - lcd_write_reg(0x21, 0x0000); - lcd_cmd(0x22); for (x=0; x<LCD_WIDTH; x++) @@ -271,23 +268,33 @@ static void lcd_v2_enable (bool on) static void lcd_v2_set_gram_area(int x, int y, int width, int height) { - (void) x; - (void) y; - (void) width; - (void) height; lcdctrl_bypass(1); LCDC_CTRL |= RGB24B; + + lcd_write_reg(0x36, height-1); + lcd_write_reg(0x37, y); + lcd_write_reg(0x38, width-1); + lcd_write_reg(0x39, x); + + /* set GRAM address */ + lcd_write_reg(0x20, y); + lcd_write_reg(0x21, x); + lcd_cmd(0x22); LCDC_CTRL &= ~RGB24B; } static void lcd_v2_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; + + lcd_v2_set_gram_area(x, y, pxmax, pymax); + + for (py=y; py<pymax; py++) + for (px=x; px<pxmax; px++) + LCD_DATA = (*FBADDR(px, py)); + } void lcd_display_init(void) |