]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
karo: tx6: set LCD x, y dimensions to 0 when disabling LCD
authorLothar Waßmann <LW@KARO-electronics.de>
Mon, 18 Apr 2016 07:33:43 +0000 (09:33 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 18 Apr 2016 07:33:43 +0000 (09:33 +0200)
Even when the LCD is disabled, the LCD framework will still clear the
video memory. This can take a cosiderable amount of time for the
maximum resolution of 16MiB that the i.MX6 supports.

Setting vl_row and vl_col to 0 results in a zero sized framebuffer
to avoid this unnecessary delay.

board/karo/tx6/tx6qdl.c

index a232461e077b260811e8f5c0172cafe7f60c243f..5a0e2a819359cce05be1d6ff5579869b3dc17be1 100644 (file)
@@ -1091,6 +1091,7 @@ void lcd_ctrl_init(void *lcdbase)
 
        if (!lcd_enabled) {
                debug("LCD disabled\n");
 
        if (!lcd_enabled) {
                debug("LCD disabled\n");
+               goto disable;
                return;
        }
 
                return;
        }
 
@@ -1098,6 +1099,7 @@ void lcd_ctrl_init(void *lcdbase)
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                setenv("splashimage", NULL);
                debug("Disabling LCD\n");
                lcd_enabled = 0;
                setenv("splashimage", NULL);
+               goto disable;
                return;
        }
 
                return;
        }
 
@@ -1107,6 +1109,7 @@ void lcd_ctrl_init(void *lcdbase)
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
        if (video_mode == NULL) {
                debug("Disabling LCD\n");
                lcd_enabled = 0;
+               goto disable;
                return;
        }
        vm = video_mode;
                return;
        }
        vm = video_mode;
@@ -1120,6 +1123,7 @@ void lcd_ctrl_init(void *lcdbase)
                                fb_mode.xres, fb_mode.yres,
                                panel_info.vl_col, panel_info.vl_row);
                        lcd_enabled = 0;
                                fb_mode.xres, fb_mode.yres,
                                panel_info.vl_col, panel_info.vl_row);
                        lcd_enabled = 0;
+                       goto disable;
                        return;
                }
        }
                        return;
                }
        }
@@ -1211,12 +1215,14 @@ void lcd_ctrl_init(void *lcdbase)
                        printf(" %s", p->name);
                }
                printf("\n");
                        printf(" %s", p->name);
                }
                printf("\n");
+               goto disable;
                return;
        }
        if (p->xres > panel_info.vl_col || p->yres > panel_info.vl_row) {
                printf("video resolution: %dx%d exceeds hardware limits: %dx%d\n",
                        p->xres, p->yres, panel_info.vl_col, panel_info.vl_row);
                lcd_enabled = 0;
                return;
        }
        if (p->xres > panel_info.vl_col || p->yres > panel_info.vl_row) {
                printf("video resolution: %dx%d exceeds hardware limits: %dx%d\n",
                        p->xres, p->yres, panel_info.vl_col, panel_info.vl_row);
                lcd_enabled = 0;
+               goto disable;
                return;
        }
        panel_info.vl_col = p->xres;
                return;
        }
        panel_info.vl_col = p->xres;
@@ -1275,6 +1281,7 @@ void lcd_ctrl_init(void *lcdbase)
                lcd_enabled = 0;
                printf("Invalid %s bus width: %d\n", is_lvds() ? "LVDS" : "LCD",
                        lcd_bus_width);
                lcd_enabled = 0;
                printf("Invalid %s bus width: %d\n", is_lvds() ? "LVDS" : "LCD",
                        lcd_bus_width);
+               goto disable;
                return;
        }
        if (is_lvds()) {
                return;
        }
        if (is_lvds()) {
@@ -1286,6 +1293,7 @@ void lcd_ctrl_init(void *lcdbase)
                if (lvds_chan_mask == 0) {
                        printf("No LVDS channel active\n");
                        lcd_enabled = 0;
                if (lvds_chan_mask == 0) {
                        printf("No LVDS channel active\n");
                        lcd_enabled = 0;
+                       goto disable;
                        return;
                }
 
                        return;
                }
 
@@ -1315,6 +1323,13 @@ void lcd_ctrl_init(void *lcdbase)
        } else {
                debug("Skipping initialization of LCD controller\n");
        }
        } else {
                debug("Skipping initialization of LCD controller\n");
        }
+       return;
+
+disable:
+       lcd_enabled = 0;
+       panel_info.vl_col = 0;
+       panel_info.vl_row = 0;
+
 }
 #else
 #define lcd_enabled 0
 }
 #else
 #define lcd_enabled 0