]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amdgpu: consistenly name amdgpu_bo_ functions
authorChristian König <christian.koenig@amd.com>
Mon, 16 Jul 2018 14:12:24 +0000 (16:12 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 25 Jul 2018 20:06:06 +0000 (15:06 -0500)
Just rename functions, no functional change.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

index 44f62fda40228b9fcce899ab5a3497cdada714c3..0283e2b3c851ac8e19eaaeca9bf47c8add4a85ec 100644 (file)
@@ -1801,8 +1801,6 @@ void amdgpu_display_update_priority(struct amdgpu_device *adev);
 
 void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
                                  u64 num_vis_bytes);
-void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain);
-bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
 void amdgpu_device_vram_location(struct amdgpu_device *adev,
                                 struct amdgpu_gmc *mc, u64 base);
 void amdgpu_device_gart_location(struct amdgpu_device *adev,
index 079af8ac2636d6d9a921236f15d044b80401b1b4..fa38a960ce00419ccdc71f3dd28b5bb6db8649d7 100644 (file)
@@ -334,7 +334,7 @@ static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain,
                 "Called with userptr BO"))
                return -EINVAL;
 
-       amdgpu_ttm_placement_from_domain(bo, domain);
+       amdgpu_bo_placement_from_domain(bo, domain);
 
        ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
        if (ret)
@@ -622,7 +622,7 @@ static int init_user_pages(struct kgd_mem *mem, struct mm_struct *mm,
                pr_err("%s: Failed to reserve BO\n", __func__);
                goto release_out;
        }
-       amdgpu_ttm_placement_from_domain(bo, mem->domain);
+       amdgpu_bo_placement_from_domain(bo, mem->domain);
        ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
        if (ret)
                pr_err("%s: failed to validate BO\n", __func__);
