Skip to content

Commit c0cd6d2

Browse files
alexdeuchergregkh
authored andcommitted
drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2)
commit abf1457 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 038ab29 commit c0cd6d2

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
@@ -1353,15 +1353,18 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
13531353
tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
13541354
if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) {
13551355
radeon_wait_for_vblank(rdev, i);
1356+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
13561357
tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
13571358
WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i], tmp);
13581359
}
13591360
} else {
13601361
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
13611362
if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
13621363
radeon_wait_for_vblank(rdev, i);
1364+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
13631365
tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
13641366
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
1367+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
13651368
}
13661369
}
13671370
/* wait for the next frame */
@@ -1371,6 +1374,15 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
13711374
break;
13721375
udelay(1);
13731376
}
1377+
1378+
/* XXX this is a hack to avoid strange behavior with EFI on certain systems */
1379+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
1380+
tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
1381+
tmp &= ~EVERGREEN_CRTC_MASTER_EN;
1382+
WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
1383+
WREG32(EVERGREEN_CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
1384+
save->crtc_enabled[i] = false;
1385+
/* ***** */
13741386
} else {
13751387
save->crtc_enabled[i] = false;
13761388
}

0 commit comments

Comments
 (0)