diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-11 03:56:44 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-12 15:41:58 -0500 |
commit | 20874179a22310c2224f43fc5676b7d87ad47e70 (patch) | |
tree | 86a4b3a7188c00dd7975f02431da62f53e974d12 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |
parent | c594989cc0db05a07a852e1da6f5387d8265a64a (diff) |
drm/amdgpu: nuke the kernel context
Not used any more.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index f1f4b453ece1..3b99282a3307 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -25,8 +25,7 @@ | |||
25 | #include <drm/drmP.h> | 25 | #include <drm/drmP.h> |
26 | #include "amdgpu.h" | 26 | #include "amdgpu.h" |
27 | 27 | ||
28 | int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri, | 28 | static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx) |
29 | struct amdgpu_ctx *ctx) | ||
30 | { | 29 | { |
31 | unsigned i, j; | 30 | unsigned i, j; |
32 | int r; | 31 | int r; |
@@ -47,14 +46,11 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri, | |||
47 | } | 46 | } |
48 | /* create context entity for each ring */ | 47 | /* create context entity for each ring */ |
49 | for (i = 0; i < adev->num_rings; i++) { | 48 | for (i = 0; i < adev->num_rings; i++) { |
49 | struct amdgpu_ring *ring = adev->rings[i]; | ||
50 | struct amd_sched_rq *rq; | 50 | struct amd_sched_rq *rq; |
51 | if (pri >= AMD_SCHED_MAX_PRIORITY) { | 51 | |
52 | kfree(ctx->fences); | 52 | rq = &ring->sched.sched_rq[AMD_SCHED_PRIORITY_NORMAL]; |
53 | return -EINVAL; | 53 | r = amd_sched_entity_init(&ring->sched, &ctx->rings[i].entity, |
54 | } | ||
55 | rq = &adev->rings[i]->sched.sched_rq[pri]; | ||
56 | r = amd_sched_entity_init(&adev->rings[i]->sched, | ||
57 | &ctx->rings[i].entity, | ||
58 | rq, amdgpu_sched_jobs); | 54 | rq, amdgpu_sched_jobs); |
59 | if (r) | 55 | if (r) |
60 | break; | 56 | break; |
@@ -70,7 +66,7 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, enum amd_sched_priority pri, | |||
70 | return 0; | 66 | return 0; |
71 | } | 67 | } |
72 | 68 | ||
73 | void amdgpu_ctx_fini(struct amdgpu_ctx *ctx) | 69 | static void amdgpu_ctx_fini(struct amdgpu_ctx *ctx) |
74 | { | 70 | { |
75 | struct amdgpu_device *adev = ctx->adev; | 71 | struct amdgpu_device *adev = ctx->adev; |
76 | unsigned i, j; | 72 | unsigned i, j; |
@@ -108,7 +104,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev, | |||
108 | return r; | 104 | return r; |
109 | } | 105 | } |
110 | *id = (uint32_t)r; | 106 | *id = (uint32_t)r; |
111 | r = amdgpu_ctx_init(adev, AMD_SCHED_PRIORITY_NORMAL, ctx); | 107 | r = amdgpu_ctx_init(adev, ctx); |
112 | if (r) { | 108 | if (r) { |
113 | idr_remove(&mgr->ctx_handles, *id); | 109 | idr_remove(&mgr->ctx_handles, *id); |
114 | *id = 0; | 110 | *id = 0; |