diff mbox

[U-Boot,5/5] bcm2835 video: Map fb as cached

Message ID 1458062508-210201-6-git-send-email-agraf@suse.de
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Alexander Graf March 15, 2016, 5:21 p.m. UTC
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 <agraf@suse.de>
---
 drivers/video/bcm2835.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andreas Färber March 16, 2016, 6 p.m. UTC | #1
Am 15.03.2016 um 18:21 schrieb Alexander Graf:
> 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 <agraf@suse.de>
> ---
>  drivers/video/bcm2835.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
> index bff1fcb..fe49f2e 100644
> --- a/drivers/video/bcm2835.c
> +++ b/drivers/video/bcm2835.c
> @@ -106,6 +106,12 @@ 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 */
> +        mmu_set_region_dcache_behaviour(gd->fb_base,

Spaces vs. tab.

Andreas

> +		ALIGN(PAGE_SIZE, msg_setup->allocate_buffer.body.resp.fb_size),
> +		DCACHE_WRITEBACK);
> +	lcd_set_flush_dcache(1);
>  }
>  
>  void lcd_enable(void)
>
Alexander Graf March 16, 2016, 10:32 p.m. UTC | #2
On 16.03.16 19:00, Andreas Färber wrote:
> Am 15.03.2016 um 18:21 schrieb Alexander Graf:
>> 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 <agraf@suse.de>
>> ---
>>  drivers/video/bcm2835.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
>> index bff1fcb..fe49f2e 100644
>> --- a/drivers/video/bcm2835.c
>> +++ b/drivers/video/bcm2835.c
>> @@ -106,6 +106,12 @@ 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 */
>> +        mmu_set_region_dcache_behaviour(gd->fb_base,
> 
> Spaces vs. tab.

If the rest of the patches are good in v2, I'd appreciate if whoever
applies this code could fix that up :).


Alex
diff mbox

Patch

diff --git a/drivers/video/bcm2835.c b/drivers/video/bcm2835.c
index bff1fcb..fe49f2e 100644
--- a/drivers/video/bcm2835.c
+++ b/drivers/video/bcm2835.c
@@ -106,6 +106,12 @@  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 */
+        mmu_set_region_dcache_behaviour(gd->fb_base,
+		ALIGN(PAGE_SIZE, msg_setup->allocate_buffer.body.resp.fb_size),
+		DCACHE_WRITEBACK);
+	lcd_set_flush_dcache(1);
 }
 
 void lcd_enable(void)