Skip to contentSkip to conversation

video: ARM CLCD: fix dma allocation size

PATCH New Sylvain Lemieux 2 participants 3 messages Mar 8, 2017 – Apr 7, 2017 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 video: ARM CLCD: fix dma allocation size

From: Liam Beguin <[email protected]>

This patch forces the frambuffer size to be aligned on kernel pages.

During the board startup, the splash screed did appear; the "ts_test" program or our application were not able to start.

The following error message was reported:
error: failed to map framebuffer device to memory.
LinuxFB: driver cannot connect

The issue was discovered, on the LPC32xx platform, during the migration of the LCD definition from the board file to the device tree.

---
 drivers/video/fbdev/amba-clcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/amba-clcd.c +2 -2
index 0fab92c62828..ffc2c33c6cef 100644
@@ -881,8 +881,8 @@ static int clcdfb_of_dma_setup(struct clcd_fb *fb)
 	if (err)
 		return err;
 
-	framesize = fb->panel->mode.xres * fb->panel->mode.yres *
-			fb->panel->bpp / 8;
+	framesize = PAGE_ALIGN(fb->panel->mode.xres * fb->panel->mode.yres *
+			fb->panel->bpp / 8);
 	fb->fb.screen_base = dma_alloc_coherent(&fb->dev->dev, framesize,
 			&dma, GFP_KERNEL);
 	if (!fb->fb.screen_base)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 video: ARM CLCD: fix dma allocation size

ping

Quoted 35 lines · Sylvain Lemieux

From: Liam Beguin <[email protected]>

This patch forces the frambuffer size to be aligned on kernel pages.

During the board startup, the splash screed did appear; the "ts_test" program or our application were not able to start.

The following error message was reported:
error: failed to map framebuffer device to memory.
LinuxFB: driver cannot connect

The issue was discovered, on the LPC32xx platform, during the migration of the LCD definition from the board file to the device tree.

---
 drivers/video/fbdev/amba-clcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/amba-clcd.c +2 -2
index 0fab92c62828..ffc2c33c6cef 100644
@@ -881,8 +881,8 @@ static int clcdfb_of_dma_setup(struct clcd_fb *fb)
 	if (err)
 		return err;
 
-	framesize = fb->panel->mode.xres * fb->panel->mode.yres *
-			fb->panel->bpp / 8;
+	framesize = PAGE_ALIGN(fb->panel->mode.xres * fb->panel->mode.yres *
+			fb->panel->bpp / 8);
 	fb->fb.screen_base = dma_alloc_coherent(&fb->dev->dev, framesize,
 			&dma, GFP_KERNEL);
 	if (!fb->fb.screen_base)
#2 lore raw

PATCH 1/1 video: ARM CLCD: fix dma allocation size

In reply to Sylvain Lemieux

Hi,

Quoted 11 lines · Sylvain Lemieux

From: Liam Beguin <[email protected]>

This patch forces the frambuffer size to be aligned on kernel pages.

During the board startup, the splash screed did appear; the "ts_test" program or our application were not able to start.

The following error message was reported:
error: failed to map framebuffer device to memory.
LinuxFB: driver cannot connect

Quoted 5 lines

The issue was discovered, on the LPC32xx platform, during the migration of the LCD definition from the board file to the device tree.

Patch queued for 4.12, thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics