osd: fixed fb mmap failed on android [3/3]
authorPengcheng Chen <pengcheng.chen@amlogic.com>
Wed, 10 Jul 2019 09:25:10 +0000 (17:25 +0800)
committerPengcheng Chen <pengcheng.chen@amlogic.com>
Fri, 19 Jul 2019 02:09:57 +0000 (10:09 +0800)
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>
drivers/amlogic/media/osd/osd_fb.c

index 91499b3..f880ef5 100644 (file)
@@ -1526,13 +1526,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;
                }
 
        }