Skip to content

Commit e884fc6

Browse files
committed
drm/radeon: disable the crtcs in mc_stop (r5xx-r7xx) (v2)
Just disabling the mem requests should be enough, but that doesn't seem to work correctly on efi systems. v2: blank displays first, then disable. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 968c016 commit e884fc6

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/gpu/drm/radeon/r500_reg.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@
360360

361361
#define AVIVO_D1MODE_MASTER_UPDATE_LOCK 0x60e0
362362
#define AVIVO_D1MODE_MASTER_UPDATE_MODE 0x60e4
363+
#define AVIVO_D1CRTC_UPDATE_LOCK 0x60e8
363364

364365
/* master controls */
365366
#define AVIVO_DC_CRTC_MASTER_EN 0x60f8

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
303303
tmp = RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i]);
304304
if (!(tmp & AVIVO_CRTC_DISP_READ_REQUEST_DISABLE)) {
305305
radeon_wait_for_vblank(rdev, i);
306+
WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
306307
tmp |= AVIVO_CRTC_DISP_READ_REQUEST_DISABLE;
307308
WREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i], tmp);
309+
WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
308310
}
309311
/* wait for the next frame */
310312
frame_count = radeon_get_vblank_counter(rdev, i);
@@ -313,6 +315,15 @@ void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
313315
break;
314316
udelay(1);
315317
}
318+
319+
/* XXX this is a hack to avoid strange behavior with EFI on certain systems */
320+
WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 1);
321+
tmp = RREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i]);
322+
tmp &= ~AVIVO_CRTC_EN;
323+
WREG32(AVIVO_D1CRTC_CONTROL + crtc_offsets[i], tmp);
324+
WREG32(AVIVO_D1CRTC_UPDATE_LOCK + crtc_offsets[i], 0);
325+
save->crtc_enabled[i] = false;
326+
/* ***** */
316327
} else {
317328
save->crtc_enabled[i] = false;
318329
}

0 commit comments

Comments
 (0)