summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-06-27 15:50:10 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:43 -0700
commita68cdfe396cb533228d218bc2e0e1731482d69a1 (patch)
tree59a6cdebfa8a46bf72faf2d2f0d316f983c24b4e /drivers
parent1a242769afa9b529e46958547c855a4de93b2657 (diff)
Change LCD to use write-back cache
As expected write-through caching slows the LCD frame buffer to an unacceptable degree. This change provides an option to use write-back, with a dcache flush after each puts(), clear screen or scroll. This option becomes the default unless overwritten in the fdt. Timings (done with about 2 screenfuls of vboot debug output): flushing dcache after each line write-through cache: Timer summary in microseconds: Mark Elapsed Stage 0 0 awake 2,418,290 2,418,290 bootm_start no cache logic (tearing!): Timer summary in microseconds: Mark Elapsed Stage 0 0 awake 1,434,217 1,434,217 bootm_start This commit: Timer summary in microseconds: Mark Elapsed Stage 0 0 awake 1,500,866 1,500,866 bootm_start BUG=chromium-os:17047 TEST=build and boot on Seaboard, check for LCD tearing. Change-Id: I2155f9c4ad3b59376f1b713daed77cf5aac396a4 Reviewed-on: http://gerrit.chromium.org/gerrit/3313 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra2.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/tegra2.c b/drivers/video/tegra2.c
index 111a32623c..047c067063 100644
--- a/drivers/video/tegra2.c
+++ b/drivers/video/tegra2.c
@@ -184,7 +184,7 @@ static void update_panel_size(struct fdt_lcd *config)
void lcd_ctrl_init(void *lcdbase)
{
struct fdt_lcd config;
- int line_length;
+ int line_length, size;
/* get panel details */
if (fdt_decode_lcd(gd->blob, &config)) {
@@ -200,11 +200,19 @@ void lcd_ctrl_init(void *lcdbase)
*/
config.frame_buffer = (u32)lcd_base;
update_panel_size(&config);
+ size = lcd_get_size(&line_length),
/* call board specific hw init */
init_lcd(&config);
- mmu_set_region_dcache(config.frame_buffer,
- lcd_get_size(&line_length), DCACHE_WRITETHROUGH);
+
+ /* For write-through or cache off, change the LCD memory region */
+ if (!(config.cache_type & FDT_LCD_CACHE_WRITE_BACK))
+ mmu_set_region_dcache(config.frame_buffer, size,
+ config.cache_type & FDT_LCD_CACHE_WRITE_THROUGH ?
+ DCACHE_WRITETHROUGH : DCACHE_OFF);
+
+ /* Enable flushing after LCD writes if requested */
+ lcd_set_flush_dcache(config.cache_type & FDT_LCD_CACHE_FLUSH);
debug("LCD frame buffer at %p\n", lcd_base);
}