Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3de392d1 authored by Jeevan Shriram's avatar Jeevan Shriram Committed by Gerrit - the friendly Code Review server
Browse files

mdss: fb: Add page protection flag in mmap call



Add page protection flag to avoid screen corruption
in pan display path.

Change-Id: Iae57ee85fd20730f5842629c5cf8778da56a13d3
Signed-off-by: default avatarJeevan Shriram <jshriram@codeaurora.org>
parent 1559d923
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -1283,6 +1283,11 @@ static int mdss_fb_fbmem_ion_mmap(struct fb_info *info,
			}
			len = min(len, remainder);

			if (mfd->mdp_fb_page_protection ==
					MDP_FB_PAGE_PROTECTION_WRITECOMBINE)
				vma->vm_page_prot =
					pgprot_writecombine(vma->vm_page_prot);

			pr_debug("vma=%p, addr=%x len=%ld",
					vma, (unsigned int)addr, len);
			pr_cont("vm_start=%x vm_end=%x vm_page_prot=%ld\n",
@@ -1324,6 +1329,7 @@ static int mdss_fb_physical_mmap(struct fb_info *info,
	unsigned long start = info->fix.smem_start;
	u32 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
	unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
	struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;

	if (!start) {
		pr_warn("No framebuffer memory is allocated\n");
@@ -1343,6 +1349,9 @@ static int mdss_fb_physical_mmap(struct fb_info *info,
	/* This is an IO map - tell maydump to skip this VMA */
	vma->vm_flags |= VM_IO;

	if (mfd->mdp_fb_page_protection == MDP_FB_PAGE_PROTECTION_WRITECOMBINE)
		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);

	/* Remap the frame buffer I/O range */
	if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
				vma->vm_end - vma->vm_start,