From 85561b17d8dfe24bb34e3de7be8bdd6cec780e74 Mon Sep 17 00:00:00 2001 From: Pengcheng Chen Date: Wed, 10 Jul 2019 17:25:10 +0800 Subject: [PATCH] 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 --- drivers/amlogic/media/osd/osd_fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index e727b46b1b0d..8deafaece8b1 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -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; } }