diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-08-17 19:21:31 +0300 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2017-09-02 15:22:20 +0300 |
commit | 4ee73624e0d0fd647ede3b17187ba98f2aa9421c (patch) | |
tree | 920beadc4b25ad0f81c9f865094728715dcb7c64 /drivers/gpu/drm/armada/armada_gem.c | |
parent | 90378e58919285637aa0f063c04ba0c6449d98b1 (diff) | |
download | linux-4ee73624e0d0fd647ede3b17187ba98f2aa9421c.tar.xz |
drm/armada: Use .dumb_map_offset and .dumb_destroy defaults
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502986891-36764-3-git-send-email-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/armada/armada_gem.c')
-rw-r--r-- | drivers/gpu/drm/armada/armada_gem.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c index a76ca21d063b..79835380d5c6 100644 --- a/drivers/gpu/drm/armada/armada_gem.c +++ b/drivers/gpu/drm/armada/armada_gem.c @@ -270,42 +270,6 @@ int armada_gem_dumb_create(struct drm_file *file, struct drm_device *dev, return ret; } -int armada_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, - uint32_t handle, uint64_t *offset) -{ - struct armada_gem_object *obj; - int ret = 0; - - obj = armada_gem_object_lookup(file, handle); - if (!obj) { - DRM_ERROR("failed to lookup gem object\n"); - return -EINVAL; - } - - /* Don't allow imported objects to be mapped */ - if (obj->obj.import_attach) { - ret = -EINVAL; - goto err_unref; - } - - ret = drm_gem_create_mmap_offset(&obj->obj); - if (ret == 0) { - *offset = drm_vma_node_offset_addr(&obj->obj.vma_node); - DRM_DEBUG_DRIVER("handle %#x offset %llx\n", handle, *offset); - } - - err_unref: - drm_gem_object_unreference_unlocked(&obj->obj); - - return ret; -} - -int armada_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, - uint32_t handle) -{ - return drm_gem_handle_delete(file, handle); -} - /* Private driver gem ioctls */ int armada_gem_create_ioctl(struct drm_device *dev, void *data, struct drm_file *file) |