MLK-14299-1 video: mxsfb: clear the overlay fb memory buffer
authorFancy Fang <chen.fang@nxp.com>
Thu, 9 Mar 2017 03:04:04 +0000 (11:04 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:50 +0000 (15:21 -0500)
Clear the overlay fb memory buffer after allocated to avoid
random pixel data in it before using it.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6b1a31b8fc39c7cf19ff3dcdc57f2f4059632f45)

drivers/video/fbdev/mxsfb.c

index e5384b6..fceafc2 100644 (file)
@@ -2033,6 +2033,9 @@ static int mxsfb_overlay_map_video_memory(struct mxsfb_info *fbi,
                return -ENOMEM;
        }
 
+       /* clear overlay fb memory buffer */
+       memset(ofb->video_mem, 0x0, ofb->video_mem_size);
+
        ofb->ol_fb->fix.smem_start = ofb->video_mem_phys;
        ofb->ol_fb->fix.smem_len   = ofb->video_mem_size;
        ofb->ol_fb->screen_base    = ofb->video_mem;