public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations
@ 2017-10-27 11:52 Niko Mauno
  2017-10-27 12:15 ` Anatolij Gustschin
  2017-10-29 13:49 ` Anatolij Gustschin
  0 siblings, 2 replies; 3+ messages in thread
From: Niko Mauno @ 2017-10-27 11:52 UTC (permalink / raw)
  To: u-boot

Resort to malloc_cache_aligned() rather than malloc() which also removes
'CACHE: Misaligned operation at range' warnings.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 drivers/video/da8xx-fb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index bbd384df5e..6ec4f89e34 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -14,7 +14,7 @@
  */
 
 #include <common.h>
-#include <malloc.h>
+#include <memalign.h>
 #include <video_fb.h>
 #include <linux/list.h>
 #include <linux/fb.h>
@@ -924,7 +924,7 @@ void *video_hw_init(void)
 	      da8xx_lcd_cfg->bpp);
 
 	size = sizeof(struct fb_info) + sizeof(struct da8xx_fb_par);
-	da8xx_fb_info = malloc(size);
+	da8xx_fb_info = malloc_cache_aligned(size);
 	debug("da8xx_fb_info at %x\n", (unsigned int)da8xx_fb_info);
 
 	if (!da8xx_fb_info) {
@@ -949,7 +949,7 @@ void *video_hw_init(void)
 			da8xx_lcd_cfg->bpp;
 	par->vram_size = par->vram_size * LCD_NUM_BUFFERS / 8;
 
-	par->vram_virt = malloc(par->vram_size);
+	par->vram_virt = malloc_cache_aligned(par->vram_size);
 
 	par->vram_phys = (dma_addr_t) par->vram_virt;
 	debug("Requesting 0x%x bytes for framebuffer at 0x%x\n",
@@ -972,7 +972,7 @@ void *video_hw_init(void)
 		da8xx_fb_fix.line_length - 1;
 
 	/* allocate palette buffer */
-	par->v_palette_base = malloc(PALETTE_SIZE);
+	par->v_palette_base = malloc_cache_aligned(PALETTE_SIZE);
 	if (!par->v_palette_base) {
 		printf("GLCD: malloc for palette buffer failed\n");
 		goto err_release_fb_mem;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations
  2017-10-27 11:52 [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations Niko Mauno
@ 2017-10-27 12:15 ` Anatolij Gustschin
  2017-10-29 13:49 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2017-10-27 12:15 UTC (permalink / raw)
  To: u-boot

On Fri, 27 Oct 2017 14:52:08 +0300
Niko Mauno niko.mauno at vaisala.com wrote:

> Resort to malloc_cache_aligned() rather than malloc() which also removes
> 'CACHE: Misaligned operation at range' warnings.
> 
> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> ---
>  drivers/video/da8xx-fb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Anatolij Gustschin <agust@denx.de>

--
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations
  2017-10-27 11:52 [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations Niko Mauno
  2017-10-27 12:15 ` Anatolij Gustschin
@ 2017-10-29 13:49 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2017-10-29 13:49 UTC (permalink / raw)
  To: u-boot

On Fri, 27 Oct 2017 14:52:08 +0300
Niko Mauno niko.mauno at vaisala.com wrote:

> Resort to malloc_cache_aligned() rather than malloc() which also removes
> 'CACHE: Misaligned operation at range' warnings.
> 
> Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
> ---
>  drivers/video/da8xx-fb.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-29 13:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-27 11:52 [U-Boot] [PATCH] video/da8xx-fb: Cache-align memory allocations Niko Mauno
2017-10-27 12:15 ` Anatolij Gustschin
2017-10-29 13:49 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox