diff options
| author | Rex Zhu <Rex.Zhu@amd.com> | 2018-10-24 04:10:33 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-10 15:21:13 -0500 |
| commit | 08d1bdd4cc57e89d037205687a61d2b6ff9dddd4 (patch) | |
| tree | cf4d24d637428f5cb2be86b6b612c1b881f7f67e /drivers/gpu/drm/amd/amdgpu | |
| parent | 31edd7c0a813d9dc778fcb5da1eb8202c140dc4d (diff) | |
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')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 5752024aa572..88db3c263e5f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
| @@ -164,6 +164,7 @@ extern int amdgpu_si_support; | |||
| 164 | extern int amdgpu_cik_support; | 164 | extern int amdgpu_cik_support; |
| 165 | #endif | 165 | #endif |
| 166 | 166 | ||
| 167 | #define AMDGPU_VM_MAX_NUM_CTX 4096 | ||
| 167 | #define AMDGPU_SG_THRESHOLD (256*1024*1024) | 168 | #define AMDGPU_SG_THRESHOLD (256*1024*1024) |
| 168 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ | 169 | #define AMDGPU_DEFAULT_GTT_SIZE_MB 3072ULL /* 3GB by default */ |
| 169 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 | 170 | #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000 |
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, | |||
| 248 | return -ENOMEM; | 248 | return -ENOMEM; |
| 249 | 249 | ||
| 250 | mutex_lock(&mgr->lock); | 250 | mutex_lock(&mgr->lock); |
| 251 | r = idr_alloc(&mgr->ctx_handles, ctx, 1, 0, GFP_KERNEL); | 251 | r = idr_alloc(&mgr->ctx_handles, ctx, 1, AMDGPU_VM_MAX_NUM_CTX, GFP_KERNEL); |
| 252 | if (r < 0) { | 252 | if (r < 0) { |
| 253 | mutex_unlock(&mgr->lock); | 253 | mutex_unlock(&mgr->lock); |
| 254 | kfree(ctx); | 254 | kfree(ctx); |
