diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-06-30 17:08:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:04 -0400 |
commit | d05da0e24bb584baf634489810561fc3d2a83bf3 (patch) | |
tree | 36d59a326acc891ebe230e6b0311df1283071144 /drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | |
parent | 3164cba317c235f950c861928b290dd93b30d821 (diff) |
drm/amdgpu: unify some atombios/atomfirmware scratch reg functions
Now that we use a pointer to the scratch reg start offset,
most of the functions were duplicated.
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/amdgpu_atomfirmware.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c index 4bdda56fccee..9ddfe34d12af 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | |||
@@ -66,41 +66,6 @@ void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev) | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev) | ||
70 | { | ||
71 | int i; | ||
72 | |||
73 | for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++) | ||
74 | adev->bios_scratch[i] = RREG32(adev->bios_scratch_reg_offset + i); | ||
75 | } | ||
76 | |||
77 | void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev) | ||
78 | { | ||
79 | int i; | ||
80 | |||
81 | /* | ||
82 | * VBIOS will check ASIC_INIT_COMPLETE bit to decide if | ||
83 | * execute ASIC_Init posting via driver | ||
84 | */ | ||
85 | adev->bios_scratch[7] &= ~ATOM_S7_ASIC_INIT_COMPLETE_MASK; | ||
86 | |||
87 | for (i = 0; i < AMDGPU_BIOS_NUM_SCRATCH; i++) | ||
88 | WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]); | ||
89 | } | ||
90 | |||
91 | void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev, | ||
92 | bool hung) | ||
93 | { | ||
94 | u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3); | ||
95 | |||
96 | if (hung) | ||
97 | tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
98 | else | ||
99 | tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
100 | |||
101 | WREG32(adev->bios_scratch_reg_offset + 3, tmp); | ||
102 | } | ||
103 | |||
104 | int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) | 69 | int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) |
105 | { | 70 | { |
106 | struct atom_context *ctx = adev->mode_info.atom_context; | 71 | struct atom_context *ctx = adev->mode_info.atom_context; |