drm/amdgpu: check no_user_fence flag for engines
authorLeo Liu <leo.liu@amd.com>
Wed, 8 May 2019 15:13:53 +0000 (11:13 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:52 +0000 (12:20 -0500)
To replace checking ring type and make them generic

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

index 2f6239b6be6fec001f33f141ae4662b44226a31e..8cee09c60c99e5a8bacd84aa2a59411c3863d952 100644 (file)
@@ -1054,11 +1054,9 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev,
                j++;
        }
 
-       /* UVD & VCE fw doesn't support user fences */
+       /* MM engine doesn't support user fences */
        ring = to_amdgpu_ring(parser->entity->rq->sched);
-       if (parser->job->uf_addr && (
-           ring->funcs->type == AMDGPU_RING_TYPE_UVD ||
-           ring->funcs->type == AMDGPU_RING_TYPE_VCE))
+       if (parser->job->uf_addr && ring->funcs->no_user_fence)
                return -EINVAL;
 
        return amdgpu_ctx_wait_prev_fence(parser->ctx, parser->entity);