]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/amdgpu: move get memory type function from early init to sw init
authorJim Qu <Jim.Qu@amd.com>
Fri, 30 Jun 2017 05:27:54 +0000 (13:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Jun 2017 18:48:46 +0000 (14:48 -0400)
On PX system, it will get memory type before gpu post , and get unkown type.

Signed-off-by: Jim Qu <Jim.Qu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c

index ce68d609b619d5bd86a7b9ca54530382bf79c2cb..d0214d942bfc48f2044d6ef26f8671ee5d3b6f39 100644 (file)
@@ -794,14 +794,6 @@ static int gmc_v6_0_early_init(void *handle)
        gmc_v6_0_set_gart_funcs(adev);
        gmc_v6_0_set_irq_funcs(adev);
 
-       if (adev->flags & AMD_IS_APU) {
-               adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
-       } else {
-               u32 tmp = RREG32(mmMC_SEQ_MISC0);
-               tmp &= MC_SEQ_MISC0__MT__MASK;
-               adev->mc.vram_type = gmc_v6_0_convert_vram_type(tmp);
-       }
-
        return 0;
 }
 
@@ -821,6 +813,14 @@ static int gmc_v6_0_sw_init(void *handle)
        int dma_bits;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (adev->flags & AMD_IS_APU) {
+               adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
+       } else {
+               u32 tmp = RREG32(mmMC_SEQ_MISC0);
+               tmp &= MC_SEQ_MISC0__MT__MASK;
+               adev->mc.vram_type = gmc_v6_0_convert_vram_type(tmp);
+       }
+
        r = amdgpu_irq_add_id(adev, AMDGPU_IH_CLIENTID_LEGACY, 146, &adev->mc.vm_fault);
        if (r)
                return r;