]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/amdgpu/gmc: use proper register for vram type on Fiji
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Mar 2016 20:41:32 +0000 (16:41 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:41:56 +0000 (15:41 +0900)
commit b634de4f446c062a0c95ec4d150b4cf7c85e3526 upstream.

The offset changed on Fiji.

Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c

index f035b5b99cb51c7e5827c9cb1dd24f3ff50b866f..08423089fb84ba7462fc59e979447f46f9a9440e 100644 (file)
@@ -862,6 +862,8 @@ static int gmc_v8_0_late_init(void *handle)
        return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0);
 }
 
+#define mmMC_SEQ_MISC0_FIJI 0xA71
+
 static int gmc_v8_0_sw_init(void *handle)
 {
        int r;
@@ -875,7 +877,12 @@ static int gmc_v8_0_sw_init(void *handle)
        if (adev->flags & AMD_IS_APU) {
                adev->mc.vram_type = AMDGPU_VRAM_TYPE_UNKNOWN;
        } else {
-               u32 tmp = RREG32(mmMC_SEQ_MISC0);
+               u32 tmp;
+
+               if (adev->asic_type == CHIP_FIJI)
+                       tmp = RREG32(mmMC_SEQ_MISC0_FIJI);
+               else
+                       tmp = RREG32(mmMC_SEQ_MISC0);
                tmp &= MC_SEQ_MISC0__MT__MASK;
                adev->mc.vram_type = gmc_v8_0_convert_vram_type(tmp);
        }