OMAPFB: use dma_alloc_attrs to allocate memory
Use dma_alloc_attrs to allocate memory instead of omap specific vram allocator. After this we can remove the omap vram allocator. There are some downsides to this change: 1) dma_alloc_attrs doesn't let us allocate at certain physical address. However, this should not be a problem as this feature of vram allocator is only used when reserving the framebuffer that was initialized by the bootloader, and we don't currently support "passing" a framebuffer from the bootloader to the kernel anyway. 2) dma_alloc_attrs, as of now, always ioremaps the allocated area, and we don't need the ioremap when using VRFB. This patch uses DMA_ATTR_NO_KERNEL_MAPPING for the allocation, but the flag is currently not operational. 3) OMAPFB_GET_VRAM_INFO ioctl cannot return real values anymore. I changed the ioctl to return 64M for all the values, which, I hope, the applications will interpret as "there's enough vram". 4) "vram" kernel parameter to define how much ram to reserve for video use no longer works. The user needs to enable CMA and use "cma" parameter. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
|
||||
#include <video/omapdss.h>
|
||||
#include <plat/vrfb.h>
|
||||
#include <plat/vram.h>
|
||||
|
||||
#include "omapfb.h"
|
||||
|
||||
@@ -853,14 +852,15 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
|
||||
break;
|
||||
|
||||
case OMAPFB_GET_VRAM_INFO: {
|
||||
unsigned long vram, free, largest;
|
||||
|
||||
DBG("ioctl GET_VRAM_INFO\n");
|
||||
|
||||
omap_vram_get_info(&vram, &free, &largest);
|
||||
p.vram_info.total = vram;
|
||||
p.vram_info.free = free;
|
||||
p.vram_info.largest_free_block = largest;
|
||||
/*
|
||||
* We don't have the ability to get this vram info anymore.
|
||||
* Fill in something that should keep the applications working.
|
||||
*/
|
||||
p.vram_info.total = SZ_1M * 64;
|
||||
p.vram_info.free = SZ_1M * 64;
|
||||
p.vram_info.largest_free_block = SZ_1M * 64;
|
||||
|
||||
if (copy_to_user((void __user *)arg, &p.vram_info,
|
||||
sizeof(p.vram_info)))
|
||||
|
Reference in New Issue
Block a user