Bug 29272

Summary: [BISECTED] Screen becomes corrupted when switching video mode with Radeon KMS
Product: Drivers Reporter: Jure Repinc (jlp.bugs)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: CLOSED CODE_FIX    
Severity: high CC: alexdeucher, florian, maciej.rutecki, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38-rc5 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 27352    
Attachments: dmesg
lspci
vbios
Xorg.0.log
set frac fb div for dce4+
alternate patch
one more
patch for upstream

Description Jure Repinc 2011-02-17 00:52:25 UTC
After updating the kernel to 2.6.38-rc5 screen gets corrupted when video mode switches for KMS. This is on laptop eMachines E640G with integrated ATI Mobility Radeon HD 5470. It was working just fine with -rc4. I have bisected the commits and this one was pointed out as the culprit:

5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff is the first bad commit
commit 5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Mon Feb 14 11:43:11 2011 -0500

    drm/radeon/kms: hopefully fix pll issues for real (v3)
    
    The problematic boards have a recommended reference divider
    to be used when spread spectrum is enabled on the laptop panel.
    Enable the use of the recommended reference divider along with
    the new pll algo.
    
    v2: testing options
    
    v3: When using the fixed reference divider with LVDS, prefer
    min m to max p and use fractional feedback dividers.
    
    Fixes:
    https://bugzilla.kernel.org/show_bug.cgi?id=28852
    https://bugzilla.kernel.org/show_bug.cgi?id=24462
    https://bugzilla.kernel.org/show_bug.cgi?id=26552
    MacbookPro issues reported by Justin Mattock <justinmattock@gmail.com>
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
    Cc: stable@kernel.org
    Signed-off-by: Dave Airlie <airlied@redhat.com>

:040000 040000 8736f993b97cc8370fd29048761a1e0da4969306 657bdb221e3f4da6efdfec02f8f348db5a537b29 M      drivers
Comment 1 Jure Repinc 2011-02-17 00:54:29 UTC
Created attachment 47972 [details]
dmesg
Comment 2 Jure Repinc 2011-02-17 00:55:51 UTC
Created attachment 47982 [details]
lspci
Comment 3 Alex Deucher 2011-02-17 00:58:19 UTC
Can you attach your xorg log and 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
Comment 4 Jure Repinc 2011-02-17 01:04:36 UTC
Created attachment 47992 [details]
vbios
Comment 5 Jure Repinc 2011-02-17 01:06:20 UTC
Created attachment 48002 [details]
Xorg.0.log
Comment 6 Alex Deucher 2011-02-17 01:24:30 UTC
Created attachment 48012 [details]
set frac fb div for dce4+

Does this patch help?
Comment 7 Jure Repinc 2011-02-17 01:44:20 UTC
No, unfortunately it doesn't help :(
Comment 8 Alex Deucher 2011-02-17 01:53:58 UTC
Created attachment 48022 [details]
alternate patch

How about this one?
Comment 9 Jure Repinc 2011-02-17 02:06:29 UTC
Yes, this one helped :) Thank you very much!
Comment 10 Alex Deucher 2011-02-17 02:07:23 UTC
Created attachment 48032 [details]
one more

If the patch in comment 8 doesn't work, try this one.  But test the one in comment 8 first.
Comment 11 Alex Deucher 2011-02-17 02:18:55 UTC
Created attachment 48042 [details]
patch for upstream

I've attached the commit I'm sending to Dave.
Comment 12 Rafael J. Wysocki 2011-02-17 22:57:46 UTC
Handled-By : Alex Deucher <alexdeucher@gmail.com>
Patch : https://bugzilla.kernel.org/attachment.cgi?id=48042
Comment 13 Florian Mickler 2011-02-20 00:15:25 UTC
merged for .38-rc6:
commit 9f4283f49f0a96a64c5a45fe56f0f8c942885eef
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Wed Feb 16 21:17:04 2011 -0500

    drm/radeon/kms: add missing frac fb div flag for dce4+