diff options
author | ozeng <oak.zeng@amd.com> | 2017-06-06 11:53:28 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-11-14 11:35:08 -0500 |
commit | c5066129af4436ab0da8eefe4289774a5409706d (patch) | |
tree | a61408c8f936ec06bf7f740aa8038c9b3ed05f70 /drivers/gpu | |
parent | 8e96e372bceceb76b92a81f8e28bc8163287d25c (diff) |
drm/amdgpu: Properly allocate VM invalidate eng v2
v1: Properly allocate TLB invalidation engine to avoid conflict.
v2: Added comments to codes
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian Konig <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 621699331e09..c8f1aebeac7a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
@@ -392,7 +392,16 @@ static int gmc_v9_0_early_init(void *handle) | |||
392 | static int gmc_v9_0_late_init(void *handle) | 392 | static int gmc_v9_0_late_init(void *handle) |
393 | { | 393 | { |
394 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 394 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
395 | unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 }; | 395 | /* |
396 | * The latest engine allocation on gfx9 is: | ||
397 | * Engine 0, 1: idle | ||
398 | * Engine 2, 3: firmware | ||
399 | * Engine 4~13: amdgpu ring, subject to change when ring number changes | ||
400 | * Engine 14~15: idle | ||
401 | * Engine 16: kfd tlb invalidation | ||
402 | * Engine 17: Gart flushes | ||
403 | */ | ||
404 | unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 }; | ||
396 | unsigned i; | 405 | unsigned i; |
397 | 406 | ||
398 | for(i = 0; i < adev->num_rings; ++i) { | 407 | for(i = 0; i < adev->num_rings; ++i) { |
@@ -405,9 +414,9 @@ static int gmc_v9_0_late_init(void *handle) | |||
405 | ring->funcs->vmhub); | 414 | ring->funcs->vmhub); |
406 | } | 415 | } |
407 | 416 | ||
408 | /* Engine 17 is used for GART flushes */ | 417 | /* Engine 16 is used for KFD and 17 for GART flushes */ |
409 | for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i) | 418 | for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i) |
410 | BUG_ON(vm_inv_eng[i] > 17); | 419 | BUG_ON(vm_inv_eng[i] > 16); |
411 | 420 | ||
412 | return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); | 421 | return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); |
413 | } | 422 | } |