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>
This commit is contained in:
Christian König
2015-08-04 16:58:36 +02:00
committed by Alex Deucher
parent efd4ccb59a
commit 0e89d0c16b
3 changed files with 7 additions and 20 deletions

View File

@@ -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;
}