drm/amdgpu: rename amdgpu_wb_* functions
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 14 Dec 2017 21:03:43 +0000 (16:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 18 Dec 2017 15:59:07 +0000 (10:59 -0500)
add device for consistency.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/si_dma.c

index c15b9441190fd49c79757c924abd29a69218499f..81c1ddb9eb3a487bd24bfbf979620632c528d7e8 100644 (file)
@@ -1171,8 +1171,8 @@ struct amdgpu_wb {
        unsigned long           used[DIV_ROUND_UP(AMDGPU_MAX_WB, BITS_PER_LONG)];
 };
 
-int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb);
-void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb);
+int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb);
+void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb);
 
 void amdgpu_get_pcie_info(struct amdgpu_device *adev);
 
index ec078a9a5de82ed98e53272874febd3b6f7e4c96..7b44ca29a2c8ddd7c632ff9c670137ef6796811a 100644 (file)
@@ -530,7 +530,7 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev)
 }
 
 /**
- * amdgpu_wb_get - Allocate a wb entry
+ * amdgpu_device_wb_get - Allocate a wb entry
  *
  * @adev: amdgpu_device pointer
  * @wb: wb index
@@ -538,7 +538,7 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev)
  * Allocate a wb slot for use by the driver (all asics).
  * Returns 0 on success or -EINVAL on failure.
  */
-int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
+int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb)
 {
        unsigned long offset = find_first_zero_bit(adev->wb.used, adev->wb.num_wb);
 
@@ -552,14 +552,14 @@ int amdgpu_wb_get(struct amdgpu_device *adev, u32 *wb)
 }
 
 /**
- * amdgpu_wb_free - Free a wb entry
+ * amdgpu_device_wb_free - Free a wb entry
  *
  * @adev: amdgpu_device pointer
  * @wb: wb index
  *
  * Free a wb slot allocated for use by the driver (all asics)
  */
-void amdgpu_wb_free(struct amdgpu_device *adev, u32 wb)
+void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb)
 {
        if (wb < adev->wb.num_wb)
                __clear_bit(wb >> 3, adev->wb.used);
index ef043361009f4c2a8de0788beeed86aef288cd7a..bb40d2529a307eb9f71973e1d0628e3766da984c 100644 (file)
@@ -203,7 +203,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
 
        spin_lock_init(&kiq->ring_lock);
 
-       r = amdgpu_wb_get(adev, &adev->virt.reg_val_offs);
+       r = amdgpu_device_wb_get(adev, &adev->virt.reg_val_offs);
        if (r)
                return r;
 
@@ -229,7 +229,7 @@ int amdgpu_gfx_kiq_init_ring(struct amdgpu_device *adev,
 void amdgpu_gfx_kiq_free_ring(struct amdgpu_ring *ring,
                              struct amdgpu_irq_src *irq)
 {
-       amdgpu_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
+       amdgpu_device_wb_free(ring->adev, ring->adev->virt.reg_val_offs);
        amdgpu_ring_fini(ring);
 }
 
index f5f27e4f0f7ff1ae788ebb9fa77ed3d3b11ee7ac..06373d44b3da3062d16c3f3a11fc4a7a39508774 100644 (file)
@@ -92,15 +92,15 @@ int amdgpu_ih_ring_init(struct amdgpu_device *adev, unsigned ring_size,
                }
                return 0;
        } else {
-               r = amdgpu_wb_get(adev, &adev->irq.ih.wptr_offs);
+               r = amdgpu_device_wb_get(adev, &adev->irq.ih.wptr_offs);
                if (r) {
                        dev_err(adev->dev, "(%d) ih wptr_offs wb alloc failed\n", r);
                        return r;
                }
 
-               r = amdgpu_wb_get(adev, &adev->irq.ih.rptr_offs);
+               r = amdgpu_device_wb_get(adev, &adev->irq.ih.rptr_offs);
                if (r) {
-                       amdgpu_wb_free(adev, adev->irq.ih.wptr_offs);
+                       amdgpu_device_wb_free(adev, adev->irq.ih.wptr_offs);
                        dev_err(adev->dev, "(%d) ih rptr_offs wb alloc failed\n", r);
                        return r;
                }
@@ -133,8 +133,8 @@ void amdgpu_ih_ring_fini(struct amdgpu_device *adev)
                amdgpu_bo_free_kernel(&adev->irq.ih.ring_obj,
                                      &adev->irq.ih.gpu_addr,
                                      (void **)&adev->irq.ih.ring);
-               amdgpu_wb_free(adev, adev->irq.ih.wptr_offs);
-               amdgpu_wb_free(adev, adev->irq.ih.rptr_offs);
+               amdgpu_device_wb_free(adev, adev->irq.ih.wptr_offs);
+               amdgpu_device_wb_free(adev, adev->irq.ih.rptr_offs);
        }
 }
 
