aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-10-21 15:45:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-25 14:38:56 -0400
commit72a57438d1b4a17dc2f3743fcbb8f0b473a63373 (patch)
treef91b6c8067ee01d05f29225f9b44a295541de42c /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
parenta76ed485c57e37d22c7f47eb63120b3618930297 (diff)
drm/amdgpu: consolidate atom scratch reg handling for hangs
Move from asic specific code to common atom code. Reviewed-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/amdgpu_atombios.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
index 8e6bf548d689..76cbb1d08bce 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c
@@ -1784,6 +1784,19 @@ void amdgpu_atombios_scratch_regs_restore(struct amdgpu_device *adev)
1784 WREG32(mmBIOS_SCRATCH_0 + i, adev->bios_scratch[i]); 1784 WREG32(mmBIOS_SCRATCH_0 + i, adev->bios_scratch[i]);
1785} 1785}
1786 1786
1787void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev,
1788 bool hung)
1789{
1790 u32 tmp = RREG32(mmBIOS_SCRATCH_3);
1791
1792 if (hung)
1793 tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG;
1794 else
1795 tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG;
1796
1797 WREG32(mmBIOS_SCRATCH_3, tmp);
1798}
1799
1787/* Atom needs data in little endian format 1800/* Atom needs data in little endian format
1788 * so swap as appropriate when copying data to 1801 * so swap as appropriate when copying data to
1789 * or from atom. Note that atom operates on 1802 * or from atom. Note that atom operates on