]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
video: ARM CLCD: fix dma allocation size
authorLiam Beguin <lbeguin@tycoint.com>
Fri, 7 Apr 2017 15:03:24 +0000 (17:03 +0200)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:33:45 +0000 (21:33 -0400)
[ Upstream commit 9a1c779e6b06855e41099caa6f15b3b584dfa88c ]

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.

Signed-off-by: Liam Beguin <lbeguin@tycoint.com>
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/video/fbdev/amba-clcd.c

index 9362424c2340490585fe02e4dfe950f53f2097af..924b3d6c3e9bd7062f2bdca91b7fff2392aadaa6 100644 (file)
@@ -759,8 +759,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)