drm/vkms: Drop custom vkms_dumb_map().
authorEric Anholt <eric@anholt.net>
Mon, 26 Nov 2018 21:59:28 +0000 (13:59 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 27 Nov 2018 20:23:32 +0000 (12:23 -0800)
This is the same as the default drm_gem_dumb_map_offset()
implementation, except that this one missed the ban on userspace
mapping an imported dmabuf (which seems like intended common behavior
for drivers).

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181126215929.20546-1-eric@anholt.net
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/vkms/vkms_drv.c
drivers/gpu/drm/vkms/vkms_drv.h
drivers/gpu/drm/vkms/vkms_gem.c

index a3d57e0f5ee523486dc8e64ec2da033212259747..83087877565cf77b9104d67636c183231fdd19c4 100644 (file)
@@ -68,7 +68,6 @@ static struct drm_driver vkms_driver = {
        .release                = vkms_release,
        .fops                   = &vkms_driver_fops,
        .dumb_create            = vkms_dumb_create,
-       .dumb_map_offset        = vkms_dumb_map,
        .gem_vm_ops             = &vkms_gem_vm_ops,
        .gem_free_object_unlocked = vkms_gem_free_object,
        .get_vblank_timestamp   = vkms_get_vblank_timestamp,
index 1c93990693e3d0e65a70fcb4ee7dea34826d3a89..e4469cd3d25491198209e3898189fc52e54e5ed7 100644 (file)
@@ -127,9 +127,6 @@ vm_fault_t vkms_gem_fault(struct vm_fault *vmf);
 int vkms_dumb_create(struct drm_file *file, struct drm_device *dev,
                     struct drm_mode_create_dumb *args);
 
-int vkms_dumb_map(struct drm_file *file, struct drm_device *dev,
-                 u32 handle, u64 *offset);
-
 void vkms_gem_free_object(struct drm_gem_object *obj);
 
 int vkms_gem_vmap(struct drm_gem_object *obj);
index d04e988b4cbef88dacc54db05681078b5b29d529..80311daed47a0ac752a3e1e68bd54f9d8b60d412 100644 (file)
@@ -153,32 +153,6 @@ int vkms_dumb_create(struct drm_file *file, struct drm_device *dev,
        return 0;
 }
 
-int vkms_dumb_map(struct drm_file *file, struct drm_device *dev,
-                 u32 handle, u64 *offset)
-{
-       struct drm_gem_object *obj;
-       int ret;
-
-       obj = drm_gem_object_lookup(file, handle);
-       if (!obj)
-               return -ENOENT;
-
-       if (!obj->filp) {
-               ret = -EINVAL;
-               goto unref;
-       }
-
-       ret = drm_gem_create_mmap_offset(obj);
-       if (ret)
-               goto unref;
-
-       *offset = drm_vma_node_offset_addr(&obj->vma_node);
-unref:
-       drm_gem_object_put_unlocked(obj);
-
-       return ret;
-}
-
 static struct page **_get_pages(struct vkms_gem_object *vkms_obj)
 {
        struct drm_gem_object *gem_obj = &vkms_obj->gem;