diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-03-23 04:32:13 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:55:42 -0400 |
commit | eeb2487df75fec73a958b54a1ebefc18808c20ba (patch) | |
tree | 2dfbea30cf609c464ff4780d594e05d38516ff9b /drivers/gpu/drm/amd/amdgpu | |
parent | 5846e355694f8a0be33a29d45ea8cafb0b5de22c (diff) |
drm/amdgpu:fix missing programing critical registers
those MC_VM registers won't be programed by VBIOS in VF
so driver is responsible to programe them.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 9 |
3 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c index 987b21b216f0..5604a53598c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | |||
@@ -53,6 +53,15 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev) | |||
53 | mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB), | 53 | mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB), |
54 | (u32)(value >> 44)); | 54 | (u32)(value >> 44)); |
55 | 55 | ||
56 | if (amdgpu_sriov_vf(adev)) { | ||
57 | /* MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, becuase they are VF copy registers so | ||
58 | vbios post doesn't program them, for SRIOV driver need to program them */ | ||
59 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_FB_LOCATION_BASE), | ||
60 | adev->mc.vram_start >> 24); | ||
61 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_FB_LOCATION_TOP), | ||
62 | adev->mc.vram_end >> 24); | ||
63 | } | ||
64 | |||
56 | /* Disable AGP. */ | 65 | /* Disable AGP. */ |
57 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_AGP_BASE), 0); | 66 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_AGP_BASE), 0); |
58 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_AGP_TOP), 0); | 67 | WREG32(SOC15_REG_OFFSET(GC, 0, mmMC_VM_AGP_TOP), 0); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index f1f4eac11400..87bea71ca0c8 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
@@ -382,7 +382,9 @@ static int gmc_v9_0_late_init(void *handle) | |||
382 | static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev, | 382 | static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev, |
383 | struct amdgpu_mc *mc) | 383 | struct amdgpu_mc *mc) |
384 | { | 384 | { |
385 | u64 base = mmhub_v1_0_get_fb_location(adev); | 385 | u64 base = 0; |
386 | if (!amdgpu_sriov_vf(adev)) | ||
387 | base = mmhub_v1_0_get_fb_location(adev); | ||
386 | amdgpu_vram_location(adev, &adev->mc, base); | 388 | amdgpu_vram_location(adev, &adev->mc, base); |
387 | adev->mc.gtt_base_align = 0; | 389 | adev->mc.gtt_base_align = 0; |
388 | amdgpu_gtt_location(adev, mc); | 390 | amdgpu_gtt_location(adev, mc); |
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c index 128024aba39e..5903bb0dff15 100644 --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | |||
@@ -67,6 +67,15 @@ int mmhub_v1_0_gart_enable(struct amdgpu_device *adev) | |||
67 | mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB), | 67 | mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB), |
68 | (u32)(value >> 44)); | 68 | (u32)(value >> 44)); |
69 | 69 | ||
70 | if (amdgpu_sriov_vf(adev)) { | ||
71 | /* MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, becuase they are VF copy registers so | ||
72 | vbios post doesn't program them, for SRIOV driver need to program them */ | ||
73 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_FB_LOCATION_BASE), | ||
74 | adev->mc.vram_start >> 24); | ||
75 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_FB_LOCATION_TOP), | ||
76 | adev->mc.vram_end >> 24); | ||
77 | } | ||
78 | |||
70 | /* Disable AGP. */ | 79 | /* Disable AGP. */ |
71 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_AGP_BASE), 0); | 80 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_AGP_BASE), 0); |
72 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_AGP_TOP), 0); | 81 | WREG32(SOC15_REG_OFFSET(MMHUB, 0, mmMC_VM_AGP_TOP), 0); |