Skip to content

Commit 0288603

Browse files
victorlu-amdalexdeucher
authored andcommitted
drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2)
MC_VM_AGP_* registers should not be programmed by guest driver. v2: move early return outside of loop Signed-off-by: Victor Lu <victorchengchi.lu@amd.com> Reviewed-by: Samir Dhume <samir.dhume@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 1ffa860 commit 0288603

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
130130
uint64_t value;
131131
int i;
132132

133+
if (amdgpu_sriov_vf(adev))
134+
return;
135+
133136
inst_mask = adev->aid_mask;
134137
for_each_inst(i, inst_mask) {
135138
/* Program the AGP BAR */
@@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
139142
WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP,
140143
adev->gmc.agp_end >> 24);
141144

142-
if (amdgpu_sriov_vf(adev))
143-
return;
144-
145145
/* Program the system aperture low logical page number. */
146146
WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR,
147147
min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);

0 commit comments

Comments
 (0)