osd: fixed fb mmap failed on android [3/3]

PD#SWPL-6631

Problem:
dolby vision graphic tests need fb_test

Solution:
Alloc buffer when mmap

Verify:
verified on tm2 t96e2

Change-Id: I12896d7ef9ad4a8122e2784c4692ff2d0bc69d1b
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
This commit is contained in:
Pengcheng Chen
2019-07-10 17:25:10 +08:00
committed by Luke Go
parent d59e7b5b9e
commit 85561b17d8

View File

@@ -1544,13 +1544,15 @@ static int osd_mmap(struct fb_info *info, struct vm_area_struct *vma)
unsigned long start;
u32 len;
int ret = 0;
static int mem_alloced;
if (!b_alloc_mem) {
/* alloc mem when osd_open */
if (info->screen_base == NULL) {
if (!mem_alloced) {
ret = malloc_osd_memory(info);
if (ret < 0)
return ret;
mem_alloced = 1;
}
}