From: Alex Deucher Date: Mon, 1 Jan 2018 21:14:43 +0000 (-0500) Subject: drm/amdgpu/gfx9: only init the apertures used by KGD (v2) X-Git-Tag: for-linus-20180210~4^2~6^2~13 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=32b646b215e6e382045cf464e342b1cdd6f901c6;p=linux-2.6-block.git drm/amdgpu/gfx9: only init the apertures used by KGD (v2) Use adev->vm_manager.id_mgr[0].num_ids rather than hardcoded 16. v2: use AMDGPU_GFXHUB rather than hardcoded 0 (Christian) Reviewed-by: Chunming Zhou Reviewed-by: Christian König Noticed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 55670dbacace..fc270e2ef91a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -1526,7 +1526,7 @@ static void gfx_v9_0_gpu_init(struct amdgpu_device *adev) /* XXX SH_MEM regs */ /* where to put LDS, scratch, GPUVM in FSA64 space */ mutex_lock(&adev->srbm_mutex); - for (i = 0; i < 16; i++) { + for (i = 0; i < adev->vm_manager.id_mgr[AMDGPU_GFXHUB].num_ids; i++) { soc15_grbm_select(adev, 0, 0, 0, i); /* CP and shaders */ if (i == 0) {