diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2019-06-12 18:22:28 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2019-06-12 18:22:28 +0200 |
commit | 76509d6b103b8cbbbb4021be3a024efa23e01cf2 (patch) | |
tree | 7141a114498ebeddbb726c4a957064e372dafd3e /drivers/gpu/drm/mediatek/mtk_drm_gem.c | |
parent | d1fdb6d8f6a4109a4263176c84b899076a5f8008 (diff) | |
parent | 2458d9d6d94be982b917e93c61a89b4426f32e31 (diff) | |
download | linux-76509d6b103b8cbbbb4021be3a024efa23e01cf2.tar.gz |
Merge branch 'mediatek-drm-fixes-5.2' of https://github.com/ckhu-mediatek/linux.git-tags into drm-fixes
CK writes:
This include unbind error fix, clock control flow refinement, and PRIME
mmap with page offset.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1560325868.3259.6.camel@mtksdaap41
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_gem.c')
-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 3eefb22206c7..0d69698f8173 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c @@ -136,7 +136,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); @@ -168,6 +167,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); } |