diff options
| author | Alexander Graf <[email protected]> | 2016-03-24 10:31:11 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2016-03-27 09:12:19 -0400 |
| commit | 99de254e8de9a73ac6baee05786e2e3f70e4813b (patch) | |
| tree | b177ccb8392e3c41b6f6dd475d9b940abe6cf374 /drivers | |
| parent | ccd9d51ede69f08f60d9ab3c824b93ceda73afc8 (diff) | |
bcm2835 video: Map fb as cached
The bcm2835 frame buffer is in RAM, so we can easily map it as cached and gain
all the glorious performance boost that brings with it.
Signed-off-by: Alexander Graf <[email protected]>
Tested-by: Stephen Warren <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/bcm2835.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c index bff1fcb9eaf..cd605e632cb 100644 --- a/drivers/video/bcm2835.c +++ b/drivers/video/bcm2835.c @@ -44,6 +44,7 @@ void lcd_ctrl_init(void *lcdbase) ALLOC_CACHE_ALIGN_BUFFER(struct msg_setup, msg_setup, 1); int ret; u32 w, h; + u32 fb_start, fb_end; debug("bcm2835: Query resolution...\n"); @@ -106,6 +107,14 @@ void lcd_ctrl_init(void *lcdbase) gd->fb_base = bus_to_phys( msg_setup->allocate_buffer.body.resp.fb_address); + + /* Enable dcache for the frame buffer */ + fb_start = gd->fb_base & ~(MMU_SECTION_SIZE - 1); + fb_end = gd->fb_base + msg_setup->allocate_buffer.body.resp.fb_size; + fb_end = ALIGN(fb_end, 1 << MMU_SECTION_SHIFT); + mmu_set_region_dcache_behaviour(fb_start, fb_end - fb_start, + DCACHE_WRITEBACK); + lcd_set_flush_dcache(1); } void lcd_enable(void) |
