summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-12-19 15:32:23 -0800
committerSimon Glass <sjg@chromium.org>2012-01-05 15:55:08 -0800
commit384aa66841ff5e83701a9384823a4890e025028c (patch)
tree4f950c467d1a37d41b1959332a7cd40231667bb6 /drivers
parent7d436642249ec30640a1d23b209214ccf4a2d0b1 (diff)
tegra: Delay exact screen size selection until later
Prior to relocation it is expensive to find out the LCD dimensions. Instead we select the maximum possible size and allow lcd_ctrl_init() to correct this later. This works since the only purpose of this early init is to set the LCD frame buffer size. So long as we set it to the largest value that could possible be requested, all will be well. BUG=chromium-os:22938 TEST=build and boot on Kaen Change-Id: I850ee5cb2b6bf051e32c6a52c42c368a940ea045 Reviewed-on: https://gerrit.chromium.org/gerrit/13212 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Commit-Ready: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra2.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/video/tegra2.c b/drivers/video/tegra2.c
index 6a458d139dd..3f60c64fae7 100644
--- a/drivers/video/tegra2.c
+++ b/drivers/video/tegra2.c
@@ -47,6 +47,13 @@ static enum stage_t stage; /* Current stage we are at */
static unsigned long timer_next; /* Time we can move onto next stage */
static struct fdt_lcd config; /* Our LCD config, set up in handle_stage() */
+enum {
+ /* Maximum LCD size we support */
+ LCD_MAX_WIDTH = 1366,
+ LCD_MAX_HEIGHT = 768,
+ LCD_MAX_LOG2_BPP = 4, /* 16 bpp */
+};
+
int lcd_line_length;
int lcd_color_fg;
int lcd_color_bg;
@@ -208,7 +215,13 @@ void lcd_ctrl_init(void *lcdbase)
config.frame_buffer = (u32)lcd_base;
}
- update_panel_size(&config);
+ /* Make sure that we can acommodate the selected LCD */
+ assert(config.width <= LCD_MAX_WIDTH);
+ assert(config.height <= LCD_MAX_HEIGHT);
+ assert(config.log2_bpp <= LCD_MAX_LOG2_BPP);
+ if (config.width <= LCD_MAX_WIDTH && config.height <= LCD_MAX_HEIGHT &&
+ config.log2_bpp <= LCD_MAX_LOG2_BPP)
+ update_panel_size(&config);
size = lcd_get_size(&line_length),
/* call board specific hw init */
@@ -238,11 +251,13 @@ void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
void lcd_early_init(const void *blob)
{
- struct fdt_lcd config;
-
- /* get panel details */
- if (!fdt_decode_lcd(gd->blob, &config))
- update_panel_size(&config);
+ /*
+ * Go with the maximum size for now. We will fix this up after
+ * relocation. These values are only used for memory alocation.
+ */
+ panel_info.vl_col = LCD_MAX_WIDTH;
+ panel_info.vl_row = LCD_MAX_HEIGHT;
+ panel_info.vl_bpix = LCD_MAX_LOG2_BPP;
}
static int handle_stage(const void *blob)