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

Commit fd847233 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mdss: fb: Add page protection flag in mmap call"

parents cf5054c6 3de392d1
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -1283,6 +1283,11 @@ static int mdss_fb_fbmem_ion_mmap(struct fb_info *info,
			}
			}
			len = min(len, remainder);
			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",
			pr_debug("vma=%p, addr=%x len=%ld",
					vma, (unsigned int)addr, len);
					vma, (unsigned int)addr, len);
			pr_cont("vm_start=%x vm_end=%x vm_page_prot=%ld\n",
			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;
	unsigned long start = info->fix.smem_start;
	u32 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
	u32 len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
	unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
	unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
	struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;


	if (!start) {
	if (!start) {
		pr_warn("No framebuffer memory is allocated\n");
		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 */
	/* This is an IO map - tell maydump to skip this VMA */
	vma->vm_flags |= VM_IO;
	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 */
	/* Remap the frame buffer I/O range */
	if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
	if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
				vma->vm_end - vma->vm_start,
				vma->vm_end - vma->vm_start,