drm: call drm_gem_object_funcs.mmap with fake offset
The fake offset is going to stay, so change the calling convention for drm_gem_object_funcs.mmap to include the fake offset. Update all users accordingly. Note that this reverts83b8a6f242("drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap") and on top then adds the fake offset to drm_gem_prime_mmap to make sure all paths leading to obj->funcs->mmap are consistent. v3: move fake-offset tweak in drm_gem_prime_mmap() so we have this code only once in the function (Rob Herring). Fixes:83b8a6f242("drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap") Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20191127092523.5620-2-kraxel@redhat.com
This commit is contained in:
@@ -713,6 +713,9 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
|
||||
struct file *fil;
|
||||
int ret;
|
||||
|
||||
/* Add the fake offset */
|
||||
vma->vm_pgoff += drm_vma_node_start(&obj->vma_node);
|
||||
|
||||
if (obj->funcs && obj->funcs->mmap) {
|
||||
ret = obj->funcs->mmap(obj, vma);
|
||||
if (ret)
|
||||
@@ -737,8 +740,6 @@ int drm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
vma->vm_pgoff += drm_vma_node_start(&obj->vma_node);
|
||||
|
||||
ret = obj->dev->driver->fops->mmap(fil, vma);
|
||||
|
||||
drm_vma_node_revoke(&obj->vma_node, priv);
|
||||
|
||||
Reference in New Issue
Block a user