drm/rockchip: drv: Fix ROCKCHIP_BO_CACHABLE flag Invalid

The ROCKCHIP_BO_CACHABLE flag first introduced at the following commit:
commit 4d89a73831 ("drm/rockchip: support cpu cache for drm memory")

After the follwing commit, the vm_page_prot init be moved to rockchip drm gem driver:
commit f8b5307074 ("drm/rockchip: Implement mmap as GEM object function")

so add this commit to adapt this change.

issues info:
https://github.com/JeffyCN/mirrors/issues/18

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ic7ae1279c157d02a1ae4758b45934a8506741f67
This commit is contained in:
Sandy Huang
2024-02-04 14:09:05 +08:00
committed by Tao Huang
parent f9ab55a3df
commit 8612b1897d

View File

@@ -546,10 +546,6 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
int ret;
struct rockchip_gem_object *rk_obj = to_rockchip_obj(obj);
/* default is wc. */
if (rk_obj->flags & ROCKCHIP_BO_CACHABLE)
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
/*
* Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the
* whole buffer from the start.
@@ -563,7 +559,11 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,
vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
vma->vm_flags &= ~VM_PFNMAP;
vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
/* default is wc. */
if (rk_obj->flags & ROCKCHIP_BO_CACHABLE)
vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
else
vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags));
vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot);
if (rk_obj->buf_type == ROCKCHIP_GEM_BUF_TYPE_SECURE) {