Bug 28852

Summary: [KMS] radeon artifacts when switched to graphics during boot
Product: Drivers Reporter: Oldřich Jedlička (oldium.pro)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: CLOSED CODE_FIX    
Severity: normal CC: alexdeucher, florian, maciej.rutecki, rjw
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.38-rc2 (branch airlied/drm-2.6.git/drm-fixes) Tree: Mainline
Regression: Yes
Bug Depends on:    
Bug Blocks: 27352    
Attachments: 2.6.38 dmesg
2.6.37 dmesg
VBIOS
`lspci -vnn` with my card
Patch that fixes the problem
possible fix
new patch
final patch

Description Oldřich Jedlička 2011-02-10 21:11:38 UTC
I have running lines on the screen when the radeon driver takes control (see attached video from system boot). In 2.6.37 it worked fine (some old drm-radeon-testing branch), but in 2.6.38 drm-fixes it started to appear.

I will attach dmesg output for both 2.6.37 and 2.6.38 with drm.debug=3.
Comment 1 Oldřich Jedlička 2011-02-10 21:14:00 UTC
Here is the video showing the problem: http://problem.oldium.net/radeon.avi
Comment 2 Oldřich Jedlička 2011-02-10 21:14:42 UTC
Created attachment 47202 [details]
2.6.38 dmesg
Comment 3 Oldřich Jedlička 2011-02-10 21:15:24 UTC
Created attachment 47212 [details]
2.6.37 dmesg
Comment 4 Oldřich Jedlička 2011-02-10 21:26:25 UTC
It is notebook's LVDS on Mobility Radeon HD 3470.
Comment 5 Oldřich Jedlička 2011-02-10 21:29:02 UTC
Sorry, mid-air collision.
Comment 6 Oldřich Jedlička 2011-02-10 21:33:19 UTC
Created attachment 47222 [details]
VBIOS
Comment 7 Alex Deucher 2011-02-10 21:47:26 UTC
Can you attach the output of lspci -vnn for your card?
Comment 9 Oldřich Jedlička 2011-02-10 22:13:11 UTC
I've applied both patches and the problem is worse.
Comment 10 Oldřich Jedlička 2011-02-10 22:14:02 UTC
Created attachment 47242 [details]
`lspci -vnn` with my card
Comment 11 Oldřich Jedlička 2011-02-11 06:21:50 UTC
Created attachment 47262 [details]
Patch that fixes the problem

The patch reverts commit "drm/radeon/kms: disable ss fixed ref divide".
Comment 12 Oldřich Jedlička 2011-02-11 06:24:38 UTC
I've applied the patch on top of the two patches from the mailing list.
Comment 13 Oldřich Jedlička 2011-02-11 06:42:18 UTC
I forgot to mention the rest of my hardware - Acer TravelMate 5730G.
Comment 14 Alex Deucher 2011-02-11 07:12:27 UTC
Does your revert patch work ok without the two mailing list patches?
Comment 15 Alex Deucher 2011-02-11 07:33:25 UTC
Created attachment 47292 [details]
possible fix

Can you try the following patch against 2.6.38-rc4 or newer and make sure all is working well?
Comment 16 Oldřich Jedlička 2011-02-11 20:10:45 UTC
My patch on 2.6.38-rc4 doesn't fix the problem, your patch neither. My patch combined with previous two from mailing list fixes the problem on 2.6.38-rc4.
Comment 17 Alex Deucher 2011-02-12 01:13:59 UTC
Created attachment 47462 [details]
new patch

Can you try this patch?  Try uncommenting the following lines to see if either of those flags work any better.  Try them individually and together if possible and report back which, if any, helps.

/*pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;*/

/*if (ASIC_IS_AVIVO(rdev))
        pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;*/
Comment 18 Oldřich Jedlička 2011-02-12 16:26:09 UTC
Results with 2.6.38-rc4 and first/second block uncommented (no=commented, yes=uncommented):

first second result
-------------------
no    no     bad (usual)
yes   no     worse
no    yes    good
yes   yes    good

The result is that the second block (RADEON_PLL_USE_FRAC_FB_DIV) has to be uncommented on my system. I've tested only LVDS, not any dual-screen configuration.
Comment 19 Rafael J. Wysocki 2011-02-12 22:46:54 UTC
Handled-By : Alex Deucher <alexdeucher@gmail.com>
Comment 20 Alex Deucher 2011-02-13 23:48:00 UTC
Created attachment 47722 [details]
final patch

The attached patch is what I am proposing goes upstream.  Please verify it works properly for you.
Comment 21 Oldřich Jedlička 2011-02-14 07:12:11 UTC
(In reply to comment #20)
> Created an attachment (id=47722) [details]
> final patch
> 
> The attached patch is what I am proposing goes upstream.  Please verify it
> works properly for you.

The patch fixes my problem.
Comment 22 Oldřich Jedlička 2011-02-16 07:22:02 UTC
Latest kernel from airlied/drm-2.6.git, branch drm-fixes, works fine.
Comment 23 Oldřich Jedlička 2011-02-16 19:21:17 UTC
Fixed in mainstream 2.6.38-rc5. Thanks!
Comment 24 Oldřich Jedlička 2011-02-19 11:38:23 UTC
It is safe to mark this bug as RESOLVED. I don't know the correct resolution, though.
Comment 25 Rafael J. Wysocki 2011-02-19 11:46:50 UTC
Fixed by commit 5b40ddf drm/radeon/kms: hopefully fix pll issues for real (v3).