Commit 8d501b18 authored by Petr Vandrovec's avatar Petr Vandrovec

Make debug printouts in matroxfb G400 TV-out disabled by default.

OUTPUT_MODE are values, not a bitmap, so use compare instead of bitwise AND.
parent b0f3e5d4
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* *
* Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
* *
* (c) 1998-2001 Petr Vandrovec <vandrove@vc.cvut.cz> * (c) 1998-2002 Petr Vandrovec <vandrove@vc.cvut.cz>
* *
* Portions Copyright (c) 2001 Matrox Graphics Inc. * Portions Copyright (c) 2001 Matrox Graphics Inc.
* *
* Version: 1.62 2001/11/29 * Version: 1.64 2002/06/10
* *
* See matroxfb_base.c for contributors. * See matroxfb_base.c for contributors.
* *
...@@ -22,11 +22,6 @@ ...@@ -22,11 +22,6 @@
#define MAVEN_I2CID (0x1B) #define MAVEN_I2CID (0x1B)
#define MODE_PAL MATROXFB_OUTPUT_MODE_PAL
#define MODE_NTSC MATROXFB_OUTPUT_MODE_NTSC
#define MODE_TV(x) (((x) == MODE_PAL) || ((x) == MODE_NTSC))
#define MODE_MONITOR MATROXFB_OUTPUT_MODE_MONITOR
#define MGATVO_B 1 #define MGATVO_B 1
#define MGATVO_C 2 #define MGATVO_C 2
...@@ -126,7 +121,7 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, ...@@ -126,7 +121,7 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll,
fwant = htotal * vtotal; fwant = htotal * vtotal;
fmax = pll->vco_freq_max / ctl->den; fmax = pll->vco_freq_max / ctl->den;
printk(KERN_DEBUG "want: %u, xtal: %u, h: %u, v: %u, fmax: %u\n", dprintk(KERN_DEBUG "want: %u, xtal: %u, h: %u, v: %u, fmax: %u\n",
fwant, fxtal, htotal, vtotal, fmax); fwant, fxtal, htotal, vtotal, fmax);
for (p = 1; p <= pll->post_shift_max; p++) { for (p = 1; p <= pll->post_shift_max; p++) {
if (fwant * 2 > fmax) if (fwant * 2 > fmax)
...@@ -162,9 +157,9 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll, ...@@ -162,9 +157,9 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll,
ln = ln - scrlen; ln = ln - scrlen;
if (ln > htotal) if (ln > htotal)
continue; continue;
printk(KERN_DEBUG "Match: %u / %u / %u / %u\n", n, m, p, ln); dprintk(KERN_DEBUG "Match: %u / %u / %u / %u\n", n, m, p, ln);
if (ln > besth2) { if (ln > besth2) {
printk(KERN_DEBUG "Better...\n"); dprintk(KERN_DEBUG "Better...\n");
*h2 = besth2 = ln; *h2 = besth2 = ln;
*post = p; *post = p;
*in = m; *in = m;
...@@ -272,7 +267,7 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat ...@@ -272,7 +267,7 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat
0x3F, 0x03, /* 3C-3D */ 0x3F, 0x03, /* 3C-3D */
0x00, /* 3E written multiple times */ 0x00, /* 3E written multiple times */
0x00, /* 3F not written */ 0x00, /* 3F not written */
}, MODE_PAL, 625, 50 }; }, MATROXFB_OUTPUT_MODE_PAL, 625, 50 };
static struct mavenregs ntscregs = { { static struct mavenregs ntscregs = { {
0x21, 0xF0, 0x7C, 0x1F, /* 00: chroma subcarrier */ 0x21, 0xF0, 0x7C, 0x1F, /* 00: chroma subcarrier */
0x00, 0x00,
...@@ -324,10 +319,10 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat ...@@ -324,10 +319,10 @@ static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* dat
0x3C, 0x00, /* 3C-3D */ 0x3C, 0x00, /* 3C-3D */
0x00, /* 3E written multiple times */ 0x00, /* 3E written multiple times */
0x00, /* never written */ 0x00, /* never written */
}, MODE_NTSC, 525, 60 }; }, MATROXFB_OUTPUT_MODE_NTSC, 525, 60 };
MINFO_FROM(md->primary_head); MINFO_FROM(md->primary_head);
if (ACCESS_FBINFO(outputs[1]).mode == MODE_PAL) if (ACCESS_FBINFO(outputs[1]).mode == MATROXFB_OUTPUT_MODE_PAL)
*data = palregs; *data = palregs;
else else
*data = ntscregs; *data = ntscregs;
...@@ -386,7 +381,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) { ...@@ -386,7 +381,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) {
LRP(0x17); LRP(0x17);
LR(0x0B); LR(0x0B);
LR(0x0C); LR(0x0C);
if (m->mode & MODE_PAL) { if (m->mode == MATROXFB_OUTPUT_MODE_PAL) {
maven_set_reg(c, 0x35, 0x10); /* ... */ maven_set_reg(c, 0x35, 0x10); /* ... */
} else { } else {
maven_set_reg(c, 0x35, 0x0F); /* ... */ maven_set_reg(c, 0x35, 0x0F); /* ... */
...@@ -424,7 +419,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) { ...@@ -424,7 +419,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) {
LR(0x27); LR(0x27);
LR(0x21); LR(0x21);
LRP(0x2A); LRP(0x2A);
if (m->mode & MODE_PAL) if (m->mode == MATROXFB_OUTPUT_MODE_PAL)
maven_set_reg(c, 0x35, 0x1D); /* ... */ maven_set_reg(c, 0x35, 0x1D); /* ... */
else else
maven_set_reg(c, 0x35, 0x1C); maven_set_reg(c, 0x35, 0x1C);
...@@ -524,7 +519,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) { ...@@ -524,7 +519,7 @@ static void maven_init_TV(struct i2c_client* c, const struct mavenregs* m) {
LR(0x27); LR(0x27);
LR(0x21); LR(0x21);
LRP(0x2A); LRP(0x2A);
if (m->mode & MODE_PAL) if (m->mode == MATROXFB_OUTPUT_MODE_PAL)
maven_set_reg(c, 0x35, 0x1D); maven_set_reg(c, 0x35, 0x1D);
else else
maven_set_reg(c, 0x35, 0x1C); maven_set_reg(c, 0x35, 0x1C);
...@@ -562,7 +557,7 @@ static int maven_find_exact_clocks(unsigned int ht, unsigned int vt, ...@@ -562,7 +557,7 @@ static int maven_find_exact_clocks(unsigned int ht, unsigned int vt,
unsigned int a, b, c, h2; unsigned int a, b, c, h2;
unsigned int h = ht + 2 + x; unsigned int h = ht + 2 + x;
if (!matroxfb_mavenclock((m->mode & MODE_PAL) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) { if (!matroxfb_mavenclock((m->mode == MATROXFB_OUTPUT_MODE_PAL) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) {
unsigned int diff = h - h2; unsigned int diff = h - h2;
if (diff < err) { if (diff < err) {
...@@ -586,7 +581,7 @@ static inline int maven_compute_timming(struct maven_data* md, ...@@ -586,7 +581,7 @@ static inline int maven_compute_timming(struct maven_data* md,
MINFO_FROM(md->primary_head); MINFO_FROM(md->primary_head);
m->mode = ACCESS_FBINFO(outputs[1]).mode; m->mode = ACCESS_FBINFO(outputs[1]).mode;
if (MODE_TV(m->mode)) { if (m->mode != MATROXFB_OUTPUT_MODE_MONITOR) {
unsigned int lmargin; unsigned int lmargin;
unsigned int umargin; unsigned int umargin;
unsigned int vslen; unsigned int vslen;
...@@ -816,7 +811,7 @@ static inline int maven_program_timming(struct maven_data* md, ...@@ -816,7 +811,7 @@ static inline int maven_program_timming(struct maven_data* md,
const struct mavenregs* m) { const struct mavenregs* m) {
struct i2c_client* c = md->client; struct i2c_client* c = md->client;
if (m->mode & MODE_MONITOR) { if (m->mode == MATROXFB_OUTPUT_MODE_MONITOR) {
LR(0x80); LR(0x80);
LR(0x81); LR(0x81);
LR(0x82); LR(0x82);
...@@ -911,7 +906,7 @@ static int maven_init_client(struct i2c_client* clnt) { ...@@ -911,7 +906,7 @@ static int maven_init_client(struct i2c_client* clnt) {
ACCESS_FBINFO(outputs[1]).output = &maven_altout; ACCESS_FBINFO(outputs[1]).output = &maven_altout;
ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE;
ACCESS_FBINFO(outputs[1]).data = md; ACCESS_FBINFO(outputs[1]).data = md;
ACCESS_FBINFO(outputs[1]).mode = MODE_MONITOR; ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR;
up_write(&ACCESS_FBINFO(altout.lock)); up_write(&ACCESS_FBINFO(altout.lock));
if (maven_get_reg(clnt, 0xB2) < 0x14) { if (maven_get_reg(clnt, 0xB2) < 0x14) {
md->version = MGATVO_B; md->version = MGATVO_B;
...@@ -1045,7 +1040,7 @@ static void matroxfb_maven_exit(void) { ...@@ -1045,7 +1040,7 @@ static void matroxfb_maven_exit(void) {
i2c_del_driver(&maven_driver); i2c_del_driver(&maven_driver);
} }
MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <vandrove@vc.cvut.cz>"); MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec <vandrove@vc.cvut.cz>");
MODULE_DESCRIPTION("Matrox G200/G400 Matrox MGA-TVO driver"); MODULE_DESCRIPTION("Matrox G200/G400 Matrox MGA-TVO driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(matroxfb_maven_init); module_init(matroxfb_maven_init);
......
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