drm/amdgpu: nuke the kernel context
authorChristian König <christian.koenig@amd.com>
Thu, 11 Feb 2016 08:56:44 +0000 (09:56 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 12 Feb 2016 20:41:58 +0000 (15:41 -0500)
Not used any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index 4654beac7e706d15a7b5b878e11f3d7533952950..37ac1b2bbadc552ad759816303a5b75beaf51f92 100644 (file)
@@ -1017,10 +1017,6 @@ struct amdgpu_ctx_mgr {
        struct idr              ctx_handles;
 };
 
-int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri,
-                   struct amdgpu_ctx *ctx);
-void amdgpu_ctx_fini(struct amdgpu_ctx *ctx);
-
 struct amdgpu_ctx *amdgpu_ctx_get(struct amdgpu_fpriv *fpriv, uint32_t id);
 int amdgpu_ctx_put(struct amdgpu_ctx *ctx);
 
@@ -2086,9 +2082,6 @@ struct amdgpu_device {
        /* amdkfd interface */
        struct kfd_dev          *kfd;
 
-       /* kernel conext for IB submission */
-       struct amdgpu_ctx       kernel_ctx;
-
        struct amdgpu_virtualization virtualization;
 };
 
index f1f4b453ece127dd8dacb0356454a55ebd61f52a..3b99282a3307b575278e472fd7d7f9416aabafc3 100644 (file)
@@ -25,8 +25,7 @@
 #include <drm/drmP.h>
 #include "amdgpu.h"
 
-int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri,
-                   struct amdgpu_ctx *ctx)
+static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx)
 {
        unsigned i, j;
        int r;
@@ -47,14 +46,11 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri,
        }
        /* create context entity for each ring */
        for (i = 0; i < adev->num_rings; i++) {
+               struct amdgpu_ring *ring = adev->rings[i];
                struct amd_sched_rq *rq;
-               if (pri >= AMD_SCHED_MAX_PRIORITY) {
-                       kfree(ctx->fences);
-                       return -EINVAL;
-               }
-               rq = &adev->rings[i]->sched.sched_rq[pri];
-               r = amd_sched_entity_init(&adev->rings[i]->sched,
-                                         &ctx->rings[i].entity,
+
+               rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_NORMAL];
+               r = amd_sched_entity_init(&ring->sched, &ctx->rings[i].entity,
                                          rq, amdgpu_sched_jobs);
                if (r)
                        break;
@@ -70,7 +66,7 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri,
        return 0;
 }
 
-void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)
+static void amdgpu_ctx_fini(struct amdgpu_ctx *ctx)
 {
        struct amdgpu_device *adev = ctx->adev;
        unsigned i, j;
@@ -108,7 +104,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev,
                return r;
        }
        *id = (uint32_t)r;
-       r = amdgpu_ctx_init(adev, AMD_SCHED_PRIORITY_NORMAL, ctx);
+       r = amdgpu_ctx_init(adev, ctx);
        if (r) {
                idr_remove(&mgr->ctx_handles, *id);
                *id = 0;
index 6bdb891b9ddc2e1433c42850794ff9245ad95c03..93cd1a46ccc4e0ab186a83b72380d137d4e23e6f 100644 (file)
@@ -1551,11 +1551,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                return r;
        }
 
-       r = amdgpu_ctx_init(adev, AMD_SCHED_PRIORITY_KERNEL, &adev->kernel_ctx);
-       if (r) {
-               dev_err(adev->dev, "failed to create kernel context (%d).\n", r);
-               return r;
-       }
        r = amdgpu_ib_ring_tests(adev);
        if (r)
                DRM_ERROR("ib ring test failed (%d).\n", r);
@@ -1619,7 +1614,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev)
        adev->shutdown = true;
        /* evict vram memory */
        amdgpu_bo_evict_vram(adev);
-       amdgpu_ctx_fini(&adev->kernel_ctx);
        amdgpu_ib_pool_fini(adev);
        amdgpu_fence_driver_fini(adev);
        amdgpu_fbdev_fini(adev);
index 97db6beeca13253937c309e9d1691b0cc7139ddf..f29bbb96a88187cdc8e8a82ec611645721c2cb44 100644 (file)
@@ -83,11 +83,6 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring,
                      struct amd_sched_entity *entity, void *owner,
                      struct fence **f)
 {
-       struct amdgpu_device *adev = job->adev;
-
-       if (!entity)
-               entity = &adev->kernel_ctx.rings[ring->idx].entity;
-
        job->ring = ring;
        job->base.sched = &ring->sched;
        job->base.s_entity = entity;