Skip to content

Commit

Permalink
drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Victor Lu authored and alexdeucher committed Nov 17, 2023
1 parent 1ffa860 commit 0288603
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
uint64_t value;
int i;

if (amdgpu_sriov_vf(adev))
return;

inst_mask = adev->aid_mask;
for_each_inst(i, inst_mask) {
/* Program the AGP BAR */
Expand All @@ -139,9 +142,6 @@ static void mmhub_v1_8_init_system_aperture_regs(struct amdgpu_device *adev)
WREG32_SOC15(MMHUB, i, regMC_VM_AGP_TOP,
adev->gmc.agp_end >> 24);

if (amdgpu_sriov_vf(adev))
return;

/* Program the system aperture low logical page number. */
WREG32_SOC15(MMHUB, i, regMC_VM_SYSTEM_APERTURE_LOW_ADDR,
min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
Expand Down

0 comments on commit 0288603

Please sign in to comment.