aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
diff options
context:
space:
mode:
authorHuang Rui <ray.huang@amd.com>2017-05-31 10:32:35 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-06-06 16:58:29 -0400
commit1e4eccdaf293695f4781ce8b08d3b542d87173c5 (patch)
tree22d43c4b975fc591ff6fba01f15f31a1daa64412 /drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
parent3dff4cc4b0f99f039d41ff86c3503372f9719124 (diff)
drm/amdgpu: fix to miss program invalidation at resume
This patch moves invalidation into gart enable function from hw_init. Because we would like align the sequence calling between init and resume. Signed-off-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
index 626afc046f78..bbc310c97070 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
@@ -232,6 +232,20 @@ static void gfxhub_v1_0_setup_vmid_config(struct amdgpu_device *adev)
232 } 232 }
233} 233}
234 234
235static void gfxhub_v1_0_program_invalidation(struct amdgpu_device *adev)
236{
237 unsigned i;
238
239 for (i = 0 ; i < 18; ++i) {
240 WREG32(SOC15_REG_OFFSET(GC, 0,
241 mmVM_INVALIDATE_ENG0_ADDR_RANGE_LO32) +
242 2 * i, 0xffffffff);
243 WREG32(SOC15_REG_OFFSET(GC, 0,
244 mmVM_INVALIDATE_ENG0_ADDR_RANGE_HI32) +
245 2 * i, 0x1f);
246 }
247}
248
235int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev) 249int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
236{ 250{
237 if (amdgpu_sriov_vf(adev)) { 251 if (amdgpu_sriov_vf(adev)) {
@@ -255,6 +269,7 @@ int gfxhub_v1_0_gart_enable(struct amdgpu_device *adev)
255 gfxhub_v1_0_enable_system_domain(adev); 269 gfxhub_v1_0_enable_system_domain(adev);
256 gfxhub_v1_0_disable_identity_aperture(adev); 270 gfxhub_v1_0_disable_identity_aperture(adev);
257 gfxhub_v1_0_setup_vmid_config(adev); 271 gfxhub_v1_0_setup_vmid_config(adev);
272 gfxhub_v1_0_program_invalidation(adev);
258 273
259 return 0; 274 return 0;
260} 275}
@@ -364,18 +379,6 @@ static int gfxhub_v1_0_sw_fini(void *handle)
364 379
365static int gfxhub_v1_0_hw_init(void *handle) 380static int gfxhub_v1_0_hw_init(void *handle)
366{ 381{
367 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
368 unsigned i;
369
370 for (i = 0 ; i < 18; ++i) {
371 WREG32(SOC15_REG_OFFSET(GC, 0,
372 mmVM_INVALIDATE_ENG0_ADDR_RANGE_LO32) +
373 2 * i, 0xffffffff);
374 WREG32(SOC15_REG_OFFSET(GC, 0,
375 mmVM_INVALIDATE_ENG0_ADDR_RANGE_HI32) +
376 2 * i, 0x1f);
377 }
378
379 return 0; 382 return 0;
380} 383}
381 384