Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c
- index d98ed5a..0eeec82 100644
- --- a/firmware/target/arm/rk27xx/lcd-hifiman.c
- +++ b/firmware/target/arm/rk27xx/lcd-hifiman.c
- @@ -112,6 +112,7 @@ void lcd_init_device(void)
- {
- lcdif_init(LCDIF_16BIT);
- lcd_display_init();
- + memset(&LCD_BUFF, 0x00, 2048*4);
- }
- void lcd_enable (bool on)
- @@ -153,22 +154,78 @@ bool lcd_active()
- return display_on;
- }
- void lcd_update_rect(int x, int y, int width, int height)
- {
- - int px = x, py = y;
- + int px = x, py = y,offs=0;
- int pxmax = x + width, pymax = y + height;
- -
- - lcd_write_reg(0x03, y);
- - lcd_write_reg(0x05, pymax-1);
- - lcd_write_reg(0x07, x);
- - lcd_write_reg(0x09, pxmax-1);
- + lcdctrl_bypass(1);
- + lcd_write_reg(0x02, 0x00);
- + lcd_write_reg(0x03, 0x00);
- + lcd_write_reg(0x04, 0x00);
- + lcd_write_reg(0x05, LCD_HEIGHT - 1);
- + lcd_write_reg(0x06, 0x00);
- + lcd_write_reg(0x07, 0x00);
- + lcd_write_reg(0x08, 0x00);
- + lcd_write_reg(0x09, LCD_WIDTH - 1);
- lcd_cmd(0x22);
- - for (px=x; px<pxmax; px++)
- + lcdctrl_bypass(0);
- + while (!(LCDC_STA & LCDC_MCU_IDLE));
- + for (px = 0; px < LCD_WIDTH; px++) {
- + for (py=0; py < LCD_HEIGHT; py+=2) {
- + *(&LCD_BUFF + offs) = (unsigned long)*FBADDR(px, py)|(((unsigned long)*FBADDR(px, py+1))<<16);
- + offs = (offs+1)%(1022/2);
- + if (offs == 0) {
- + MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- + while (!(LCDC_STA & LCDC_MCU_IDLE));
- + }
- + }
- + }
- + if (offs != 0) {
- + for (px = 0; px < LCD_WIDTH; px++) {
- + for (py=0; py < LCD_HEIGHT; py+=2) {
- + *(&LCD_BUFF + offs) = (unsigned long)*FBADDR(px, py)|(((unsigned long)*FBADDR(px, py+1))<<16);
- + offs = (offs+1)%(1022/2);
- + if (offs == 0) {
- + MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- + return;
- + }
- + }
- + }
- + }
- }
- /* Blit a YUV bitmap directly to the LCD */
- diff --git a/firmware/target/arm/rk27xx/lcdif-rk27xx.c b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
- index affc49b..3bfe342 100644
- --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c
- +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
- @@ -30,6 +30,7 @@
- unsigned int lcd_data_transform(unsigned int data)
- {
- unsigned int r, g, b;
- + return data;
- #if defined(RK27_GENERIC)
- /* 18 bit interface */
- @@ -65,7 +66,7 @@ void lcd_write_reg(unsigned int reg, unsigned int val)
- lcd_data(val);
- }
- -static void lcdctrl_bypass(unsigned int on_off)
- +void lcdctrl_bypass(unsigned int on_off)
- {
- while (!(LCDC_STA & LCDC_MCU_IDLE));
- @@ -86,23 +87,36 @@ static void lcdctrl_init(void)
- * MCU mode
- * 24b RGB
- */
- - LCDC_CTRL = ALPHA(7) | LCDC_STOP | LCDC_MCU | RGB24B;
- + LCDC_CTRL = ALPHA(7) | LCDC_STOP | LCDC_MCU;// | RGB24B;
- MCU_CTRL = ALPHA_BASE(0x3f) | MCU_CTRL_BYPASS;
- - HOR_ACT = LCD_WIDTH + 3; /* define horizonatal active region */
- - VERT_ACT = LCD_HEIGHT; /* define vertical active region */
- - VERT_PERIOD = 0xfff; /* CSn/WEn/RDn signal timings */
- + HOR_BP = 1;
- + VERT_BP = 1;
- + HOR_ACT = LCD_HEIGHT; /* define horizonatal active region */
- + VERT_ACT = LCD_WIDTH; /* define vertical active region */
- + VERT_PERIOD = (7<<7)|(7<<3)|7;//0xfff; /* CSn/WEn/RDn signal timings */
- - LINE0_YADDR = LINE_ALPHA_EN | 0x7fe;
- - LINE1_YADDR = LINE_ALPHA_EN | ((1 * LCD_WIDTH) - 2);
- - LINE2_YADDR = LINE_ALPHA_EN | ((2 * LCD_WIDTH) - 2);
- - LINE3_YADDR = LINE_ALPHA_EN | ((3 * LCD_WIDTH) - 2);
- + LINE0_YADDR = 0;
- + LINE1_YADDR = (1 * LCD_HEIGHT);
- + LINE2_YADDR = (2 * LCD_HEIGHT);
- + LINE3_YADDR = (3 * LCD_HEIGHT);
- - LINE0_UVADDR = 0x7fe + 1;
- - LINE1_UVADDR = ((1 * LCD_WIDTH) - 2 + 1);
- - LINE2_UVADDR = ((2 * LCD_WIDTH) - 2 + 1);
- - LINE3_UVADDR = ((3 * LCD_WIDTH) - 2 + 1);
- + LINE0_UVADDR = 1;
- + LINE1_UVADDR = (1 * LCD_HEIGHT) + 1;
- + LINE2_UVADDR = (2 * LCD_HEIGHT) + 1;
- + LINE3_UVADDR = (3 * LCD_HEIGHT) + 1;
- + /**/
- + /* LINE0_YADDR = 0x7fe;
- + LINE1_YADDR = ((1 * LCD_HEIGHT) -2);
- + LINE2_YADDR = ((2 * LCD_HEIGHT) -2);
- + LINE3_YADDR = ((3 * LCD_HEIGHT) -2);
- +
- + LINE0_UVADDR = 0x7fe + 1;
- + LINE1_UVADDR = ((1 * LCD_HEIGHT) -2+ 1);
- + LINE2_UVADDR = ((2 * LCD_HEIGHT) -2+ 1);
- + LINE3_UVADDR = ((3 * LCD_HEIGHT) -2+ 1);
- + */
- #if 0
- LINE0_YADDR = 0;
- LINE1_YADDR = (1 * LCD_WIDTH);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement