LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
@ 2011-02-08 20:52 Justin P. Mattock
  2011-02-08 21:20 ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Justin P. Mattock @ 2011-02-08 20:52 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-kernel, airlied, alexdeucher

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-08 20:52 [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in Justin P. Mattock
@ 2011-02-08 21:20 ` Alex Deucher
  2011-02-08 21:48   ` Justin Mattock
  2011-02-09 22:09   ` Alex Deucher
  0 siblings, 2 replies; 14+ messages in thread
From: Alex Deucher @ 2011-02-08 21:20 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: dri-devel, linux-kernel, airlied

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
<justinmattock@gmail.com> wrote:
> 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.

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

>
> 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
>

[-- Attachment #2: 0001-drm-radeon-kms-fix-pll-algo-quirk-function.patch --]
[-- Type: text/x-patch, Size: 2830 bytes --]

From 1fce058d7f063b481a274b0a653ffad94f5e9b23 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
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.

Reported-by: Justin P. Mattock <justinmattock@gmail.com>

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
---
 drivers/gpu/drm/radeon/atombios_crtc.c |   39 +++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index dd4e3ac..4a505ba 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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);
 
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-08 21:20 ` Alex Deucher
@ 2011-02-08 21:48   ` Justin Mattock
  2011-02-09 22:09   ` Alex Deucher
  1 sibling, 0 replies; 14+ messages in thread
From: Justin Mattock @ 2011-02-08 21:48 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied


On Feb 8, 2011, at 1:20 PM, Alex Deucher wrote:

> On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
> <justinmattock@gmail.com> wrote:
>> 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.
>
> 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
>
>>
>> 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
>>
> <0001-drm-radeon-kms-fix-pll-algo-quirk-function.patch>



cool... The patch fixes it over here

Reported-and-Tested by: Justin P. Mattock<justinmattock@gmail.com>

Thanks..

Justin P. Mattock

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-08 21:20 ` Alex Deucher
  2011-02-08 21:48   ` Justin Mattock
@ 2011-02-09 22:09   ` Alex Deucher
  2011-02-10  5:33     ` Justin Mattock
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Deucher @ 2011-02-09 22:09 UTC (permalink / raw)
  To: Justin P. Mattock; +Cc: dri-devel, linux-kernel, airlied

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]

On Tue, Feb 8, 2011 at 4:20 PM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
> <justinmattock@gmail.com> wrote:
>> 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.
>
> 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


> Alex
>
>>
>> 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
>>
>

