diff options
author | Yongqiang Niu <yongqiang.niu@mediatek.com> | 2019-03-27 14:19:20 +0800 |
---|---|---|
committer | CK Hu <ck.hu@mediatek.com> | 2019-05-29 14:55:26 +0800 |
commit | 46a3b9fce29386704a56fbfb22e0dcdbd813b4b5 (patch) | |
tree | 77bd3528a8f23acda757c66c4abd4d1f79c957e6 /drivers/gpu/drm/mediatek | |
parent | 937f861def1a1d49abb92e041efaa5c259281fbf (diff) | |
download | linux-46a3b9fce29386704a56fbfb22e0dcdbd813b4b5.tar.bz2 |
drm/mediatek: respect page offset for PRIME mmap calls
Respect page offset for PRIME mmap calls
Signed-off-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
Diffstat (limited to 'drivers/gpu/drm/mediatek')
-rw-r--r-- | drivers/gpu/drm/mediatek/mtk_drm_gem.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c index 38483e9ee071..7eabdf335a79 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -144,7 +144,6 @@ static int mtk_drm_gem_object_mmap(struct drm_gem_object *obj, * VM_PFNMAP flag that was set by drm_gem_mmap_obj()/drm_gem_mmap(). */ vma->vm_flags &= ~VM_PFNMAP; - vma->vm_pgoff = 0; ret = dma_mmap_attrs(priv->dma_dev, vma, mtk_gem->cookie, mtk_gem->dma_addr, obj->size, mtk_gem->dma_attrs); @@ -176,6 +175,12 @@ int mtk_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) obj = vma->vm_private_data; + /* + * Set vm_pgoff (used as a fake buffer offset by DRM) to 0 and map the + * whole buffer from the start. + */ + vma->vm_pgoff = 0; + return mtk_drm_gem_object_mmap(obj, vma); } |