drm/amdgpu: remove HW fence owner
authorChristian König <christian.koenig@amd.com>
Tue, 16 Feb 2016 09:57:10 +0000 (10:57 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Mar 2016 16:01:47 +0000 (11:01 -0500)
Not used any more since we now always use the sheduler.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
12 files changed:
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

index 11a9f5899995aa4db0ffd0ee328c5d18e58623ab..fab6ddb26b5b7d260a8d17b59a74fe9663e9eb41 100644 (file)
@@ -409,9 +409,6 @@ struct amdgpu_fence {
        struct amdgpu_ring              *ring;
        uint64_t                        seq;
 
-       /* filp or special value for fence creator */
-       void                            *owner;
-
        wait_queue_t                    fence_wake;
 };
 
@@ -432,8 +429,7 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,
                                   unsigned irq_type);
 void amdgpu_fence_driver_suspend(struct amdgpu_device *adev);
 void amdgpu_fence_driver_resume(struct amdgpu_device *adev);
-int amdgpu_fence_emit(struct amdgpu_ring *ring, void *owner,
-                     struct amdgpu_fence **fence);
+int amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence **fence);
 void amdgpu_fence_process(struct amdgpu_ring *ring);
 int amdgpu_fence_wait_next(struct amdgpu_ring *ring);
 int amdgpu_fence_wait_empty(struct amdgpu_ring *ring);
@@ -1177,8 +1173,7 @@ int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm,
                  unsigned size, struct amdgpu_ib *ib);
 void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib);
 int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
-                      struct amdgpu_ib *ib, void *owner,
-                      struct fence *last_vm_update,
+                      struct amdgpu_ib *ib, struct fence *last_vm_update,
                       struct fence **f);
 int amdgpu_ib_pool_init(struct amdgpu_device *adev);
 void amdgpu_ib_pool_fini(struct amdgpu_device *adev);
index 97db196dc6f836371c309eaebbd669991934c4b8..d94b13ac290fada67eef7ef1a4f27914090eaca4 100644 (file)
@@ -91,25 +91,21 @@ static u32 amdgpu_fence_read(struct amdgpu_ring *ring)
  * amdgpu_fence_emit - emit a fence on the requested ring
  *
  * @ring: ring the fence is associated with
- * @owner: creator of the fence
  * @fence: amdgpu fence object
  *
  * Emits a fence command on the requested ring (all asics).
  * Returns 0 on success, -ENOMEM on failure.
  */
-int amdgpu_fence_emit(struct amdgpu_ring *ring, void *owner,
-                     struct amdgpu_fence **fence)
+int amdgpu_fence_emit(struct amdgpu_ring *ring, struct amdgpu_fence **fence)
 {
        struct amdgpu_device *adev = ring->adev;
 
-       /* we are protected by the ring emission mutex */
        *fence = kmem_cache_alloc(amdgpu_fence_slab, GFP_KERNEL);
        if ((*fence) == NULL) {
                return -ENOMEM;
        }
        (*fence)->seq = ++ring->fence_drv.sync_seq;
        (*fence)->ring = ring;
-       (*fence)->owner = owner;
        fence_init(&(*fence)->base, &amdgpu_fence_ops,
                &ring->fence_drv.fence_queue.lock,
                adev->fence_context + ring->idx,
index 4e978e7aa1b85c4bb3a06da6e867daab7cc9e282..9550247b030d802a9f7dd294d3ac52f4e919ec4b 100644 (file)
@@ -101,7 +101,6 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib)
  * @adev: amdgpu_device pointer
  * @num_ibs: number of IBs to schedule
  * @ibs: IB objects to schedule
- * @owner: owner for creating the fences
  * @f: fence created during this submission
  *
  * Schedule an IB on the associated ring (all asics).
@@ -118,8 +117,7 @@ void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib)
  * to SI there was just a DE IB.
  */
 int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
-                      struct amdgpu_ib *ibs, void *owner,
-                      struct fence *last_vm_update,
+                      struct amdgpu_ib *ibs, struct fence *last_vm_update,
                       struct fence **f)
 {
        struct amdgpu_device *adev = ring->adev;
@@ -183,7 +181,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
                        amdgpu_ring_emit_hdp_invalidate(ring);
        }
 
-       r = amdgpu_fence_emit(ring, owner, &ib->fence);
+       r = amdgpu_fence_emit(ring, &ib->fence);
        if (r) {
                dev_err(adev->dev, "failed to emit fence (%d)\n", r);
                ring->current_ctx = old_ctx;
index 90e52f7e17a0f39a033827e102a8f964e14ab445..692b45560d0a8142f5e9d5aa17b9406057091e47 100644 (file)
@@ -148,7 +148,7 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
        }
 
        trace_amdgpu_sched_run_job(job);
