Skip to content

Commit abf1457

Browse files
committed
drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2)
Just disabling the mem requests should be enough, but that doesn't seem to work correctly on efi systems. May fix: https://bugs.freedesktop.org/show_bug.cgi?id=57567 https://bugs.freedesktop.org/show_bug.cgi?id=43655 https://bugzilla.kernel.org/show_bug.cgi?id=56441 v2: blank displays first, then disable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent e884fc6 commit abf1457

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/gpu/drm/radeon/evergreen.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,15 +1574,18 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
15741574
tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
15751575
if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) {
15761576
radeon_wait_for_vblank(rdev, i);
1577+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
15771578
tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
15781579
WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
15791580
}
15801581
} else {
15811582
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
15821583
if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
15831584
radeon_wait_for_vblank(rdev, i);
1585+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
15841586
tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
15851587
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
1588+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
15861589
}
15871590
}
15881591
/* wait for the next frame */
@@ -1592,6 +1595,15 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
15921595
break;
15931596
udelay(1);
15941597
}
1598+
1599+
/* XXX this is a hack to avoid strange behavior with EFI on certain systems */
1600+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
1601+
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
1602+
tmp &= ~EVERGREEN_CRTC_MASTER_EN;
1603+
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
1604+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
1605+
save->crtc_enabled[i] = false;
1606+
/* ***** */
15951607
} else {
15961608
save->crtc_enabled[i] = false;
15971609
}

0 commit comments

Comments
 (0)