drm/sun4i: Use DRM_GEM_CMA_VMAP_DRIVER_OPS for GEM operations
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 18 Apr 2019 13:05:09 +0000 (15:05 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Thu, 18 Apr 2019 15:56:47 +0000 (17:56 +0200)
Our driver makes a typical use of CMA, with GEM object allocated as
GEM CMA objects. Use DRM_GEM_CMA_VMAP_DRIVER_OPS to describe the ops
instead of duplicating them.

Because DRM_GEM_CMA_VMAP_DRIVER_OPS implements a gem_create_object op
which sets per-object funcs (drm_cma_gem_default_funcs), we can also
get rid of free_object_unlocked and gem_vm_ops, which are superseded
by the object funcs.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190418130509.3569-1-paul.kocialkowski@bootlin.com
drivers/gpu/drm/sun4i/sun4i_drv.c

index 3ebd9f5e2719d7f028c2c87b1e2cedd6c60a5365..c8c0ab3da97260ee7a736e94900f93c04bf0ad79 100644 (file)
@@ -52,22 +52,8 @@ static struct drm_driver sun4i_drv_driver = {
        .minor                  = 0,
 
        /* GEM Operations */
+       DRM_GEM_CMA_VMAP_DRIVER_OPS,
        .dumb_create            = drm_sun4i_gem_dumb_create,
-       .gem_free_object_unlocked = drm_gem_cma_free_object,
-       .gem_vm_ops             = &drm_gem_cma_vm_ops,
-
-       /* PRIME Operations */
-       .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
-       .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
-       .gem_prime_import       = drm_gem_prime_import,
-       .gem_prime_export       = drm_gem_prime_export,
-       .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
-       .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
-       .gem_prime_vmap         = drm_gem_cma_prime_vmap,
-       .gem_prime_vunmap       = drm_gem_cma_prime_vunmap,
-       .gem_prime_mmap         = drm_gem_cma_prime_mmap,
-
-       /* Frame Buffer Operations */
 };
 
 static int sun4i_drv_bind(struct device *dev)