index 41c75f9632dc2f42d18488b11a45a006f33136c9..13044e66dcaf4e6ab0b79fab23aef8db987170db 100644 (file)
@@ -263,25 +263,25 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
                        return r;
        }
 
-       r = amdgpu_wb_get(adev, &ring->rptr_offs);
+       r = amdgpu_device_wb_get(adev, &ring->rptr_offs);
        if (r) {
                dev_err(adev->dev, "(%d) ring rptr_offs wb alloc failed\n", r);
                return r;
        }
 
-       r = amdgpu_wb_get(adev, &ring->wptr_offs);
+       r = amdgpu_device_wb_get(adev, &ring->wptr_offs);
        if (r) {
                dev_err(adev->dev, "(%d) ring wptr_offs wb alloc failed\n", r);
                return r;
        }
 
-       r = amdgpu_wb_get(adev, &ring->fence_offs);
+       r = amdgpu_device_wb_get(adev, &ring->fence_offs);
        if (r) {
                dev_err(adev->dev, "(%d) ring fence_offs wb alloc failed\n", r);
                return r;
        }
 
-       r = amdgpu_wb_get(adev, &ring->cond_exe_offs);
+       r = amdgpu_device_wb_get(adev, &ring->cond_exe_offs);
        if (r) {
                dev_err(adev->dev, "(%d) ring cond_exec_polling wb alloc failed\n", r);
                return r;
@@ -348,11 +348,11 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
        if (!(ring->adev) || !(ring->adev->rings[ring->idx]))
                return;
 
-       amdgpu_wb_free(ring->adev, ring->rptr_offs);
-       amdgpu_wb_free(ring->adev, ring->wptr_offs);
+       amdgpu_device_wb_free(ring->adev, ring->rptr_offs);
+       amdgpu_device_wb_free(ring->adev, ring->wptr_offs);
 
-       amdgpu_wb_free(ring->adev, ring->cond_exe_offs);
-       amdgpu_wb_free(ring->adev, ring->fence_offs);
+       amdgpu_device_wb_free(ring->adev, ring->cond_exe_offs);
+       amdgpu_device_wb_free(ring->adev, ring->fence_offs);
 
        amdgpu_bo_free_kernel(&ring->ring_obj,
                              &ring->gpu_addr,
index ed26dcbc4f795c188dd9b008f3d2280df463276a..e406c93d01d65a56a213c9bb51d1a031da766cd3 100644 (file)
@@ -626,7 +626,7 @@ static int cik_sdma_ring_test_ring(struct amdgpu_ring *ring)
        u32 tmp;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%d) failed to allocate wb slot\n", r);
                return r;
@@ -639,7 +639,7 @@ static int cik_sdma_ring_test_ring(struct amdgpu_ring *ring)
        r = amdgpu_ring_alloc(ring, 5);
        if (r) {
                DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
-               amdgpu_wb_free(adev, index);
+               amdgpu_device_wb_free(adev, index);
                return r;
        }
        amdgpu_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_WRITE, SDMA_WRITE_SUB_OPCODE_LINEAR, 0));
@@ -663,7 +663,7 @@ static int cik_sdma_ring_test_ring(struct amdgpu_ring *ring)
                          ring->idx, tmp);
                r = -EINVAL;
        }
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
 
        return r;
 }
@@ -686,7 +686,7 @@ static int cik_sdma_ring_test_ib(struct amdgpu_ring *ring, long timeout)
        u64 gpu_addr;
        long r;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%ld) failed to allocate wb slot\n", r);
                return r;
@@ -735,7 +735,7 @@ err1:
        amdgpu_ib_free(adev, &ib, NULL);
        dma_fence_put(f);
 err0:
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
        return r;
 }
 
index 121e628e7cdb0ee16902733994f501d491ef539f..0c5b91a40f2267405dc306eda73b09f7af426b35 100644 (file)
@@ -600,7 +600,7 @@ static int sdma_v2_4_ring_test_ring(struct amdgpu_ring *ring)
        u32 tmp;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%d) failed to allocate wb slot\n", r);
                return r;
@@ -613,7 +613,7 @@ static int sdma_v2_4_ring_test_ring(struct amdgpu_ring *ring)
        r = amdgpu_ring_alloc(ring, 5);
        if (r) {
                DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
-               amdgpu_wb_free(adev, index);
+               amdgpu_device_wb_free(adev, index);
                return r;
        }
 
@@ -639,7 +639,7 @@ static int sdma_v2_4_ring_test_ring(struct amdgpu_ring *ring)
                          ring->idx, tmp);
                r = -EINVAL;
        }
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
 
        return r;
 }
