summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-10-24 16:10:33 +0800
committerAlex Deucher <alexander.deucher@amd.com>2018-12-10 15:21:13 -0500
commit08d1bdd4cc57e89d037205687a61d2b6ff9dddd4 (patch)
treecf4d24d637428f5cb2be86b6b612c1b881f7f67e /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
parent31edd7c0a813d9dc778fcb5da1eb8202c140dc4d (diff)
downloadtalos-op-linux-08d1bdd4cc57e89d037205687a61d2b6ff9dddd4.tar.gz
talos-op-linux-08d1bdd4cc57e89d037205687a61d2b6ff9dddd4.zip
drm/amdgpu: Limit vm max ctx number to 4096
driver need to reserve resource for each ctx for some hw features. so add this limitation. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 95f4c4139fc6..d85184b5b35c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -248,7 +248,7 @@ static int amdgpu_ctx_alloc(struct amdgpu_device *adev,
return -ENOMEM;
mutex_lock(&mgr->lock);
- r = idr_alloc(&mgr->ctx_handles, ctx, 1, 0, GFP_KERNEL);
+ r = idr_alloc(&mgr->ctx_handles, ctx, 1, AMDGPU_VM_MAX_NUM_CTX, GFP_KERNEL);
if (r < 0) {
mutex_unlock(&mgr->lock);
kfree(ctx);
OpenPOWER on IntegriCloud