fbdev: ssd1307fb: Allocate page aligned video memory.
authorThomas Niederprüm <niederp@physik.uni-kl.de>
Tue, 31 Mar 2015 18:27:08 +0000 (20:27 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 27 May 2015 09:53:21 +0000 (12:53 +0300)
commitfacd94bc458af12e1ebab06cfc3b8e7a41906622
treee4f173632c95076511b3216bb1b8e82b448ef244
parent258c0ea21d3aa974b43e5ce6c2f7c94553a3b1cc
fbdev: ssd1307fb: Allocate page aligned video memory.

Currently the videomemory is allocated by kmalloc, making it a memory
region that is not necessarily page aligend. This leads to problems
upon mmap call, where the video memory's address gets aligned to the
next page boundary. The result is that the userspace program that issued
the mmap call is not able to access the video memory from the start to
the next page boundary.

This patch changes the allocation of the video memory to use
__get_free_pages() in order to obtain memory that is aligned
to page boundaries.

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/ssd1307fb.c