Commit e798bd95 authored by Paul A. Clarke's avatar Paul A. Clarke Committed by Linus Torvalds

matroxfb: rectify jitter (G450/G550)

This builds upon my previous attempts to resolve some jitter problems seen
with the Matrox G450 and G550 -based cards, including odd disparities observed
between x86 and Power -based machines in a somewhat less hackish way (removing
the hacked ifdefs).

Apparently, preference should be given to use the DVI PLL when frequencies
permit, the Standard PLL otherwise.  The max pixel clock for the panellink
interface is extracted from the PInS information on the card and used as a
limit to determine which PLL to use.
Signed-off-by: default avatarPaul A. Clarke <pc@us.ibm.com>
Acked-by: default avatarPetr Vandrovec <petr@vandrovec.name>
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent acb73865
...@@ -331,16 +331,19 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll, ...@@ -331,16 +331,19 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
tmp |= M1064_XPIXCLKCTRL_PLL_UP; tmp |= M1064_XPIXCLKCTRL_PLL_UP;
} }
matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
#ifdef __powerpc__ /* DVI PLL preferred for frequencies up to
/* This is necessary to avoid jitter on PowerPC panel link max, standard PLL otherwise */
* (OpenFirmware) systems, but apparently if (fout >= MINFO->max_pixel_clock_panellink)
* introduces jitter, at least on a x86-64 tmp = 0;
* using DVI. else tmp =
* A simple workaround is disable for non-PPC. M1064_XDVICLKCTRL_DVIDATAPATHSEL |
*/ M1064_XDVICLKCTRL_C1DVICLKSEL |
matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0); M1064_XDVICLKCTRL_C1DVICLKEN |
#endif /* __powerpc__ */ M1064_XDVICLKCTRL_DVILOOPCTL |
matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl); M1064_XDVICLKCTRL_P1LOOPBWDTCTL;
matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL,tmp);
matroxfb_DAC_out(PMINFO M1064_XPWRCTRL,
xpwrctrl);
matroxfb_DAC_unlock_irqrestore(flags); matroxfb_DAC_unlock_irqrestore(flags);
} }
......
...@@ -33,6 +33,21 @@ void DAC1064_global_restore(WPMINFO2); ...@@ -33,6 +33,21 @@ void DAC1064_global_restore(WPMINFO2);
#define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */ #define M1064_XCURCTRL_3COLOR 0x01 /* transparent, 0, 1, 2 */
#define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */ #define M1064_XCURCTRL_XGA 0x02 /* 0, 1, transparent, complement */
#define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */ #define M1064_XCURCTRL_XWIN 0x03 /* transparent, transparent, 0, 1 */
/* drive DVI by standard(0)/DVI(1) PLL */
/* if set(1), C?DVICLKEN and C?DVICLKSEL must be set(1) */
#define M1064_XDVICLKCTRL_DVIDATAPATHSEL 0x01
/* drive CRTC1 by standard(0)/DVI(1) PLL */
#define M1064_XDVICLKCTRL_C1DVICLKSEL 0x02
/* drive CRTC2 by standard(0)/DVI(1) PLL */
#define M1064_XDVICLKCTRL_C2DVICLKSEL 0x04
/* pixel clock allowed to(0)/blocked from(1) driving CRTC1 */
#define M1064_XDVICLKCTRL_C1DVICLKEN 0x08
/* DVI PLL loop filter bandwidth selection bits */
#define M1064_XDVICLKCTRL_DVILOOPCTL 0x30
/* CRTC2 pixel clock allowed to(0)/blocked from(1) driving CRTC2 */
#define M1064_XDVICLKCTRL_C2DVICLKEN 0x40
/* P1PLL loop filter bandwith selection */
#define M1064_XDVICLKCTRL_P1LOOPBWDTCTL 0x80
#define M1064_XCURCOL0RED 0x08 #define M1064_XCURCOL0RED 0x08
#define M1064_XCURCOL0GREEN 0x09 #define M1064_XCURCOL0GREEN 0x09
#define M1064_XCURCOL0BLUE 0x0A #define M1064_XCURCOL0BLUE 0x0A
......
...@@ -424,6 +424,7 @@ struct matrox_fb_info { ...@@ -424,6 +424,7 @@ struct matrox_fb_info {
} mmio; } mmio;
unsigned int max_pixel_clock; unsigned int max_pixel_clock;
unsigned int max_pixel_clock_panellink;
struct matrox_switch* hw_switch; struct matrox_switch* hw_switch;
......
...@@ -658,6 +658,7 @@ static int parse_pins5(WPMINFO const struct matrox_bios* bd) { ...@@ -658,6 +658,7 @@ static int parse_pins5(WPMINFO const struct matrox_bios* bd) {
MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) | MINFO->values.reg.mctlwtst_core = (MINFO->values.reg.mctlwtst & ~7) |
wtst_xlat[MINFO->values.reg.mctlwtst & 7]; wtst_xlat[MINFO->values.reg.mctlwtst & 7];
} }
MINFO->max_pixel_clock_panellink = bd->pins[47] * 4000;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment