commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
Subsystems (2)
With the current HEAD Im getting screen flickering really bad to point where it looks like the screen is damaged and/or half plugged-in etc..
the bisect pointed to here:
commit 619efb105924d8cafa0c1dd9389e9ab506f5425d
doing a git revert 619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time being I'll revert this on my machine with the current, until later on.
lspci -vv shows my card info(let me know if you need anymore)
01:00.0 VGA compatible controller: ATI Technologies Inc M56P [Radeon Mobility X1600] (prog-if 00 [VGA controller])
Subsystem: Apple Computer Inc. MacBook Pro
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 256 bytes
Interrupt: pin A routed to IRQ 42
Region 0: Memory at 40000000 (32-bit, prefetchable) [size=128M]
Region 1: I/O ports at 3000 [size=256]
Region 2: Memory at 50300000 (32-bit, non-prefetchable) [size=64K]
Expansion ROM at 50320000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeon
Justin P. Mattock
Quoted 11 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where it looks like the screen is damaged and/or half plugged-in etc..
the bisect pointed to here:
commit
619efb105924d8cafa0c1dd9389e9ab506f5425ddoing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time being I'll revert this on my machine with the current, until later on.
The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
Alex
Quoted 21 lines
lspci -vv shows my card info(let me know if you need anymore)
01:00.0 VGA compatible controller: ATI Technologies Inc M56P [Radeon Mobility X1600] (prog-if 00 [VGA controller])
Subsystem: Apple Computer Inc. MacBook Pro
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 256 bytes
Interrupt: pin A routed to IRQ 42
Region 0: Memory at 40000000 (32-bit, prefetchable) [size=128M] Region 1: I/O ports at 3000 [size=256]
Region 2: Memory at 50300000 (32-bit, non-prefetchable) [size=64K] Expansion ROM at 50320000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeon
Quoted 2 lines
Justin P. Mattock
From 1fce058d7f063b481a274b0a653ffad94f5e9b23 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Tue, 8 Feb 2011 16:13:27 -0500
Subject: [PATCH] drm/radeon/kms: fix pll algo quirk function
I'm sick of fighting this. Just add a new pick_pll_algo() function and quirk specific boards as they are reported.
Add a quirk for the pll algo selection on the MacBookPro2,2.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 39 +++++++++++++++++++++++++++----- 1 files changed, 33 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +33 -6
@@ -839,6 +839,32 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,atom_execute_table (rdev->mode_info.atom_context, index, (uint32_t *)&args); } +#define RADEON_PLL_ALGO_LEGACY 0 +#define RADEON_PLL_ALGO_AVIVO 1 + +static int atombios_crtc_pick_pll_algo (struct drm_crtc *crtc,struct drm_display_mode *mode) +{ +struct drm_device *dev = crtc->dev; +struct radeon_device *rdev = dev->dev_private; + +/* board specific quirks */ +/* funky macbooks */ +if ((dev->pdev->device ==0x71C5 ) && + (dev->pdev->subsystem_vendor ==0x106b ) && + (dev->pdev->subsystem_device ==0x0080 )) { +return RADEON_PLL_ALGO_LEGACY ; + } + +/* defaults */ +/* rv515 seems happier with the old algo */ +if (rdev->family ==CHIP_RV515 ) +return RADEON_PLL_ALGO_LEGACY ; +else if (ASIC_IS_AVIVO (rdev)) +return RADEON_PLL_ALGO_AVIVO ; + +return RADEON_PLL_ALGO_LEGACY ; +} +static void atombios_crtc_set_pll (struct drm_crtc *crtc,struct drm_display_mode *mode) {struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc);
@@ -957,16 +983,17 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode/* adjust pixel clock as needed */ adjusted_clock =atombios_adjust_pll (crtc, mode, pll, ss_enabled, &ss); -/* rv515 seems happier with the old algo */ -if (rdev->family ==CHIP_RV515 ) +switch (atombios_crtc_pick_pll_algo (crtc, mode)) { +case RADEON_PLL_ALGO_LEGACY : +default :radeon_compute_pll_legacy (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div); -else if (ASIC_IS_AVIVO (rdev)) +break ; +case RADEON_PLL_ALGO_AVIVO :radeon_compute_pll_avivo (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div); -else -radeon_compute_pll_legacy (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); +break ; + };atombios_crtc_program_ss (crtc,ATOM_DISABLE , radeon_crtc->pll_id, &ss);
Signature · 1 line
1.7.1.1
Quoted 44 lines · Alex Deucher
Quoted 11 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where it looks like the screen is damaged and/or half plugged-in etc..
the bisect pointed to here:
commit
619efb105924d8cafa0c1dd9389e9ab506f5425ddoing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time being I'll revert this on my machine with the current, until later on.The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
Alex
Quoted 24 lines
lspci -vv shows my card info(let me know if you need anymore)
01:00.0 VGA compatible controller: ATI Technologies Inc M56P [Radeon Mobility X1600] (prog-if 00 [VGA controller])
Subsystem: Apple Computer Inc. MacBook Pro
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr-
Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 256 bytes
Interrupt: pin A routed to IRQ 42
Region 0: Memory at 40000000 (32-bit, prefetchable)
[size=128M]Region 1: I/O ports at 3000 [size=256] Region 2: Memory at 50300000 (32-bit, non-prefetchable)[size=64K]
Expansion ROM at 50320000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeon
Quoted 3 lines
Quoted 2 lines
Justin P. Mattock
<0001-drm-radeon-kms-fix-pll-algo-quirk-function.patch>
cool... The patch fixes it over here
Reported-and-Tested by: Justin P. Mattock<[email protected]>
Thanks..
Justin P. Mattock
Quoted 9 lines · Alex Deucher
Quoted 7 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where it looks like the screen is damaged and/or half plugged-in etc..
the bisect pointed to here:
commit
619efb105924d8cafa0c1dd9389e9ab506f5425d
Quoted 9 lines
Quoted 4 lines
doing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time being I'll revert this on my machine with the current, until later on.The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
The attached patch builds on the previous one and fixes an additional regression.
Alex
Quoted 26 lines
Alex
Quoted 23 lines
lspci -vv shows my card info(let me know if you need anymore)
01:00.0 VGA compatible controller: ATI Technologies Inc M56P [Radeon Mobility X1600] (prog-if 00 [VGA controller])
Subsystem: Apple Computer Inc. MacBook Pro
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 256 bytes
Interrupt: pin A routed to IRQ 42
Region 0: Memory at 40000000 (32-bit, prefetchable) [size=128M] Region 1: I/O ports at 3000 [size=256]
Region 2: Memory at 50300000 (32-bit, non-prefetchable) [size=64K] Expansion ROM at 50320000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: radeon
Kernel modules: radeonJustin P. Mattock
From c88cf9c2463629ab0cef7df8ade34750cde9b40a Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Wed, 9 Feb 2011 17:05:07 -0500
Subject: [PATCH] drm/radeon/kms: pll quirk cleanup
Default to legacy pll algo, add quirks for specific regressions. Fixes regressions reported in:
https://bugzilla.kernel.org/show_bug.cgi?id=26552
--- drivers/gpu/drm/radeon/atombios_crtc.c | 52 +++++++++++++++++++++++++------ drivers/gpu/drm/radeon/radeon_mode.h | 8 +++++ 2 files changed, 50 insertions(+), 10 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +42 -10
@@ -31,6 +31,11 @@#include "atom.h" #include "atom-bits.h" +static enum radeon_pll_algo +atombios_crtc_pick_pll_algo (struct drm_crtc *crtc, +struct drm_display_mode *mode, +uint32_t active_device); +static void atombios_overscan_setup (struct drm_crtc *crtc,struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode)
@@ -519,6 +524,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,/* reset the pll flags */ pll->flags =0 ; + pll->algo =RADEON_PLL_ALGO_LEGACY ;if (ASIC_IS_AVIVO (rdev)) { if ((rdev->family == CHIP_RS600) ||
@@ -584,6 +590,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,if (encoder->encoder_type ==DRM_MODE_ENCODER_LVDS ) pll->flags |=RADEON_PLL_USE_REF_DIV ; } + pll->algo =atombios_crtc_pick_pll_algo (crtc, mode, radeon_encoder->active_device);break ; } }
@@ -839,29 +846,54 @@ static void atombios_crtc_program_pll(struct drm_crtc *crtc,atom_execute_table (rdev->mode_info.atom_context, index, (uint32_t *)&args); } -#define RADEON_PLL_ALGO_LEGACY 0 -#define RADEON_PLL_ALGO_AVIVO 1 -static int atombios_crtc_pick_pll_algo (struct drm_crtc *crtc,struct drm_display_mode *mode) +static enum radeon_pll_algo +atombios_crtc_pick_pll_algo (struct drm_crtc *crtc, +struct drm_display_mode *mode, +uint32_t active_device) {struct drm_device *dev = crtc->dev; -struct radeon_device *rdev = dev->dev_private;/* board specific quirks */ -/* funky macbooks */ + +/* legacy algo */ +/* macbookpro2,2 */ if ((dev->pdev->device ==0x71C5 ) && (dev->pdev->subsystem_vendor ==0x106b ) && (dev->pdev->subsystem_device ==0x0080 )) {return RADEON_PLL_ALGO_LEGACY ; } -/* defaults */ -/* rv515 seems happier with the old algo */ -if (rdev->family ==CHIP_RV515 ) +/* Thinkpad T60 */ +if ((dev->pdev->device ==0x7145 ) && + (dev->pdev->subsystem_vendor ==0x17aa ) && + (dev->pdev->subsystem_device ==0x2006 )) {return RADEON_PLL_ALGO_LEGACY ; -else if (ASIC_IS_AVIVO (rdev)) + } + +/* Acer RS880 */ +if ((dev->pdev->device ==0x9712 ) && + (dev->pdev->subsystem_vendor ==0x1025 ) && + (dev->pdev->subsystem_device ==0x027d )) { +return RADEON_PLL_ALGO_LEGACY ; + } + +/* avivo algo */ +/* PC Partner RV630 */ +if ((dev->pdev->device ==0x9589 ) && + (dev->pdev->subsystem_vendor ==0x174b ) && + (dev->pdev->subsystem_device ==0xe410 )) {return RADEON_PLL_ALGO_AVIVO ; + } + +/* Toshiba Satellite A100 */ +if ((dev->pdev->device ==0x71C5 ) && + (dev->pdev->subsystem_vendor ==0x1179 ) && + (dev->pdev->subsystem_device ==0xff10 )) { +return RADEON_PLL_ALGO_AVIVO ; + } +/* default to the legacy algo */ return RADEON_PLL_ALGO_LEGACY ; }
@@ -983,7 +1015,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode/* adjust pixel clock as needed */ adjusted_clock =atombios_adjust_pll (crtc, mode, pll, ss_enabled, &ss); -switch (atombios_crtc_pick_pll_algo (crtc, mode)) { +switch (pll->algo) {case RADEON_PLL_ALGO_LEGACY :default : radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
drivers/gpu/drm/radeon/radeon_mode.h +8 -0
@@ -151,6 +151,12 @@ struct radeon_tmds_pll {#define RADEON_PLL_IS_LCD (1 << 13)#define RADEON_PLL_PREFER_MINM_OVER_MAXP (1 << 14) +/* pll algo */ +enum radeon_pll_algo { +RADEON_PLL_ALGO_LEGACY , +RADEON_PLL_ALGO_AVIVO +}; +struct radeon_pll {/* reference frequency */ uint32_t reference_freq;
@@ -183,6 +189,8 @@ struct radeon_pll {/* pll id */ uint32_t id; +/* pll algo */ +enum radeon_pll_algo algo; };struct radeon_i2c_chan {
Signature · 1 line
1.7.1.1
Quoted 20 lines · Alex Deucher
Quoted 9 lines · Alex Deucher
Quoted 7 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where it looks like the screen is damaged and/or half plugged-in etc..
the bisect pointed to here:
commit
619efb105924d8cafa0c1dd9389e9ab506f5425dQuoted 9 lines
Quoted 4 lines
doing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time being I'll revert this on my machine with the current, until later on.The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
Quoted 6 lines
The attached patch builds on the previous one and fixes an additional regression.
Alex
<0001-drm-radeon-kms-pll-quirk-cleanup.patch>
alright... didn't mean to keep you waiting(out of my office for most of the day).. Anyways patch applied, and everything looks good no screen jitters or flickering etc..
Thanks for sending this my way so my machine works..
cheers,
Justin P. Mattock
Quoted 35 lines · Justin Mattock
Quoted 25 lines · Alex Deucher
Quoted 18 lines · Alex Deucher
Quoted 7 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where
it looks like the screen is damaged and/or half plugged-in etc..the bisect pointed to here:
Quoted 7 lines
commit
619efb105924d8cafa0c1dd9389e9ab506f5425ddoing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time
being I'll revert this on my machine with the current, until later on.Quoted 4 lines
The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
Quoted 6 lines
The attached patch builds on the previous one and fixes an additional regression.
Alex
<0001-drm-radeon-kms-pll-quirk-cleanup.patch>
Quoted 8 lines
alright... didn't mean to keep you waiting(out of my office for most of the day)..
Anyways patch applied, and everything looks good no screen jitters or flickering etc..Reported-and-Tested-by Justin P. Mattock<[email protected]>Thanks for sending this my way so my machine works..
Justin, can you try without these patches, but with the following patch instead?
(quoted diff) +0 -0
b/drivers/gpu/drm/radeon/atombios_crtc.c
index cc6bdd8..2f9d113 100644
drivers/gpu/drm/radeon/atombios_crtc.c +1 -1
@@ -562,7 +562,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, } }/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +#if 1 /* doesn't work properly on some laptops */ /* use recommended ref_div for ss */ if (radeon_encoder->devices &
(ATOM_DEVICE_LCD_SUPPORT)) {
if (ss_enabled) {Quoted 5 lines
cheers,
Justin P. Mattock
Quoted 42 lines · Alex Deucher
Quoted 40 lines · Justin Mattock
Quoted 25 lines · Alex Deucher
Quoted 18 lines · Alex Deucher
Quoted 7 lines · Justin P. Mattock
With the current HEAD Im getting screen flickering really bad to point where
it looks like the screen is damaged and/or half plugged-in etc..the bisect pointed to here:
Quoted 7 lines
commit
619efb105924d8cafa0c1dd9389e9ab506f5425ddoing a git revert
619efb10592
gets the screen working properly again.
I havent looked much through the code to see if I can fix this. for the time
being I'll revert this on my machine with the current, until later on.Quoted 4 lines
The attached patch should fix it assuming I got your pci ids correct. I'm done with the pll stuff; too may fixes break other boards. Just add a quirk table and be done with it.
Quoted 6 lines
The attached patch builds on the previous one and fixes an additional regression.
Alex
<0001-drm-radeon-kms-pll-quirk-cleanup.patch>
alright... didn't mean to keep you waiting(out of my office for most of the day)..
Anyways patch applied, and everything looks good no screen jitters or flickering etc..
Quoted 6 lines
Quoted 3 lines
Reported-and-Tested-by Justin P. Mattock<[email protected]>Thanks for sending this my way so my machine works..
Justin, can you try without these patches, but with the following patch instead?
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 12 lines
drivers/gpu/drm/radeon/atombios_crtc.c +1
-1@@ -562,7 +562,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, } } /* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +#if 1 /* doesn't work properly on some laptops */ /* use recommended ref_div for ss */
Quoted 11 lines
if (
radeon_encoder->devices& (ATOM_DEVICE_LCD_SUPPORT)) {
if (ss_enabled) {Quoted 5 lines
cheers,
Justin P. Mattock
From e1c5703223d21441bcbdd222572e592984e5ae10 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 11 Feb 2011 02:25:51 -0500
Subject: [PATCH] drm/radeon/kms: hopefully fix pll issues for real
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. This should hopefully fix the issues across the board.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +5 -13
@@ -555,8 +555,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, dp_clock = dig_connector->dp_clock; } } -/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +/* use recommended ref_div for ss */ if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) {if (ss_enabled) {
@@ -566,18 +565,15 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, } } } -#endif +if (ASIC_IS_AVIVO (rdev)) {/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ if (radeon_encoder->encoder_id ==ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1 ) adjusted_clock = mode->clock *2 ;if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT )) pll->flags |=RADEON_PLL_PREFER_CLOSEST_LOWER ; -/* rv515 needs more testing with this option */ -if (rdev->family !=CHIP_RV515 ) { -if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) - pll->flags |=RADEON_PLL_IS_LCD ; - } +if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) + pll->flags |=RADEON_PLL_IS_LCD ; }else {if (encoder->encoder_type !=DRM_MODE_ENCODER_DAC ) pll->flags |=RADEON_PLL_NO_ODD_POST_DIV ;
@@ -957,11 +953,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode/* adjust pixel clock as needed */ adjusted_clock =atombios_adjust_pll (crtc, mode, pll, ss_enabled, &ss); -/* rv515 seems happier with the old algo */ -if (rdev->family ==CHIP_RV515 ) -radeon_compute_pll_legacy (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); -else if (ASIC_IS_AVIVO (rdev)) +if (ASIC_IS_AVIVO (rdev))radeon_compute_pll_avivo (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div);else
Signature · 1 line
1.7.1.1
Quoted 6 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
o.k. applied that patch... unfortunately Im seeing the flickering screen and the crud shows up.. initially during boot everything looked fine, its when I suspended the machine, upon wake-up the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4
Justin P. Mattock
Quoted 7 lines · Justin Mattock
Quoted 6 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 6 lines
o.k. applied that patch... unfortunately Im seeing the flickering screen and the crud shows up..
initially during boot everything looked fine, its when I suspended the machine, upon wake-up
the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4
Can you try the following patch on top of the first two patches I posted to this thread?
Thanks,
(quoted diff) +0 -0
b/drivers/gpu/drm/radeon/atombios_crtc.c
index cc6bdd8..2f9d113 100644
drivers/gpu/drm/radeon/atombios_crtc.c +1 -1
@@ -562,7 +562,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, } }/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +#if 1 /* doesn't work properly on some laptops */ /* use recommended ref_div for ss */ if (radeon_encoder->devices &
(ATOM_DEVICE_LCD_SUPPORT)) {
if (ss_enabled) {Quoted 3 lines
Justin P. Mattock
Quoted 7 lines · Justin Mattock
Quoted 6 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 6 lines
o.k. applied that patch... unfortunately Im seeing the flickering screen and the crud shows up..
initially during boot everything looked fine, its when I suspended the machine, upon wake-up
the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4
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;*/
Thanks!
Alex
Quoted 3 lines
Justin P. Mattock
From b92bf64a4fc181c6a783cc0d51a6881fc8a353a7 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Fri, 11 Feb 2011 20:10:11 -0500
Subject: [PATCH] drm/radeon/kms: hopefully fix pll issues for real (v2)
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. This should hopefully fix the issues across the board.
v2: add some options to uncomment and try
--- drivers/gpu/drm/radeon/atombios_crtc.c | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +8 -13
@@ -531,6 +531,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, pll->flags |=RADEON_PLL_PREFER_HIGH_FB_DIV ; else pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; +/*pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;*/ }else { pll->flags |=RADEON_PLL_LEGACY ;
@@ -555,29 +556,27 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, dp_clock = dig_connector->dp_clock; } } -/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +/* use recommended ref_div for ss */ if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) {if (ss_enabled) {if (ss->refdiv) { pll->flags |=RADEON_PLL_USE_REF_DIV ; pll->reference_div = ss->refdiv; +/*if (ASIC_IS_AVIVO(rdev)) +pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;*/ } } } -#endif +if (ASIC_IS_AVIVO (rdev)) {/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ if (radeon_encoder->encoder_id ==ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1 ) adjusted_clock = mode->clock *2 ;if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT )) pll->flags |=RADEON_PLL_PREFER_CLOSEST_LOWER ; -/* rv515 needs more testing with this option */ -if (rdev->family !=CHIP_RV515 ) { -if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) - pll->flags |=RADEON_PLL_IS_LCD ; - } +if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) + pll->flags |=RADEON_PLL_IS_LCD ; }else {if (encoder->encoder_type !=DRM_MODE_ENCODER_DAC ) pll->flags |=RADEON_PLL_NO_ODD_POST_DIV ;
@@ -957,11 +956,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode/* adjust pixel clock as needed */ adjusted_clock =atombios_adjust_pll (crtc, mode, pll, ss_enabled, &ss); -/* rv515 seems happier with the old algo */ -if (rdev->family ==CHIP_RV515 ) -radeon_compute_pll_legacy (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); -else if (ASIC_IS_AVIVO (rdev)) +if (ASIC_IS_AVIVO (rdev))radeon_compute_pll_avivo (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div);else
Signature · 1 line
1.7.1.1
Quoted 25 lines · Alex Deucher
Quoted 7 lines · Justin Mattock
Quoted 6 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 6 lines
o.k. applied that patch... unfortunately Im seeing the flickering screen and the crud shows up..
initially during boot everything looked fine, its when I suspended the machine, upon wake-up
the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4Can 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;*/
Quoted 8 lines
Thanks!
Alex
Quoted 3 lines
Justin P. Mattock
<0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real-v2.patch>
alright.. again out of my office trying to make a living!!
Anyways I applied the two earlier patches, and added the previous post's patch as well (everything runs o.k. s2r etc...)
I can try for the above and see if I can pinpoint the piece of code that is causing this(hopefully)
Justin P. Mattock
Quoted 40 lines · Justin Mattock
Quoted 27 lines · Alex Deucher
Quoted 8 lines · Justin Mattock
Quoted 7 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 7 lines
o.k. applied that patch... unfortunately Im seeing the flickering screen and
the crud shows up..
initially during boot everything looked fine, its when I suspended the machine, upon wake-up
the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4Can 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;*/Quoted 8 lines
Thanks!
Alex
Quoted 3 lines
Justin P. Mattock
<0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real-v2.patch>
Quoted 6 lines
alright.. again out of my office trying to make a living!! Anyways I applied the two earlier patches, and added the previous post's patch as well
(everything runs o.k. s2r etc...)
I can try for the above and see if I can pinpoint the piece of code that is causing this(hopefully)
The attached patch is what I'm proposing to go upstream. Please test and let me know if it works ok for you.
Alex
Quoted 3 lines
Justin P. Mattock
From 32f519d32ca9ca0f84e81953c8d9ddefdb7771d3 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Sun, 13 Feb 2011 18:38:23 -0500
Subject: [PATCH] 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.
--- drivers/gpu/drm/radeon/atombios_crtc.c | 22 ++++++++-------------- 1 files changed, 8 insertions(+), 14 deletions(-)
drivers/gpu/drm/radeon/atombios_crtc.c +8 -14
@@ -538,7 +538,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, pll->flags |=RADEON_PLL_PREFER_HIGH_FB_DIV ; else pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; - }list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) {
@@ -555,29 +554,28 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, dp_clock = dig_connector->dp_clock; } } -/* this might work properly with the new pll algo */ -#if 0 /* doesn't work properly on some laptops */ +/* use recommended ref_div for ss */ if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) { + pll->flags |=RADEON_PLL_PREFER_MINM_OVER_MAXP ;if (ss_enabled) {if (ss->refdiv) { pll->flags |=RADEON_PLL_USE_REF_DIV ; pll->reference_div = ss->refdiv; +if (ASIC_IS_AVIVO (rdev)) + pll->flags |=RADEON_PLL_USE_FRAC_FB_DIV ; } } } -#endif +if (ASIC_IS_AVIVO (rdev)) {/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ if (radeon_encoder->encoder_id ==ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1 ) adjusted_clock = mode->clock *2 ;if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT )) pll->flags |=RADEON_PLL_PREFER_CLOSEST_LOWER ; -/* rv515 needs more testing with this option */ -if (rdev->family !=CHIP_RV515 ) { -if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) - pll->flags |=RADEON_PLL_IS_LCD ; - } +if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT )) + pll->flags |=RADEON_PLL_IS_LCD ; }else {if (encoder->encoder_type !=DRM_MODE_ENCODER_DAC ) pll->flags |=RADEON_PLL_NO_ODD_POST_DIV ;
@@ -957,11 +955,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode/* adjust pixel clock as needed */ adjusted_clock =atombios_adjust_pll (crtc, mode, pll, ss_enabled, &ss); -/* rv515 seems happier with the old algo */ -if (rdev->family ==CHIP_RV515 ) -radeon_compute_pll_legacy (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, - &ref_div, &post_div); -else if (ASIC_IS_AVIVO (rdev)) +if (ASIC_IS_AVIVO (rdev))radeon_compute_pll_avivo (pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, &ref_div, &post_div);else
Signature · 1 line
1.7.1.1
Quoted 6 lines
The attached patch is what I'm proposing to go upstream. Please test and let me know if it works ok for you.
Alex
o.k.!! I have 6 revisions to test on another issue, then I can throw this in and let you know..
Justin P. Mattock
Quoted 49 lines · Alex Deucher
Quoted 40 lines · Justin Mattock
Quoted 27 lines · Alex Deucher
Quoted 8 lines · Justin Mattock
Quoted 7 lines
Better yet, can you try the attached patch on top of 2.6.38-rc4 or newer?
Alex
Quoted 7 lines
o.k. applied that patch... unfortunately Im seeing the flickering screen and
the crud shows up..
initially during boot everything looked fine, its when I suspended the machine, upon wake-up
the flickering occurred.
kernel version is the current: 2.6.38-rc4-00107-gaa502b4Can 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;*/Quoted 8 lines
Thanks!
Alex
Quoted 3 lines
Justin P. Mattock
<0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real-v2.patch>
Quoted 6 lines
alright.. again out of my office trying to make a living!! Anyways I applied the two earlier patches, and added the previous post's patch as well
(everything runs o.k. s2r etc...)
I can try for the above and see if I can pinpoint the piece of code that is causing this(hopefully)
Quoted 4 lines
The attached patch is what I'm proposing to go upstream. Please test and let me know if it works ok for you.
Alex
alright... bisect done, but something went wrong(must redu later).. Anyways with your patch applied everything looks good
Justin P. Mattock