@@ -1680,7 +1680,7 @@ static int update_invalid_user_pages(struct amdkfd_process_info *process_info,
 
                if (amdgpu_bo_reserve(bo, true))
                        return -EAGAIN;
-               amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
+               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
                ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                amdgpu_bo_unreserve(bo);
                if (ret) {
@@ -1824,7 +1824,7 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info)
                if (mem->user_pages[0]) {
                        amdgpu_ttm_tt_set_user_pages(bo->tbo.ttm,
                                                     mem->user_pages);
-                       amdgpu_ttm_placement_from_domain(bo, mem->domain);
+                       amdgpu_bo_placement_from_domain(bo, mem->domain);
                        ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                        if (ret) {
                                pr_err("%s: failed to validate BO\n", __func__);
index 7c5cc33d0cda06d8cc93127a7374c1132ae3152c..c5d81d6a90e0454195dc5764acaa00411770c2dd 100644 (file)
@@ -419,7 +419,7 @@ static int amdgpu_cs_bo_validate(struct amdgpu_cs_parser *p,
        }
 
 retry:
-       amdgpu_ttm_placement_from_domain(bo, domain);
+       amdgpu_bo_placement_from_domain(bo, domain);
        r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
 
        p->bytes_moved += ctx.bytes_moved;
@@ -478,7 +478,7 @@ static bool amdgpu_cs_try_evict(struct amdgpu_cs_parser *p,
                update_bytes_moved_vis =
                                !amdgpu_gmc_vram_full_visible(&adev->gmc) &&
                                amdgpu_bo_in_cpu_visible_vram(bo);
-               amdgpu_ttm_placement_from_domain(bo, other);
+               amdgpu_bo_placement_from_domain(bo, other);
                r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                p->bytes_moved += ctx.bytes_moved;
                if (update_bytes_moved_vis)
@@ -532,8 +532,8 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
                /* Check if we have user pages and nobody bound the BO already */
                if (amdgpu_ttm_tt_userptr_needs_pages(bo->tbo.ttm) &&
                    lobj->user_pages) {
-                       amdgpu_ttm_placement_from_domain(bo,
-                                                        AMDGPU_GEM_DOMAIN_CPU);
+                       amdgpu_bo_placement_from_domain(bo,
+                                                       AMDGPU_GEM_DOMAIN_CPU);
                        r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                        if (r)
                                return r;
@@ -1655,7 +1655,7 @@ int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
 
        if (!((*bo)->flags & AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS)) {
                (*bo)->flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
-               amdgpu_ttm_placement_from_domain(*bo, (*bo)->allowed_domains);
+               amdgpu_bo_placement_from_domain(*bo, (*bo)->allowed_domains);
                r = ttm_bo_validate(&(*bo)->tbo, &(*bo)->placement, &ctx);
                if (r)
                        return r;
index bcbdcf997d2071aa88edbbf45d2617b908927e0b..71792d820ae0cba1306b721744b0d915cbe4da84 100644 (file)
@@ -344,7 +344,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data,
                if (r)
                        goto free_pages;
 
-               amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
+               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
                r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                amdgpu_bo_unreserve(bo);
                if (r)
index 3010f0136de9c4afdb6b20caaef34fab7c4f2a49..7b3398c337f13dab7fa7a9a69d4fa2b7e2e1dce8 100644 (file)
@@ -51,7 +51,7 @@
  *
  */
 
-static bool amdgpu_need_backup(struct amdgpu_device *adev)
+static bool amdgpu_bo_need_backup(struct amdgpu_device *adev)
 {
        if (adev->flags & AMD_IS_APU)
                return false;
@@ -84,7 +84,7 @@ static void amdgpu_bo_subtract_pin_size(struct amdgpu_bo *bo)
        }
 }
 
-static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
+static void amdgpu_bo_destroy(struct ttm_buffer_object *tbo)
 {
        struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);
        struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo);
@@ -111,7 +111,7 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
 }
 
 /**
- * amdgpu_ttm_bo_is_amdgpu_bo - check if the buffer object is an &amdgpu_bo
+ * amdgpu_bo_is_amdgpu_bo - check if the buffer object is an &amdgpu_bo
  * @bo: buffer object to be checked
  *
  * Uses destroy function associated with the object to determine if this is
@@ -120,22 +120,22 @@ static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo)
  * Returns:
  * true if the object belongs to &amdgpu_bo, false if not.
  */
-bool amdgpu_ttm_bo_is_amdgpu_bo(struct ttm_buffer_object *bo)
+bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo)
 {
-       if (bo->destroy == &amdgpu_ttm_bo_destroy)
+       if (bo->destroy == &amdgpu_bo_destroy)
                return true;
        return false;
 }
 
 /**
- * amdgpu_ttm_placement_from_domain - set buffer's placement
+ * amdgpu_bo_placement_from_domain - set buffer's placement
  * @abo: &amdgpu_bo buffer object whose placement is to be set
  * @domain: requested domain
  *
  * Sets buffer's placement according to requested domain and the buffer's
  * flags.
  */
-void amdgpu_ttm_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
+void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
 {
        struct amdgpu_device *adev = amdgpu_ttm_adev(abo->tbo.bdev);
        struct ttm_placement *placement = &abo->placement;
@@ -488,13 +488,13 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,
 #endif
 
        bo->tbo.bdev = &adev->mman.bdev;
-       amdgpu_ttm_placement_from_domain(bo, bp->domain);
+       amdgpu_bo_placement_from_domain(bo, bp->domain);
        if (bp->type == ttm_bo_type_kernel)
                bo->tbo.priority = 1;
 
        r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, bp->type,
                                 &bo->placement, page_align, &ctx, acc_size,
-                                NULL, bp->resv, &amdgpu_ttm_bo_destroy);
+                                NULL, bp->resv, &amdgpu_bo_destroy);
        if (unlikely(r != 0))
                return r;
 
@@ -594,7 +594,7 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
        if (r)
                return r;
 
-       if ((flags & AMDGPU_GEM_CREATE_SHADOW) && amdgpu_need_backup(adev)) {
+       if ((flags & AMDGPU_GEM_CREATE_SHADOW) && amdgpu_bo_need_backup(adev)) {
                if (!bp->resv)
                        WARN_ON(reservation_object_lock((*bo_ptr)->tbo.resv,
                                                        NULL));
@@ -682,7 +682,7 @@ int amdgpu_bo_validate(struct amdgpu_bo *bo)
        domain = bo->preferred_domains;
 
 retry:
-       amdgpu_ttm_placement_from_domain(bo, domain);
+       amdgpu_bo_placement_from_domain(bo, domain);
        r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
        if (unlikely(r == -ENOMEM) && domain != bo->allowed_domains) {
                domain = bo->allowed_domains;
@@ -915,7 +915,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
        /* force to pin into visible video ram */
        if (!(bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS))
                bo->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
-       amdgpu_ttm_placement_from_domain(bo, domain);
+       amdgpu_bo_placement_from_domain(bo, domain);
        for (i = 0; i < bo->placement.num_placement; i++) {
                unsigned fpfn, lpfn;
 
@@ -1246,7 +1246,7 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
        struct amdgpu_bo *abo;
        struct ttm_mem_reg *old_mem = &bo->mem;
 
-       if (!amdgpu_ttm_bo_is_amdgpu_bo(bo))
+       if (!amdgpu_bo_is_amdgpu_bo(bo))
                return;
 
        abo = ttm_to_amdgpu_bo(bo);
@@ -1263,7 +1263,7 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo,
                return;
 
        /* move_notify is called before move happens */
-       trace_amdgpu_ttm_bo_move(abo, new_mem->mem_type, old_mem->mem_type);
+       trace_amdgpu_bo_move(abo, new_mem->mem_type, old_mem->mem_type);
 }
 
 /**
@@ -1285,7 +1285,7 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
        unsigned long offset, size;
        int r;
 
-       if (!amdgpu_ttm_bo_is_amdgpu_bo(bo))
+       if (!amdgpu_bo_is_amdgpu_bo(bo))
                return 0;
 
        abo = ttm_to_amdgpu_bo(bo);
@@ -1307,8 +1307,8 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo)
 
        /* hurrah the memory is not visible ! */
        atomic64_inc(&adev->num_vram_cpu_page_faults);
-       amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM |
-                                        AMDGPU_GEM_DOMAIN_GTT);
+       amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM |
+                                       AMDGPU_GEM_DOMAIN_GTT);
 
        /* Avoid costly evictions; only set GTT as a busy placement */
        abo->placement.num_busy_placement = 1;
index 9c3e29a04eb18868c8f87f9094ac216ddcff3d24..345fcd1769923ff45b35d4b8dc296e186200bc28 100644 (file)
@@ -234,6 +234,9 @@ static inline bool amdgpu_bo_explicit_sync(struct amdgpu_bo *bo)
        return bo->flags & AMDGPU_GEM_CREATE_EXPLICIT_SYNC;
 }
 
+bool amdgpu_bo_is_amdgpu_bo(struct ttm_buffer_object *bo);
+void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain);
+
 int amdgpu_bo_create(struct amdgpu_device *adev,
                     struct amdgpu_bo_param *bp,
                     struct amdgpu_bo **bo_ptr);
