From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 56139] [bisected] kernel 3.7.0-rc1 breaks 6950 (CAYMAN)
Date: Fri, 26 Oct 2012 03:17:36 +0000 [thread overview]
Message-ID: <bug-56139-502-Qdf0lA1Pws@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-56139-502@http.bugs.freedesktop.org/>
[-- Attachment #1.1: Type: text/plain, Size: 5141 bytes --]
https://bugs.freedesktop.org/show_bug.cgi?id=56139
--- Comment #4 from Alexandre Demers <alexandre.f.demers@gmail.com> ---
First, I made a mistake last time I wrote: the evergreen_mc_resume() function
patch was fine. The bad code was in the evergreen_mc_stop() function. Sorry for
the wrong lead, I realized it today when I continued my tests.
Now, I split the evergreen_mc_stop() code in two parts. The following ran fine:
- WREG32(D1VGA_CONTROL, 0);
- WREG32(D2VGA_CONTROL, 0);
- if (rdev->num_crtc >= 4) {
- WREG32(EVERGREEN_D3VGA_CONTROL, 0);
- WREG32(EVERGREEN_D4VGA_CONTROL, 0);
- }
- if (rdev->num_crtc >= 6) {
- WREG32(EVERGREEN_D5VGA_CONTROL, 0);
- WREG32(EVERGREEN_D6VGA_CONTROL, 0);
+ radeon_mc_wait_for_idle(rdev);
+
+ blackout = RREG32(MC_SHARED_BLACKOUT_CNTL);
+ if ((blackout & BLACKOUT_MODE_MASK) != 1) {
+ /* Block CPU access */
+ WREG32(BIF_FB_EN, 0);
+ /* blackout the MC */
+ blackout &= ~BLACKOUT_MODE_MASK;
+ WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1);
and I was able to boot, stop, restart and suspend correctly.
However, when I applied:
void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save
*save)
{
- u32 blackout;
+ u32 crtc_enabled, tmp, frame_count, blackout;
+ int i, j;
save->vga_render_control = RREG32(VGA_RENDER_CONTROL);
save->vga_hdp_control = RREG32(VGA_HDP_CONTROL);
- /* Stop all video */
+ /* disable VGA render */
WREG32(VGA_RENDER_CONTROL, 0);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1);
- if (rdev->num_crtc >= 4) {
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET,
1);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET,
1);
- }
- if (rdev->num_crtc >= 6) {
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET,
1);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET,
1);
- }
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
- if (rdev->num_crtc >= 4) {
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
- }
- if (rdev->num_crtc >= 6) {
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
- }
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
- if (rdev->num_crtc >= 4) {
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET,
0);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET,
0);
- }
- if (rdev->num_crtc >= 6) {
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET,
0);
- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET,
0);
+ /* blank the display controllers */
+ for (i = 0; i < rdev->num_crtc; i++) {
+ crtc_enabled = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]) &
EVERGREEN_CRTC_MASTER_EN;
+ if (crtc_enabled) {
+ save->crtc_enabled[i] = true;
+ if (ASIC_IS_DCE6(rdev)) {
+ tmp = RREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i]);
+ if (!(tmp & EVERGREEN_CRTC_BLANK_DATA_EN)) {
+ radeon_wait_for_vblank(rdev, i);
+ tmp |= EVERGREEN_CRTC_BLANK_DATA_EN;
+ WREG32(EVERGREEN_CRTC_BLANK_CONTROL + crtc_offsets[i],
tmp);
+ }
+ } else {
+ tmp = RREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i]);
+ if (!(tmp & EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE)) {
+ radeon_wait_for_vblank(rdev, i);
+ tmp |= EVERGREEN_CRTC_DISP_READ_REQUEST_DISABLE;
+ WREG32(EVERGREEN_CRTC_CONTROL + crtc_offsets[i], tmp);
+ }
+ }
+ /* wait for the next frame */
+ frame_count = radeon_get_vblank_counter(rdev, i);
+ for (j = 0; j < rdev->usec_timeout; j++) {
+ if (radeon_get_vblank_counter(rdev, i) != frame_count)
+ break;
+ udelay(1);
+ }
+ }
}
the bug appeared. So it seems blanking the display controllers with for(i = 0;
i < rdev->num_crtc; i++) is not equivalent to the code that it replaces. The
original code first wrote in the EVERGREEN_CRTC_UPDATE_LOCK registers, before
setting EVERGREEN_CRTC_CONTROL registers and writing again in the
EVERGREEN_CRTC_UPDATE_LOCK registers. On the other hand, the new code doesn't
write in the EVERGREEN_CRTC_UPDATE_LOCK neither before nor after setting
EVERGREEN_CRTC_CONTROL.
Could this be a clue?
--
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #1.2: Type: text/html, Size: 6020 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-10-26 3:17 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-18 13:48 [Bug 56139] New: [bisected] kernel 3.7.0-rc1 breaks 6950 (CAYMAN) bugzilla-daemon
2012-10-18 13:51 ` [Bug 56139] " bugzilla-daemon
2012-10-18 14:16 ` bugzilla-daemon
2012-10-18 23:46 ` bugzilla-daemon
2012-10-22 5:57 ` bugzilla-daemon
2012-10-26 3:17 ` bugzilla-daemon [this message]
2012-10-26 14:08 ` bugzilla-daemon
2012-10-27 4:51 ` bugzilla-daemon
2012-10-31 18:29 ` bugzilla-daemon
2012-10-31 19:13 ` bugzilla-daemon
2012-11-01 0:38 ` bugzilla-daemon
2012-11-01 5:30 ` bugzilla-daemon
2012-11-05 6:58 ` bugzilla-daemon
2012-11-05 14:03 ` bugzilla-daemon
2012-11-05 14:28 ` bugzilla-daemon
2012-11-05 14:55 ` bugzilla-daemon
2012-11-05 16:20 ` bugzilla-daemon
2012-11-05 16:34 ` bugzilla-daemon
2012-11-05 22:46 ` bugzilla-daemon
2012-11-06 0:33 ` bugzilla-daemon
2012-11-06 1:02 ` bugzilla-daemon
2012-11-06 22:32 ` bugzilla-daemon
2012-11-06 22:50 ` bugzilla-daemon
2012-11-06 22:55 ` bugzilla-daemon
2012-11-06 22:56 ` bugzilla-daemon
2012-11-06 22:59 ` bugzilla-daemon
2012-11-11 18:55 ` bugzilla-daemon
2013-04-17 9:11 ` Huacai Chen
2012-11-12 4:04 ` [Bug 56139] [bisected] kernel 3.7.0-rc1 breaks 6950 (boot/grub2 and suspend/resume) (CAYMAN) bugzilla-daemon
2012-11-12 4:27 ` bugzilla-daemon
2012-11-12 5:32 ` bugzilla-daemon
2012-11-12 23:31 ` bugzilla-daemon
2012-11-13 15:15 ` bugzilla-daemon
2012-11-13 15:45 ` bugzilla-daemon
2012-11-14 16:14 ` bugzilla-daemon
2012-11-18 17:05 ` bugzilla-daemon
2012-11-18 19:04 ` bugzilla-daemon
2012-11-18 19:40 ` bugzilla-daemon
2012-11-18 19:41 ` bugzilla-daemon
2012-11-19 14:05 ` bugzilla-daemon
2012-11-19 14:18 ` bugzilla-daemon
2012-11-19 14:19 ` bugzilla-daemon
2012-11-19 23:31 ` bugzilla-daemon
2012-11-20 6:08 ` bugzilla-daemon
2012-11-20 15:23 ` bugzilla-daemon
2012-11-28 6:44 ` bugzilla-daemon
2012-11-28 14:29 ` bugzilla-daemon
2012-11-28 17:08 ` bugzilla-daemon
2013-01-05 5:57 ` bugzilla-daemon
2013-01-31 0:52 ` bugzilla-daemon
2013-01-31 13:35 ` bugzilla-daemon
2013-02-20 5:34 ` bugzilla-daemon
2013-02-23 10:28 ` bugzilla-daemon
2013-02-24 3:21 ` bugzilla-daemon
2013-02-25 1:56 ` bugzilla-daemon
2013-02-25 13:57 ` bugzilla-daemon
2013-03-11 4:41 ` bugzilla-daemon
2013-03-11 4:51 ` bugzilla-daemon
2013-03-11 13:38 ` bugzilla-daemon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-56139-502-Qdf0lA1Pws@http.bugs.freedesktop.org/ \
--to=bugzilla-daemon@freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).