drm/amdgpu/gfx9: only init the apertures used by KGD (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 1 Jan 2018 21:14:43 +0000 (16:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Jan 2018 20:44:50 +0000 (15:44 -0500)
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 <david1.zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Noticed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 55670dbacaceaab7fd3b96eaab034fb9a32f583c..fc270e2ef91a7baa46baae80ae2b16518894b9e6 100644 (file)
@@ -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) {