diff mbox series

[1/5] drm/msm: remove unnecessary mmap logic for cached BOs

Message ID 20210423190833.25319-2-jonathan@marek.ca (mailing list archive)
State New, archived
Headers show
Series drm/msm: add MSM_BO_CACHED_COHERENT (and related changes) | expand

Commit Message

Jonathan Marek April 23, 2021, 7:08 p.m. UTC
No one knows what this is for anymore, so just remove it.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
 drivers/gpu/drm/msm/msm_gem.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Comments

Jordan Crouse May 2, 2021, 7:51 p.m. UTC | #1
On Fri, Apr 23, 2021 at 03:08:17PM -0400, Jonathan Marek wrote:
> No one knows what this is for anymore, so just remove it.

Acked-by: Jordan Crouse <jordan@cosmicpenguin.net>

> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> ---
>  drivers/gpu/drm/msm/msm_gem.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
> index b199942266a2..09abda42d764 100644
> --- a/drivers/gpu/drm/msm/msm_gem.c
> +++ b/drivers/gpu/drm/msm/msm_gem.c
> @@ -207,21 +207,12 @@ int msm_gem_mmap_obj(struct drm_gem_object *obj,
>  	vma->vm_flags &= ~VM_PFNMAP;
>  	vma->vm_flags |= VM_MIXEDMAP;
>  
> -	if (msm_obj->flags & MSM_BO_WC) {
> +	if (msm_obj->flags & MSM_BO_WC)
>  		vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
> -	} else if (msm_obj->flags & MSM_BO_UNCACHED) {
> +	else if (msm_obj->flags & MSM_BO_UNCACHED)
>  		vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
> -	} else {
> -		/*
> -		 * Shunt off cached objs to shmem file so they have their own
> -		 * address_space (so unmap_mapping_range does what we want,
> -		 * in particular in the case of mmap'd dmabufs)
> -		 */
> -		vma->vm_pgoff = 0;
> -		vma_set_file(vma, obj->filp);
> -
> +	else
>  		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
> -	}
>  
>  	return 0;
>  }
> -- 
> 2.26.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index b199942266a2..09abda42d764 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -207,21 +207,12 @@  int msm_gem_mmap_obj(struct drm_gem_object *obj,
 	vma->vm_flags &= ~VM_PFNMAP;
 	vma->vm_flags |= VM_MIXEDMAP;
 
-	if (msm_obj->flags & MSM_BO_WC) {
+	if (msm_obj->flags & MSM_BO_WC)
 		vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
-	} else if (msm_obj->flags & MSM_BO_UNCACHED) {
+	else if (msm_obj->flags & MSM_BO_UNCACHED)
 		vma->vm_page_prot = pgprot_noncached(vm_get_page_prot(vma->vm_flags));
-	} else {
-		/*
-		 * Shunt off cached objs to shmem file so they have their own
-		 * address_space (so unmap_mapping_range does what we want,
-		 * in particular in the case of mmap'd dmabufs)
-		 */
-		vma->vm_pgoff = 0;
-		vma_set_file(vma, obj->filp);
-
+	else
 		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
-	}
 
 	return 0;
 }