https://bugzilla.kernel.org/show_bug.cgi?id=26942
Summary: radeon: screen distortion on resume Product: Drivers Version: 2.5 Kernel Version: 2.6.37 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) AssignedTo: drivers_video-dri@kernel-bugs.osdl.org ReportedBy: spoonb@exherbo.org Regression: Yes
With v2.6.37, the radeon KMS drivers, and my RV730 I get a distorted screen when resuming from suspend to ram. This does not occur with v2.6.36 and I have bisected to this commit:
-----------------------------------------------------------------------------
From ba032a58d1f320039e7850fb6e8651695c1aa571 Mon Sep 17 00:00:00 2001
From: Alex Deucher alexdeucher@gmail.com Date: Mon, 4 Oct 2010 17:13:01 -0400 Subject: [PATCH] drm/radeon/kms: rework spread spectrum handling
This patch reworks spread spectrum handling to enable it properly on lvds and DP/eDP links. It also fixes several bugs in the old spread spectrum code.
-----------------------------------------------------------------------------
lspci -v
----------------------------------------------------------------------------- 03:00.0 VGA compatible controller: ATI Technologies Inc RV730 PRO [Radeon HD 4650] (prog-if 00 [VGA controller]) Subsystem: PC Partner Limited Device 9498 Flags: bus master, fast devsel, latency 0, IRQ 40 Memory at e0000000 (64-bit, prefetchable) [size=256M] Memory at fb9e0000 (64-bit, non-prefetchable) [size=64K] I/O ports at ee00 [size=256] [virtual] Expansion ROM at fb900000 [disabled] [size=128K] Capabilities: [50] Power Management version 3 Capabilities: [58] Express Legacy Endpoint, MSI 00 Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> Kernel driver in use: radeon
03:00.1 Audio device: ATI Technologies Inc RV710/730 Subsystem: PC Partner Limited R700 Audio Device [Radeon HD 4000 Series] Flags: bus master, fast devsel, latency 0, IRQ 44 Memory at fb9fc000 (64-bit, non-prefetchable) [size=16K] Capabilities: [50] Power Management version 3 Capabilities: [58] Express Legacy Endpoint, MSI 00 Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> Kernel driver in use: HDA Intel -----------------------------------------------------------------------------
Let me know what else I can provide.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
Alex Deucher alexdeucher@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexdeucher@gmail.com
--- Comment #1 from Alex Deucher alexdeucher@gmail.com 2011-01-17 18:29:07 --- Please attach your xorg log, dmesg output, and a copy of your vbios. To get a copy of your vbios: (as root) (use lspci to get the bus id) cd /sys/bus/pci/devices/<pci bus id> echo 1 > rom cat rom > /tmp/vbios.rom echo 0 > rom
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #2 from Brett Witherspoon spoonb@exherbo.org 2011-01-17 22:51:26 --- Created an attachment (id=43902) --> (https://bugzilla.kernel.org/attachment.cgi?id=43902) Xorg.log
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #3 from Brett Witherspoon spoonb@exherbo.org 2011-01-17 22:51:57 --- Created an attachment (id=43912) --> (https://bugzilla.kernel.org/attachment.cgi?id=43912) dmesg
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #4 from Brett Witherspoon spoonb@exherbo.org 2011-01-17 22:52:22 --- Created an attachment (id=43922) --> (https://bugzilla.kernel.org/attachment.cgi?id=43922) vbios rom
https://bugzilla.kernel.org/show_bug.cgi?id=26942
Rafael J. Wysocki rjw@sisk.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |florian@mickler.org, | |maciej.rutecki@gmail.com, | |rjw@sisk.pl Blocks| |21782, 7216
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #5 from Alex Deucher alexdeucher@gmail.com 2011-01-20 23:22:26 --- Can you dump regs 0x458 and 0x45c using avivotool after resume in the working and non-working states?
(run as root): avivotool regmatch 0x458 avivotool regmatch 0x45c
You can get avivotool here: http://cgit.freedesktop.org/~airlied/radeontool/
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #6 from Alex Deucher alexdeucher@gmail.com 2011-01-20 23:29:07 --- Can you also attach your dmesg after resume with this patch:
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 4a20a62..c19ea3e 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c @@ -418,6 +418,8 @@ static void atombios_crtc_program_ss(struct drm_crtc *crtc,
memset(&args, 0, sizeof(args));
+ DRM_INFO("atombios_crtc_program_ss: %d\n", enable); + if (ASIC_IS_DCE5(rdev)) { args.v3.usSpreadSpectrumAmountFrac = 0; args.v3.ucSpreadSpectrumType = ss->type;
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #7 from Brett Witherspoon spoonb@exherbo.org 2011-01-21 06:32:24 --- Here are the dumps after resume:
v2.6.36.3 ( Working )
avivotool regmatch 0x458: 0x458 0x00000000 (0) avivotool regmatch 0x45c: 0x45c 0x00000000 (0)
v2.6.37 ( Not Working)
avivotool regmatch 0x458: 0x458 0x00000000 (0) avivotool regmatch 0x45c: 0x45c 0x00000000 (0)
And dmesg with the patch after resume is attached.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #8 from Brett Witherspoon spoonb@exherbo.org 2011-01-21 06:33:42 --- Created an attachment (id=44572) --> (https://bugzilla.kernel.org/attachment.cgi?id=44572) dmesg after resume with DRM_INFO patch
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #9 from Alex Deucher alexdeucher@gmail.com 2011-01-24 05:25:57 --- The changes in that patch should only affect those regs I asked you to dump, but they are the same before and after. Can you attach the output of: avivotool regs all before and after? If that gives you any problems, try just dumping the pll regs: avivotool regmatch <reg> where <reg> = 0x400 0x404 0x408 0x40c 0x410 0x414 0x418 0x41c 0x420 0x424 0x430 0x434 0x438 0x43c 0x440 0x444 0x448 0x44c 0x450 0x454
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #10 from kernelbug@sumoreor.com 2011-01-24 23:03:45 --- Created an attachment (id=45042) --> (https://bugzilla.kernel.org/attachment.cgi?id=45042) avivotool regs all output for working and non working suspend
I am having the same problem on resume with kernel 2.6.37. I have attached the output of avivotool regs all for a working resume from 2.6.36 and a non-working resume from 2.6.37. Happy to get you anything else you need.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #11 from Brett Witherspoon spoonb@exherbo.org 2011-01-27 03:26:19 --- Created an attachment (id=45232) --> (https://bugzilla.kernel.org/attachment.cgi?id=45232) regs before resume
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #12 from Brett Witherspoon spoonb@exherbo.org 2011-01-27 03:26:45 --- Created an attachment (id=45242) --> (https://bugzilla.kernel.org/attachment.cgi?id=45242) regs after resume
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #13 from Brett Witherspoon spoonb@exherbo.org 2011-01-27 03:27:23 --- Regs before and after resume ( v2.6.37 ) attached.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #14 from Alex Deucher alexdeucher@gmail.com 2011-02-02 18:18:13 --- What does the distortion look like? Flickering display? garbage on screen? Can you get a picture?
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #15 from Alex Deucher alexdeucher@gmail.com 2011-02-02 19:06:27 --- I've narrowed it down to a set of possible registers. Can you try manually setting the following registers after resume and let me know which, if any, fix the problem?
pll controls: avivotool regset 0x468 0x00000002 avivotool regset 0x46c 0x00000002
uniphy0: avivotool regset 0x7688 0x19011400 avivotool regset 0x7698 0x10101040
uniphy3: avivotool regset 0x7aa8 0x19011400 avivotool regset 0x7ab8 0x10101040
uniphy links: avivotool regset 0x7f20 0x08080100 avivotool regset 0x7f24 0x08080100
Also, it appears you are using two monitors, are both distorted after resume or just one?
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #16 from Brett Witherspoon spoonb@exherbo.org 2011-02-02 19:57:05 --- Created an attachment (id=46082) --> (https://bugzilla.kernel.org/attachment.cgi?id=46082) Both monitors
The distortion looks like horizontal lines with flickering. I attached some pictures for you. It occurs on both monitors.
However, the first pll control restores the image:
avivotool regset 0x468 0x00000002 OLD: 0x468 (0468) 0x00000006 (6) NEW: 0x468 (0468) 0x00000002 (2)
The others don't appear to have any effect.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #17 from Brett Witherspoon spoonb@exherbo.org 2011-02-02 19:58:15 --- Created an attachment (id=46092) --> (https://bugzilla.kernel.org/attachment.cgi?id=46092) Single Monitor
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #18 from kernelbug@sumoreor.com 2011-02-02 20:45:43 --- The first pll control restores the image for me as well. I am using the laptop screen (LVDS) and an external LCD. The distortion occurs only on the laptop screen after resume.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #19 from Brett Witherspoon spoonb@exherbo.org 2011-02-02 21:05:50 --- I am sure the logs indicate this, but in case it is relevant I am using the DVI-0 and HDMI-0 connectors for the monitors.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #20 from Alex Deucher alexdeucher@gmail.com 2011-02-02 21:59:58 --- Thanks. I see what's going on now, but I don't see how that commit could be the one at fault. I suspect in some s/r cases the registers retained the old state so the bug was not exhibited. I should have a patch to test soon.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #21 from Alex Deucher alexdeucher@gmail.com 2011-02-02 22:32:43 --- Created an attachment (id=46142) --> (https://bugzilla.kernel.org/attachment.cgi?id=46142) fix bios scratch reg settings
This patch should fix the problem. Although I don't understand why this was never an issue before...
https://bugzilla.kernel.org/show_bug.cgi?id=26942
--- Comment #22 from Brett Witherspoon spoonb@exherbo.org 2011-02-03 00:25:35 --- OK, that patch does fix the problem. Thank you.
https://bugzilla.kernel.org/show_bug.cgi?id=26942
Rafael J. Wysocki rjw@sisk.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |PATCH_ALREADY_AVAILABLE
--- Comment #23 from Brett Witherspoon spoonb@exherbo.org 2011-02-03 00:46:29 --- This is probably unrelated but I do have some sluggish response when switching to overview mode with mutter/gnome-shell (r600g). Restarting mutter fixes it, so this seems to be an in issue with mutter/gnome-shell so I will report it there.
--- Comment #24 from Alex Deucher alexdeucher@gmail.com 2011-02-03 00:55:08 --- I've sent the patch to Dave for 2.6.38 and 2.6.37 stable. The gnome-shell problem sounds like a userspace issue; either a bug in mutter or a bug in the 3D driver; probably not kernel related.
--- Comment #25 from Rafael J. Wysocki rjw@sisk.pl 2011-02-03 18:50:23 --- Handled-By : Alex Deucher alexdeucher@gmail.com Patch : https://bugzilla.kernel.org/attachment.cgi?id=46142
https://bugzilla.kernel.org/show_bug.cgi?id=26942
Rafael J. Wysocki rjw@sisk.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED Resolution|PATCH_ALREADY_AVAILABLE |CODE_FIX
--- Comment #26 from Rafael J. Wysocki rjw@sisk.pl 2011-02-12 23:19:20 --- Fixed by commit 87364760de5d631390c478fcbac8db1b926e0adf .
dri-devel@lists.freedesktop.org