index 3ed02f47200350991a8fdc524ad6cfcbc0031ba0..1c5d97f4b4dde4e9a7b53c7ea70fc5746327640e 100644 (file)
@@ -323,7 +323,7 @@ static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf,
                return ret;
 
        if (!bo->pin_count && (bo->allowed_domains & AMDGPU_GEM_DOMAIN_GTT)) {
-               amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
+               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_GTT);
                ret = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
        }
 
index 76920035eb22da59d1204795db3479ebb312b42d..11f262f1520074837458868c91dff59d878da90c 100644 (file)
@@ -436,7 +436,7 @@ TRACE_EVENT(amdgpu_cs_bo_status,
                        __entry->total_bo, __entry->total_size)
 );
 
-TRACE_EVENT(amdgpu_ttm_bo_move,
+TRACE_EVENT(amdgpu_bo_move,
            TP_PROTO(struct amdgpu_bo* bo, uint32_t new_placement, uint32_t old_placement),
            TP_ARGS(bo, new_placement, old_placement),
            TP_STRUCT__entry(
index 8ed102933ca232b8d031802d8f3ffabea2e294f7..6039f8e213580d416b5f4aa685d41d26eeae1119 100644 (file)
@@ -248,7 +248,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
        }
 
        /* Object isn't an AMDGPU object so ignore */
-       if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) {
+       if (!amdgpu_bo_is_amdgpu_bo(bo)) {
                placement->placement = &placements;
                placement->busy_placement = &placements;
                placement->num_placement = 1;
@@ -261,7 +261,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
        case TTM_PL_VRAM:
                if (!adev->mman.buffer_funcs_enabled) {
                        /* Move to system memory */
-                       amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
+                       amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
                } else if (!amdgpu_gmc_vram_full_visible(&adev->gmc) &&
                           !(abo->flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) &&
                           amdgpu_bo_in_cpu_visible_vram(abo)) {
@@ -271,7 +271,7 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
                         * BO will be evicted to GTT rather than causing other
                         * BOs to be evicted from VRAM
                         */
-                       amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM |
+                       amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM |
                                                         AMDGPU_GEM_DOMAIN_GTT);
                        abo->placements[0].fpfn = adev->gmc.visible_vram_size >> PAGE_SHIFT;
                        abo->placements[0].lpfn = 0;
@@ -279,12 +279,12 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
                        abo->placement.num_busy_placement = 1;
                } else {
                        /* Move to GTT memory */
-                       amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT);
+                       amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_GTT);
                }
                break;
        case TTM_PL_TT:
        default:
-               amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
+               amdgpu_bo_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_CPU);
        }
        *placement = abo->placement;
 }
index 80b5c453f8c11c2d987166dd01a37872909c3cc7..e1e4810b9d9e4088c02bb23ed016c55355ec6664 100644 (file)
@@ -473,7 +473,7 @@ static int amdgpu_uvd_cs_pass1(struct amdgpu_uvd_cs_ctx *ctx)
                if (cmd == 0x0 || cmd == 0x3) {
                        /* yes, force it into VRAM */
                        uint32_t domain = AMDGPU_GEM_DOMAIN_VRAM;
-                       amdgpu_ttm_placement_from_domain(bo, domain);
+                       amdgpu_bo_placement_from_domain(bo, domain);
                }
                amdgpu_uvd_force_into_uvd_segment(bo);
 
@@ -1014,7 +1014,7 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,
        if (!ring->adev->uvd.address_64_bit) {
                struct ttm_operation_ctx ctx = { true, false };
 
-               amdgpu_ttm_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_VRAM);
+               amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_VRAM);
                amdgpu_uvd_force_into_uvd_segment(bo);
                r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
                if (r)