mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Risto Suominen <risto.suominen@gmail.com>
To: Alex Kern <alex.kern@gmx.de>
Cc: linux-kernel@vger.kernel.org, benh@kernel.crashing.org
Subject: [PATCH] atyfb: fix distorted image on PowerMacs
Date: Thu, 22 Jan 2009 20:22:48 +0200	[thread overview]
Message-ID: <46e1c7760901221022p697f1689ubf03c909cdf1b99b@mail.gmail.com> (raw)

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

Since the complete re-write in 2.6.10, some PowerMacs (At least PowerMac 5500
and PowerMac G3 Beige rev A) with ATI Mach64 chip have suffered from unstable
columns in their framebuffer image. This seems to depend on a value (4) read
from PLL_EXT_CNTL register, which leads to incorrect DSP config parameters to
be written to the chip. This patch uses a value calculated by aty_init_pll_ct
instead, as a starting point.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- a/drivers/video/aty/mach64_ct.c.org	2006-09-20 06:42:06.000000000 +0300
+++ b/drivers/video/aty/mach64_ct.c	2009-01-22 14:28:13.000000000 +0200
@@ -7,6 +7,7 @@
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <video/mach64.h>
+#include <asm/machdep.h>
 #include "atyfb.h"

 #undef DEBUG
@@ -536,6 +537,14 @@ static int __init aty_init_pll_ct(const
 	pll->ct.xclk_post_div_real = postdividers[xpost_div];
 	pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;

+#ifdef CONFIG_PPC
+	if (machine_is(powermac)) {
+		/* Override PLL_EXT_CNTL & 0x07. */
+		pll->ct.xclk_post_div = xpost_div;
+		pll->ct.xclk_ref_div = 1;
+	}
+#endif
+
 #ifdef DEBUG
 	pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) /
 			(par->ref_clk_per * pll->ct.pll_ref_div);

[-- Attachment #2: aty-mach64-pmac.diff --]
[-- Type: text/x-diff, Size: 1306 bytes --]

Since the complete re-write in 2.6.10, some PowerMacs (At least PowerMac 5500
and PowerMac G3 Beige rev A) with ATI Mach64 chip have suffered from unstable
columns in their framebuffer image. This seems to depend on a value (4) read
from PLL_EXT_CNTL register, which leads to incorrect DSP config parameters to
be written to the chip. This patch uses a value calculated by aty_init_pll_ct
instead, as a starting point.

Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com>
---
The testing is done on kernel version 2.6.18.

--- a/drivers/video/aty/mach64_ct.c.org	2006-09-20 06:42:06.000000000 +0300
+++ b/drivers/video/aty/mach64_ct.c	2009-01-22 14:28:13.000000000 +0200
@@ -7,6 +7,7 @@
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <video/mach64.h>
+#include <asm/machdep.h>
 #include "atyfb.h"
 
 #undef DEBUG
@@ -536,6 +537,14 @@ static int __init aty_init_pll_ct(const 
 	pll->ct.xclk_post_div_real = postdividers[xpost_div];
 	pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
 
+#ifdef CONFIG_PPC
+	if (machine_is(powermac)) {
+		/* Override PLL_EXT_CNTL & 0x07. */
+		pll->ct.xclk_post_div = xpost_div;
+		pll->ct.xclk_ref_div = 1;
+	}
+#endif
+
 #ifdef DEBUG
 	pllmclk = (1000000 * pll->ct.mclk_fb_mult * pll->ct.mclk_fb_div) /
 			(par->ref_clk_per * pll->ct.pll_ref_div);

             reply	other threads:[~2009-01-22 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 18:22 Risto Suominen [this message]
2009-01-22 20:12 ` Ville Syrjälä
2009-02-03 18:56   ` [Linux-fbdev-devel] " Ville Syrjälä
2009-02-03 21:06     ` Benjamin Herrenschmidt
2009-01-23 14:21 ` Mikael Pettersson
2009-01-30  3:42 ` Benjamin Herrenschmidt
2009-01-30  4:37   ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46e1c7760901221022p697f1689ubf03c909cdf1b99b@mail.gmail.com \
    --to=risto.suominen@gmail.com \
    --cc=alex.kern@gmx.de \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®