@@ -662,7 +662,7 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring, long timeout)
        u64 gpu_addr;
        long r;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%ld) failed to allocate wb slot\n", r);
                return r;
@@ -715,7 +715,7 @@ err1:
        amdgpu_ib_free(adev, &ib, NULL);
        dma_fence_put(f);
 err0:
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
        return r;
 }
 
index 41c60f5ac96eee7f5fdfe05af5a0f4198c93cfab..4e031a2aad9d59980f9600eb9b7d1987e1366ee7 100644 (file)
@@ -867,7 +867,7 @@ static int sdma_v3_0_ring_test_ring(struct amdgpu_ring *ring)
        u32 tmp;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%d) failed to allocate wb slot\n", r);
                return r;
@@ -880,7 +880,7 @@ static int sdma_v3_0_ring_test_ring(struct amdgpu_ring *ring)
        r = amdgpu_ring_alloc(ring, 5);
        if (r) {
                DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
-               amdgpu_wb_free(adev, index);
+               amdgpu_device_wb_free(adev, index);
                return r;
        }
 
@@ -906,7 +906,7 @@ static int sdma_v3_0_ring_test_ring(struct amdgpu_ring *ring)
                          ring->idx, tmp);
                r = -EINVAL;
        }
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
 
        return r;
 }
@@ -929,7 +929,7 @@ static int sdma_v3_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
        u64 gpu_addr;
        long r;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%ld) failed to allocate wb slot\n", r);
                return r;
@@ -981,7 +981,7 @@ err1:
        amdgpu_ib_free(adev, &ib, NULL);
        dma_fence_put(f);
 err0:
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
        return r;
 }
 
index 79e82bf35f7d2cffea2b2df994cc0156efb8a48a..73477c5ed9b4442c1ef2ea198df13221ecd99796 100644 (file)
@@ -869,7 +869,7 @@ static int sdma_v4_0_ring_test_ring(struct amdgpu_ring *ring)
        u32 tmp;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%d) failed to allocate wb slot\n", r);
                return r;
@@ -882,7 +882,7 @@ static int sdma_v4_0_ring_test_ring(struct amdgpu_ring *ring)
        r = amdgpu_ring_alloc(ring, 5);
        if (r) {
                DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
-               amdgpu_wb_free(adev, index);
+               amdgpu_device_wb_free(adev, index);
                return r;
        }
 
@@ -908,7 +908,7 @@ static int sdma_v4_0_ring_test_ring(struct amdgpu_ring *ring)
                          ring->idx, tmp);
                r = -EINVAL;
        }
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
 
        return r;
 }
@@ -931,7 +931,7 @@ static int sdma_v4_0_ring_test_ib(struct amdgpu_ring *ring, long timeout)
        u32 tmp = 0;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%ld) failed to allocate wb slot\n", r);
                return r;
@@ -983,7 +983,7 @@ err1:
        amdgpu_ib_free(adev, &ib, NULL);
        dma_fence_put(f);
 err0:
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
        return r;
 }
 
index ee469a906cd371f37ebf1cad85c51afd567584ee..9adca5d8b04589c989cf64a343a8d2e48ba2ae64 100644 (file)
@@ -221,7 +221,7 @@ static int si_dma_ring_test_ring(struct amdgpu_ring *ring)
        u32 tmp;
        u64 gpu_addr;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%d) failed to allocate wb slot\n", r);
                return r;
@@ -234,7 +234,7 @@ static int si_dma_ring_test_ring(struct amdgpu_ring *ring)
        r = amdgpu_ring_alloc(ring, 4);
        if (r) {
                DRM_ERROR("amdgpu: dma failed to lock ring %d (%d).\n", ring->idx, r);
-               amdgpu_wb_free(adev, index);
+               amdgpu_device_wb_free(adev, index);
                return r;
        }
 
@@ -258,7 +258,7 @@ static int si_dma_ring_test_ring(struct amdgpu_ring *ring)
                          ring->idx, tmp);
                r = -EINVAL;
        }
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
 
        return r;
 }
@@ -281,7 +281,7 @@ static int si_dma_ring_test_ib(struct amdgpu_ring *ring, long timeout)
        u64 gpu_addr;
        long r;
 
-       r = amdgpu_wb_get(adev, &index);
+       r = amdgpu_device_wb_get(adev, &index);
        if (r) {
                dev_err(adev->dev, "(%ld) failed to allocate wb slot\n", r);
                return r;
@@ -328,7 +328,7 @@ err1:
        amdgpu_ib_free(adev, &ib, NULL);
        dma_fence_put(f);
 err0:
-       amdgpu_wb_free(adev, index);
+       amdgpu_device_wb_free(adev, index);
        return r;
 }