Signed-off-by: Dipam Turkar <dipamt1729@xxxxxxxxx> --- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_gem.c | 24 ++---------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index fa531493b111..f590ed65ffba 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -578,7 +578,7 @@ static const struct drm_driver kms_driver = { .ioctls = radeon_ioctls_kms, .num_ioctls = ARRAY_SIZE(radeon_ioctls_kms), .dumb_create = radeon_mode_dumb_create, - .dumb_map_offset = radeon_mode_dumb_mmap, + .dumb_map_offset = drm_gem_dumb_map_offset, .fops = &radeon_driver_kms_fops, .gem_prime_import_sg_table = radeon_gem_prime_import_sg_table, diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 358d19242f4b..99794c550d2c 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -31,6 +31,7 @@ #include <drm/drm_device.h> #include <drm/drm_file.h> +#include <drm/dem_gem.h> #include <drm/drm_gem_ttm_helper.h> #include <drm/radeon_drm.h> @@ -480,33 +481,12 @@ int radeon_gem_set_domain_ioctl(struct drm_device *dev, void *data, return r; } -int radeon_mode_dumb_mmap(struct drm_file *filp, - struct drm_device *dev, - uint32_t handle, uint64_t *offset_p) -{ - struct drm_gem_object *gobj; - struct radeon_bo *robj; - - gobj = drm_gem_object_lookup(filp, handle); - if (gobj == NULL) { - return -ENOENT; - } - robj = gem_to_radeon_bo(gobj); - if (radeon_ttm_tt_has_userptr(robj->rdev, robj->tbo.ttm)) { - drm_gem_object_put(gobj); - return -EPERM; - } - *offset_p = radeon_bo_mmap_offset(robj); - drm_gem_object_put(gobj); - return 0; -} - int radeon_gem_mmap_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) { struct drm_radeon_gem_mmap *args = data; - return radeon_mode_dumb_mmap(filp, dev, args->handle, &args->addr_ptr); + return drm_gem_dumb_map_offset(filp, dev, args->handle, &args->addr_ptr); } int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, -- 2.34.1