drm/radeon: deduplicate code in radeon_gem_busy_ioctl
authorMarek Olšák <marek.olsak@amd.com>
Sat, 1 Mar 2014 23:56:19 +0000 (00:56 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 3 Mar 2014 09:57:10 +0000 (10:57 +0100)
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/radeon/radeon_gem.c

index 9863ca7424941a142e57df7a40dc8ab9f7e45f05..d09650c1d720fc74920577fc176f41f9b076a646 100644 (file)
@@ -344,18 +344,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data,
        }
        robj = gem_to_radeon_bo(gobj);
        r = radeon_bo_wait(robj, &cur_placement, true);
-       switch (cur_placement) {
-       case TTM_PL_VRAM:
-               args->domain = RADEON_GEM_DOMAIN_VRAM;
-               break;
-       case TTM_PL_TT:
-               args->domain = RADEON_GEM_DOMAIN_GTT;
-               break;
-       case TTM_PL_SYSTEM:
-               args->domain = RADEON_GEM_DOMAIN_CPU;
-       default:
-               break;
-       }
+       args->domain = radeon_mem_type_to_domain(cur_placement);
        drm_gem_object_unreference_unlocked(gobj);
        r = radeon_gem_handle_lockup(rdev, r);
        return r;