summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-08-04 16:58:36 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:51:01 -0400
commit0e89d0c16b9446a094215e71734e583c438bf83d (patch)
tree914cd8c6aa9766789e041b0b04c04dc5e285944c /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
parentefd4ccb59a4acb8b85835d6b053362dbacee40f9 (diff)
downloadlwn-0e89d0c16b9446a094215e71734e583c438bf83d.tar.gz
lwn-0e89d0c16b9446a094215e71734e583c438bf83d.zip
drm/amdgpu: stop leaking the ctx id into the scheduler v2
Id's are for the IOCTL ABI only. v2: remove tgid as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 3c353375b228..c2290ae20312 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -50,8 +50,7 @@ static void amdgpu_ctx_do_release(struct kref *ref)
static void amdgpu_ctx_init(struct amdgpu_device *adev,
struct amdgpu_fpriv *fpriv,
- struct amdgpu_ctx *ctx,
- uint32_t id)
+ struct amdgpu_ctx *ctx)
{
int i;
memset(ctx, 0, sizeof(*ctx));
@@ -81,7 +80,7 @@ int amdgpu_ctx_alloc(struct amdgpu_device *adev, struct amdgpu_fpriv *fpriv,
return r;
}
*id = (uint32_t)r;
- amdgpu_ctx_init(adev, fpriv, ctx, *id);
+ amdgpu_ctx_init(adev, fpriv, ctx);
mutex_unlock(&mgr->lock);
} else {
if (adev->kernel_ctx) {
@@ -89,8 +88,7 @@ int amdgpu_ctx_alloc(struct amdgpu_device *adev, struct amdgpu_fpriv *fpriv,
kfree(ctx);
return 0;
}
- *id = AMD_KERNEL_CONTEXT_ID;
- amdgpu_ctx_init(adev, fpriv, ctx, *id);
+ amdgpu_ctx_init(adev, fpriv, ctx);
adev->kernel_ctx = ctx;
}
@@ -105,8 +103,7 @@ int amdgpu_ctx_alloc(struct amdgpu_device *adev, struct amdgpu_fpriv *fpriv,
rq = &adev->rings[i]->scheduler->kernel_rq;
r = amd_context_entity_init(adev->rings[i]->scheduler,
&ctx->rings[i].c_entity,
- NULL, rq, *id,
- amdgpu_sched_jobs);
+ NULL, rq, amdgpu_sched_jobs);
if (r)
break;
}