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.
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
Created attachment 43902 [details] Xorg.log
Created attachment 43912 [details] dmesg
Created attachment 43922 [details] vbios rom
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/
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;
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.
Created attachment 44572 [details] dmesg after resume with DRM_INFO patch
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
Created attachment 45042 [details] 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.
Created attachment 45232 [details] regs before resume
Created attachment 45242 [details] regs after resume
Regs before and after resume ( v2.6.37 ) attached.
What does the distortion look like? Flickering display? garbage on screen? Can you get a picture?
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?
Created attachment 46082 [details] 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.
Created attachment 46092 [details] Single Monitor
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.
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.
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.
Created attachment 46142 [details] fix bios scratch reg settings This patch should fix the problem. Although I don't understand why this was never an issue before...
OK, that patch does fix the problem. Thank you.
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.
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.
Handled-By : Alex Deucher <alexdeucher@gmail.com> Patch : https://bugzilla.kernel.org/attachment.cgi?id=46142
Fixed by commit 87364760de5d631390c478fcbac8db1b926e0adf .