drm/exynos: Use .dumb_map_offset and .dumb_destroy defaults
authorNoralf Trønnes <noralf@tronnes.org>
Sun, 6 Aug 2017 15:41:02 +0000 (17:41 +0200)
committerNoralf Trønnes <noralf@tronnes.org>
Wed, 16 Aug 2017 18:17:50 +0000 (20:17 +0200)
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.
Use drm_gem_dumb_map_offset() in exynos_drm_gem_map_ioctl() and
remove exynos_drm_gem_dumb_map_offset().

Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1502034068-51384-14-git-send-email-noralf@tronnes.org
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/exynos/exynos_drm_gem.h

index cab9e12d78468c8eb3127975d4ecd1e6224fef3a..d99b4295540f860b5d6f6c6e4230454dff327e0b 100644 (file)
@@ -145,8 +145,6 @@ static struct drm_driver exynos_drm_driver = {
        .gem_free_object_unlocked = exynos_drm_gem_free_object,
        .gem_vm_ops             = &exynos_drm_gem_vm_ops,
        .dumb_create            = exynos_drm_gem_dumb_create,
-       .dumb_map_offset        = exynos_drm_gem_dumb_map_offset,
-       .dumb_destroy           = drm_gem_dumb_destroy,
        .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
        .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
        .gem_prime_export       = drm_gem_prime_export,
index c23479be48500091fcb7aa0e0bdaf962a1f9fb59..077de014d61017d77853c41a7e5a2d4084e092f1 100644 (file)
@@ -286,8 +286,8 @@ int exynos_drm_gem_map_ioctl(struct drm_device *dev, void *data,
 {
        struct drm_exynos_gem_map *args = data;
 
-       return exynos_drm_gem_dumb_map_offset(file_priv, dev, args->handle,
-                                             &args->offset);
+       return drm_gem_dumb_map_offset(file_priv, dev, args->handle,
+                                      &args->offset);
 }
 
 dma_addr_t *exynos_drm_gem_get_dma_addr(struct drm_device *dev,
@@ -422,32 +422,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
        return 0;
 }
 
-int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
-                                  struct drm_device *dev, uint32_t handle,
-                                  uint64_t *offset)
-{
-       struct drm_gem_object *obj;
-       int ret = 0;
-
-       /*
-        * get offset of memory allocated for drm framebuffer.
-        * - this callback would be called by user application
-        *      with DRM_IOCTL_MODE_MAP_DUMB command.
-        */
-
-       obj = drm_gem_object_lookup(file_priv, handle);
-       if (!obj) {
-               DRM_ERROR("failed to lookup gem object.\n");
-               return -EINVAL;
-       }
-
-       *offset = drm_vma_node_offset_addr(&obj->vma_node);
-       DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
-
-       drm_gem_object_unreference_unlocked(obj);
-       return ret;
-}
-
 int exynos_drm_gem_fault(struct vm_fault *vmf)
 {
        struct vm_area_struct *vma = vmf->vma;
index 85457255fcd1aa093ddfb9a8c4e09b5d63720c7f..e86d1a9518c31bc4de5cbbf196303d8a6b833ce7 100644 (file)
@@ -110,11 +110,6 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv,
                               struct drm_device *dev,
                               struct drm_mode_create_dumb *args);
 
-/* map memory region for drm framebuffer to user space. */
-int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv,
-                                  struct drm_device *dev, uint32_t handle,
-                                  uint64_t *offset);
-
 /* page fault handler and mmap fault address(virtual) to physical memory. */
 int exynos_drm_gem_fault(struct vm_fault *vmf);