[-- Attachment #2: 0001-drm-radeon-kms-pll-quirk-cleanup.patch --]
[-- Type: text/x-patch, Size: 4695 bytes --]

From c88cf9c2463629ab0cef7df8ade34750cde9b40a Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
---
 drivers/gpu/drm/radeon/atombios_crtc.c |   52 +++++++++++++++++++++++++------
 drivers/gpu/drm/radeon/radeon_mode.h   |    8 +++++
 2 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 4a505ba..cc6bdd8 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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,
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h
index a670caa..1d760c6 100644
--- a/drivers/gpu/drm/radeon/radeon_mode.h
+++ b/drivers/gpu/drm/radeon/radeon_mode.h
@@ -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 {
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-09 22:09   ` Alex Deucher
@ 2011-02-10  5:33     ` Justin Mattock
  2011-02-11  6:59       ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Justin Mattock @ 2011-02-10  5:33 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied


On Feb 9, 2011, at 2:09 PM, Alex Deucher wrote:

> On Tue, Feb 8, 2011 at 4:20 PM, Alex Deucher <alexdeucher@gmail.com>  
> wrote:
>> On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
>> <justinmattock@gmail.com> wrote:
>>> 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.
>>
>> 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
>
> <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..

Reported-and-Tested-by: Justin P. Mattock<justinmattock@gmail.com>

Thanks for sending this my way so my machine works..

cheers,

Justin P. Mattock

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-10  5:33     ` Justin Mattock
@ 2011-02-11  6:59       ` Alex Deucher
  2011-02-11  8:27         ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Deucher @ 2011-02-11  6:59 UTC (permalink / raw)
  To: Justin Mattock; +Cc: dri-devel, linux-kernel, airlied

On Thu, Feb 10, 2011 at 12:33 AM, Justin Mattock
<justinmattock@gmail.com> wrote:
>
> On Feb 9, 2011, at 2:09 PM, Alex Deucher wrote:
>
>> On Tue, Feb 8, 2011 at 4:20 PM, Alex Deucher <alexdeucher@gmail.com>
>> wrote:
>>>
>>> On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
>>> <justinmattock@gmail.com> wrote:
>>>>
>>>> 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.
>>>
>>> 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
>>
>> <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..
>
> Reported-and-Tested-by: Justin P. Mattock<justinmattock@gmail.com>
>
> Thanks for sending this my way so my machine works..

Justin, can you try without these patches, but with the following patch instead?

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
b/drivers/gpu/drm/radeon/atombios_crtc.c
index cc6bdd8..2f9d113 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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) {


>
> cheers,
>
> Justin P. Mattock
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-11  6:59       ` Alex Deucher
@ 2011-02-11  8:27         ` Alex Deucher
  2011-02-11 15:57           ` Justin Mattock
  0 siblings, 1 reply; 14+ messages in thread
From: Alex Deucher @ 2011-02-11  8:27 UTC (permalink / raw)
  To: Justin Mattock; +Cc: dri-devel, linux-kernel, airlied

[-- Attachment #1: Type: text/plain, Size: 2619 bytes --]

On Fri, Feb 11, 2011 at 1:59 AM, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Thu, Feb 10, 2011 at 12:33 AM, Justin Mattock
> <justinmattock@gmail.com> wrote:
>>
>> On Feb 9, 2011, at 2:09 PM, Alex Deucher wrote:
>>
>>> On Tue, Feb 8, 2011 at 4:20 PM, Alex Deucher <alexdeucher@gmail.com>
>>> wrote:
>>>>
>>>> On Tue, Feb 8, 2011 at 3:52 PM, Justin P. Mattock
>>>> <justinmattock@gmail.com> wrote:
>>>>>
>>>>> 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.
>>>>
>>>> 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
>>>
>>> <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..
>>
>> Reported-and-Tested-by: Justin P. Mattock<justinmattock@gmail.com>
>>
>> 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

> diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
> b/drivers/gpu/drm/radeon/atombios_crtc.c
> index cc6bdd8..2f9d113 100644
> --- a/drivers/gpu/drm/radeon/atombios_crtc.c
> +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
> @@ -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) {
>
>
>>
>> cheers,
>>
>> Justin P. Mattock
>>
>

[-- Attachment #2: 0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real.patch --]
[-- Type: text/x-patch, Size: 2723 bytes --]

From e1c5703223d21441bcbdd222572e592984e5ae10 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
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.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
---
 drivers/gpu/drm/radeon/atombios_crtc.c |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index dd4e3ac..638f926 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-11  8:27         ` Alex Deucher
@ 2011-02-11 15:57           ` Justin Mattock
  2011-02-11 19:06             ` Alex Deucher
  2011-02-12  1:15             ` Alex Deucher
  0 siblings, 2 replies; 14+ messages in thread
From: Justin Mattock @ 2011-02-11 15:57 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied


>
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-11 15:57           ` Justin Mattock
@ 2011-02-11 19:06             ` Alex Deucher
  2011-02-12  1:15             ` Alex Deucher
  1 sibling, 0 replies; 14+ messages in thread
From: Alex Deucher @ 2011-02-11 19:06 UTC (permalink / raw)
  To: Justin Mattock; +Cc: dri-devel, linux-kernel, airlied

On Fri, Feb 11, 2011 at 10:57 AM, Justin Mattock
<justinmattock@gmail.com> wrote:
>
>>
>> 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

Can you try the following patch on top of the first two patches I
posted to this thread?

Thanks,

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c
b/drivers/gpu/drm/radeon/atombios_crtc.c
index cc6bdd8..2f9d113 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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) {


>
> Justin P. Mattock
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-11 15:57           ` Justin Mattock
  2011-02-11 19:06             ` Alex Deucher
@ 2011-02-12  1:15             ` Alex Deucher
  2011-02-13  5:28               ` Justin Mattock
  1 sibling, 1 reply; 14+ messages in thread
From: Alex Deucher @ 2011-02-12  1:15 UTC (permalink / raw)
  To: Justin Mattock; +Cc: dri-devel, linux-kernel, airlied

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Fri, Feb 11, 2011 at 10:57 AM, Justin Mattock
<justinmattock@gmail.com> wrote:
>
>>
>> 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

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

>
> Justin P. Mattock
>

[-- Attachment #2: 0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real-v2.patch --]
[-- Type: text/x-patch, Size: 3179 bytes --]

From b92bf64a4fc181c6a783cc0d51a6881fc8a353a7 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
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

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
---
 drivers/gpu/drm/radeon/atombios_crtc.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 1bf6122..afa4c34 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-12  1:15             ` Alex Deucher
@ 2011-02-13  5:28               ` Justin Mattock
  2011-02-13 23:46                 ` Alex Deucher
  0 siblings, 1 reply; 14+ messages in thread
From: Justin Mattock @ 2011-02-13  5:28 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied


On Feb 11, 2011, at 5:15 PM, Alex Deucher wrote:

> On Fri, Feb 11, 2011 at 10:57 AM, Justin Mattock
> <justinmattock@gmail.com> wrote:
>>
>>>
>>> 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
>
> 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
>
>>
>> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-13  5:28               ` Justin Mattock
@ 2011-02-13 23:46                 ` Alex Deucher
  2011-02-14  0:02                   ` Justin Mattock
  2011-02-14  1:14                   ` Justin Mattock
  0 siblings, 2 replies; 14+ messages in thread
From: Alex Deucher @ 2011-02-13 23:46 UTC (permalink / raw)
  To: Justin Mattock; +Cc: dri-devel, linux-kernel, airlied

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

On Sun, Feb 13, 2011 at 12:28 AM, Justin Mattock
<justinmattock@gmail.com> wrote:
>
> On Feb 11, 2011, at 5:15 PM, Alex Deucher wrote:
>
>> On Fri, Feb 11, 2011 at 10:57 AM, Justin Mattock
>> <justinmattock@gmail.com> wrote:
>>>
>>>>
>>>> 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
>>
>> 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
>>
>>>
>>> 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)

The attached patch is what I'm proposing to go upstream.  Please test
and let me know if it works ok for you.

Alex

>
> Justin P. Mattock
>

[-- Attachment #2: 0001-drm-radeon-kms-hopefully-fix-pll-issues-for-real-v3.patch --]
[-- Type: text/x-patch, Size: 3241 bytes --]

From 32f519d32ca9ca0f84e81953c8d9ddefdb7771d3 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexdeucher@gmail.com>
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.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
---
 drivers/gpu/drm/radeon/atombios_crtc.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 1bf6122..3127a28 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -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
-- 
1.7.1.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-13 23:46                 ` Alex Deucher
@ 2011-02-14  0:02                   ` Justin Mattock
  2011-02-14  1:14                   ` Justin Mattock
  1 sibling, 0 replies; 14+ messages in thread
From: Justin Mattock @ 2011-02-14  0:02 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied

>
> 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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in
  2011-02-13 23:46                 ` Alex Deucher
  2011-02-14  0:02                   ` Justin Mattock
@ 2011-02-14  1:14                   ` Justin Mattock
  1 sibling, 0 replies; 14+ messages in thread
From: Justin Mattock @ 2011-02-14  1:14 UTC (permalink / raw)
  To: Alex Deucher; +Cc: dri-devel, linux-kernel, airlied


On Feb 13, 2011, at 3:46 PM, Alex Deucher wrote:

> On Sun, Feb 13, 2011 at 12:28 AM, Justin Mattock
> <justinmattock@gmail.com> wrote:
>>
>> On Feb 11, 2011, at 5:15 PM, Alex Deucher wrote:
>>
>>> On Fri, Feb 11, 2011 at 10:57 AM, Justin Mattock
>>> <justinmattock@gmail.com> wrote:
>>>>
>>>>>
>>>>> 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
>>>
>>> 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
>>>
>>>>
>>>> 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)
>
> 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-02-14  1:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08 20:52 [BISECTED] commit 619efb1059 makes the MacBookPro2,2 screen flicker like its broken or half plugged in Justin P. Mattock
2011-02-08 21:20 ` Alex Deucher
2011-02-08 21:48   ` Justin Mattock
2011-02-09 22:09   ` Alex Deucher
2011-02-10  5:33     ` Justin Mattock
2011-02-11  6:59       ` Alex Deucher
2011-02-11  8:27         ` Alex Deucher
2011-02-11 15:57           ` Justin Mattock
2011-02-11 19:06             ` Alex Deucher
2011-02-12  1:15             ` Alex Deucher
2011-02-13  5:28               ` Justin Mattock
2011-02-13 23:46                 ` Alex Deucher
2011-02-14  0:02                   ` Justin Mattock
2011-02-14  1:14                   ` Justin Mattock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).