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..2b41030 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,72 @@ bool lcd_active()
- return display_on;
- }
- -
- +int k = 0;
- 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++) {
- + *(&LCD_BUFF + offs) = lcd_data_transform(*FBADDR(px, py));
- + offs = (offs+1)%(1022);
- + 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++) {
- + *(&LCD_BUFF + offs) = lcd_data_transform(*FBADDR(px, py));
- + offs = (offs+1)%(1022);
- + if (offs == 0) {
- + MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- + return;
- + }
- + }
- + }
- + }
- + /* px = 0;
- + py = 0;
- + while (offs != 1022) {
- + *(&LCD_BUFF + offs) = lcd_data_transform(*(FBADDR(px, py)));
- + offs++;
- + py++;
- + if (py == LCD_HEIGHT) {
- + py = 0;
- + px++;
- + }
- + }
- + MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- + }*/
- + //MCU_CTRL=(1<<1)|(1<<2)|(1<<5);
- +
- + /* for (px = 0; px < 2048; px++) {
- + *(&LCD_BUFF + px) = 0xFF;
- + }
- + MCU_CTRL=(1<<1)|(1<<2)|(1<<5);*/
- +
- + /* for (px=x; px<pxmax; px++)
- for (py=y; py<pymax; py++)
- - lcd_data(*FBADDR(px, py));
- + lcd_data(*FBADDR(px, py));*/
- }
- /* 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..6887200 100644
- --- a/firmware/target/arm/rk27xx/lcdif-rk27xx.c
- +++ b/firmware/target/arm/rk27xx/lcdif-rk27xx.c
- @@ -65,7 +65,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));
- @@ -89,19 +89,32 @@ static void lcdctrl_init(void)
- 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 */
- + HOR_BP = 1;
- + VERT_BP = 1;
- + HOR_ACT = LCD_HEIGHT+3; /* define horizonatal active region */
- + VERT_ACT = LCD_WIDTH; /* define vertical active region */
- VERT_PERIOD = 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 = 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_WIDTH) - 2 + 1);
- - LINE2_UVADDR = ((2 * LCD_WIDTH) - 2 + 1);
- - LINE3_UVADDR = ((3 * LCD_WIDTH) - 2 + 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;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement