summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tegra.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
index 5a5afb9413..c1f83b578f 100644
--- a/drivers/video/tegra.c
+++ b/drivers/video/tegra.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <fdtdec.h>
#include <lcd.h>
+#include <malloc.h>
#include <asm/system.h>
#include <asm/gpio.h>
@@ -93,6 +94,17 @@ void lcd_ctrl_init(void *lcdbase)
lcd_set_flush_dcache(config.cache_type & FDT_LCD_CACHE_FLUSH);
debug("LCD frame buffer at %08X\n", disp_config->frame_buffer);
+
+ /*
+ * Allocate memory to keep BMP colour conversion map. This is
+ required for 8-bit BMPs only (hence giving 256 colours). If malloc
+ fails - keep going, it is not even clear if displaying the bitmap
+ will be required on the way up.
+ */
+ panel_info.cmap = malloc(256 * NBITS(panel_info.vl_bpix) / 8);
+ if (panel_info.cmap == NULL) {
+ printf("No memory available for panel_info.cmap!");
+ }
}
ulong calc_fbsize(void)