-       r = amdgpu_ib_schedule(job->ring, job->num_ibs, job->ibs, job->owner,
+       r = amdgpu_ib_schedule(job->ring, job->num_ibs, job->ibs,
                               job->sync.last_vm_update, &fence);
        if (r) {
                DRM_ERROR("Error scheduling IBs (%d)\n", r);
index 87690cc57206f2c657e627fdca77322d547a1396..e3673422aac8dce628e36cb073eb03ae87e0c216 100644 (file)
@@ -60,12 +60,8 @@ void amdgpu_sync_create(struct amdgpu_sync *sync)
  */
 static bool amdgpu_sync_same_dev(struct amdgpu_device *adev, struct fence *f)
 {
-       struct amdgpu_fence *a_fence = to_amdgpu_fence(f);
        struct amd_sched_fence *s_fence = to_amd_sched_fence(f);
 
-       if (a_fence)
-               return a_fence->ring->adev == adev;
-
        if (s_fence) {
                struct amdgpu_ring *ring;
 
@@ -85,13 +81,11 @@ static bool amdgpu_sync_same_dev(struct amdgpu_device *adev, struct fence *f)
  */
 static void *amdgpu_sync_get_owner(struct fence *f)
 {
-       struct amdgpu_fence *a_fence = to_amdgpu_fence(f);
        struct amd_sched_fence *s_fence = to_amd_sched_fence(f);
 
        if (s_fence)
                return s_fence->owner;
-       else if (a_fence)
-               return a_fence->owner;
+
        return AMDGPU_FENCE_OWNER_UNDEFINED;
 }
 
index 1de82bf4fc798e2d0128ddae8d6babb7c61d55e9..e5f0a5e29551228efae71e0acc253bf88c9442bf 100644 (file)
@@ -886,8 +886,7 @@ static int amdgpu_uvd_send_msg(struct amdgpu_ring *ring, struct amdgpu_bo *bo,
        ib->length_dw = 16;
 
        if (direct) {
-               r = amdgpu_ib_schedule(ring, 1, ib,
-                                      AMDGPU_FENCE_OWNER_UNDEFINED, NULL, &f);
+               r = amdgpu_ib_schedule(ring, 1, ib, NULL, &f);
                if (r)
                        goto err_free;
 
index 39c3aa60381a58645df8610c830ac7245568079f..6d191fb40b38c308e2c1568cb91ca7c089182ca0 100644 (file)
@@ -425,8 +425,7 @@ int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle,
        for (i = ib->length_dw; i < ib_size_dw; ++i)
                ib->ptr[i] = 0x0;
 
-       r = amdgpu_ib_schedule(ring, 1, ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, ib, NULL, &f);
        if (r)
                goto err;
 
@@ -487,9 +486,7 @@ int amdgpu_vce_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,
                ib->ptr[i] = 0x0;
 
        if (direct) {
-               r = amdgpu_ib_schedule(ring, 1, ib,
-                                      AMDGPU_FENCE_OWNER_UNDEFINED,
-                                      NULL, &f);
+               r = amdgpu_ib_schedule(ring, 1, ib, NULL, &f);
                if (r)
                        goto err;
 
index c4101ebd2b3f20f4a2763d648a96aae16d63b014..b5b4220a6141694667922cba6eb0660bf89043f4 100644 (file)
@@ -643,8 +643,7 @@ static int cik_sdma_ring_test_ib(struct amdgpu_ring *ring)
        ib.ptr[3] = 1;
        ib.ptr[4] = 0xDEADBEEF;
        ib.length_dw = 5;
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r)
                goto err1;
 
index 1b713009c5d2aa43f0a7bc51efed2f49d8103457..46c2436d74bdad23f93fd681d32ecfa88ecf5305 100644 (file)
@@ -2136,8 +2136,7 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
        ib.ptr[2] = 0xDEADBEEF;
        ib.length_dw = 3;
 
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r)
                goto err2;
 
index aeb35f5049994e11e75b1e480fd604c2d4c924bf..e0b64de9b5afe14adbd4d615f0a1ae87efd30d04 100644 (file)
@@ -706,8 +706,7 @@ static int gfx_v8_0_ring_test_ib(struct amdgpu_ring *ring)
        ib.ptr[2] = 0xDEADBEEF;
        ib.length_dw = 3;
 
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r)
                goto err2;
 
@@ -1262,8 +1261,7 @@ static int gfx_v8_0_do_edc_gpr_workarounds(struct amdgpu_device *adev)
        ib.ptr[ib.length_dw++] = EVENT_TYPE(7) | EVENT_INDEX(4);
 
        /* shedule the ib on the ring */
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r) {
                DRM_ERROR("amdgpu: ib submit failed (%d).\n", r);
                goto fail;
index 134d5d0bb77ff3d339f8592d637486fb6accb362..747ef558033a63b0e51da5d390b9e09764229273 100644 (file)
@@ -701,8 +701,7 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring)
        ib.ptr[7] = SDMA_PKT_HEADER_OP(SDMA_OP_NOP);
        ib.length_dw = 8;
 
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r)
                goto err1;
 
index ca12d6faa8c2dda312d0586c027efa75a21ec886..11a544fbf197e13c66395c843f235d1758f8102c 100644 (file)
@@ -853,8 +853,7 @@ static int sdma_v3_0_ring_test_ib(struct amdgpu_ring *ring)
        ib.ptr[7] = SDMA_PKT_NOP_HEADER_OP(SDMA_OP_NOP);
        ib.length_dw = 8;
 
-       r = amdgpu_ib_schedule(ring, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED,
-                              NULL, &f);
+       r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f);
        if (r)
                goto err1;