diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c index 1adc6e36ed..bde1d3546f 100644 --- a/firmware/target/arm/rk27xx/lcd-hifiman.c +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c @@ -175,19 +175,6 @@ static void lcd_v1_set_gram_area(int x_start, int y_start, LCDC_CTRL &= ~RGB24B; } -static void lcd_v1_update_rect(int x, int y, int width, int height) -{ - int px = x, py = y; - int pxmax = x + width, pymax = y + height; - - lcd_v1_set_gram_area(x, y, pxmax-1, pymax-1); - - for (py=y; py> 1; + + LINE0_YADDR = 0; + LINE1_YADDR = 1 * width; + LINE2_YADDR = 2 * width; + LINE3_YADDR = 3 * width; + + LINE0_UVADDR = LINE0_YADDR + 1; + LINE1_UVADDR = LINE1_YADDR + 1; + LINE2_UVADDR = LINE2_YADDR + 1; + LINE3_UVADDR = LINE3_YADDR + 1; +} + static void lcdctrl_init(void) { int i; @@ -80,31 +107,11 @@ static void lcdctrl_init(void) LCDC_CTRL = ALPHA(7) | LCDC_STOP | LCDC_MCU | RGB24B; MCU_CTRL = ALPHA_BASE(0x3f) | MCU_CTRL_BYPASS; - /* Warning: datasheet addresses and OF addresses - * don't match for HOR_ACT and VERT_ACT - */ - HOR_ACT = LCD_WIDTH + 3; /* define horizonatal active region */ - VERT_ACT = LCD_HEIGHT; /* define vertical active region */ VERT_PERIOD = (1<<7)|(1<<5)|1; /* CSn/WEn/RDn signal timings */ lcd_display_init(); lcdctrl_bypass(0); - - /* This lines define layout of data in lcdif internal buffer - * LINEx_UVADDR = LINEx_YADDR + 1 - * buffer is organized as 2048 x 32bit - * we use RGB565 (16 bits per pixel) so we pack 2 pixels - * in every lcdbuffer mem cell - */ - LINE0_YADDR = 0; - LINE1_YADDR = 1 * LCD_WIDTH/2; - LINE2_YADDR = 2 * LCD_WIDTH/2; - LINE3_YADDR = 3 * LCD_WIDTH/2; - - LINE0_UVADDR = 1; - LINE1_UVADDR = (1 * LCD_WIDTH/2) + 1; - LINE2_UVADDR = (2 * LCD_WIDTH/2) + 1; - LINE3_UVADDR = (3 * LCD_WIDTH/2) + 1; + lcdctrl_buff_setup(LCD_WIDTH, LCD_HEIGHT); LCDC_INTR_MASK = INTR_MASK_EVENLINE; @@ -185,18 +192,20 @@ static void dwdma_start(uint8_t ch, struct llp_t *llp, uint8_t handshake) DWDMA_DMA_CHEN = (0x101<>1; - llp_end(&scr_llp[LCD_HEIGHT-1]); + /* build LLPs */ + for (i=0; i