2004-06-18 21:15:29

by Tomasz Torcz

[permalink] [raw]
Subject: Matroxfb in 2.6 still doesn't work in 2.6.7


Hi,

I am constantly having problems with my G550 matrox card.
I'm trying to get same video mode in framebuffer as in XFree.
I'm using 1280x1024x16 in XFree but this mode in fb don't work.
My LCD monitor turns black and slowly change into all white.
There is some very bright white area in lower right corner of monitor.

% dmesg | grep -i matrox
Kernel command line: root=/dev/hda4 acpi=force ro video=matroxfb:1280x1024-16@60
matroxfb: Matrox G550 detected
matroxfb: MTRR's turned on
matroxfb: 1280x1024x16bpp (virtual: 1280x6553)
matroxfb: framebuffer at 0xE8000000, mapped to 0xd080b000, size 33554432
fb0: MATROX frame buffer device
[drm] Initialized mga 3.1.0 20021029 on minor 0: Matrox Graphics, Inc. MGA G550 AGP
matroxfb_crtc2: secondary head of fb0 was registered as fb1


Modeline used by XFree (if it helps):
(**) MGA(0): *Default mode "1280x1024": 108.0 MHz, 64.0 kHz, 60.0 Hz
(II) MGA(0): Modeline "1280x1024" 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hs
ync +vsync

My card is:
01:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G550 AGP (rev 01) (prog-if 00 [VGA])
Subsystem: Matrox Graphics, Inc. Millennium G550 Dual Head DDR 32Mb
Flags: bus master, medium devsel, latency 64, IRQ 11
Memory at e8000000 (32-bit, prefetchable) [size=32M]
Memory at e4000000 (32-bit, non-prefetchable) [size=16K]
Memory at e5000000 (32-bit, non-prefetchable) [size=8M]
Expansion ROM at <unassigned> [disabled] [size=128K]
Capabilities: [dc] Power Management version 2
Capabilities: [f0] AGP version 2.0

I have LCD plugged into analog output (my LCD does not have DVI in).

It stopped working somewhere in 2.5.x series. It still doesn't
work in
Linux version 2.6.7 (zdzichu@mother) (gcc version 3.4.0) #1 Fri Jun 18 22:39:14 CEST 2004

--
Tomasz Torcz "God, root, what's the difference?"
[email protected] "God is more forgiving."


2004-06-19 19:05:13

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Fri, Jun 18, 2004 at 11:10:31PM +0200, Tomasz Torcz wrote:
>
> Hi,
>
> I am constantly having problems with my G550 matrox card.
> I'm trying to get same video mode in framebuffer as in XFree.
> I'm using 1280x1024x16 in XFree but this mode in fb don't work.
> My LCD monitor turns black and slowly change into all white.
> There is some very bright white area in lower right corner of monitor.

When monitor goes into this mode? Immediately after kernel starts, or
after you start X? Picture you see happens with some (stupid) monitors
if there are missing sync pulses. Are you sure that you do not have any
fbset or stty commands in your startup scripts? What if you boot with init=/bin/bash?

> % dmesg | grep -i matrox
> Kernel command line: root=/dev/hda4 acpi=force ro video=matroxfb:1280x1024-16@60
> matroxfb: Matrox G550 detected
> matroxfb: MTRR's turned on
> matroxfb: 1280x1024x16bpp (virtual: 1280x6553)
> matroxfb: framebuffer at 0xE8000000, mapped to 0xd080b000, size 33554432
> fb0: MATROX frame buffer device
> [drm] Initialized mga 3.1.0 20021029 on minor 0: Matrox Graphics, Inc. MGA G550 AGP
> matroxfb_crtc2: secondary head of fb0 was registered as fb1
>
> It stopped working somewhere in 2.5.x series. It still doesn't
> work in
> Linux version 2.6.7 (zdzichu@mother) (gcc version 3.4.0) #1 Fri Jun 18 22:39:14 CEST 2004

It works for me, with CRT analog monitor... What if you boot with
video=matroxfb:outputs:010,1280x1024-16@60 (if you plugged your LCD to analog
output) or video=matroxfb:outputs:100,1280x1024-16@60 (if you plugged your LCD to
digital output with digital-analog connector convertor) ?

You can also try patching your kernel with
http://platan.vc.cvut.cz/ftp/pub/linux/matrox-latest/matrox-2.6.7-rc2-c1818.gz. It
should help you if videomode is destroyed by your initscripts.
Best regards,
Petr Vandrovec

2004-06-19 19:30:57

by Tomasz Torcz

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sat, Jun 19, 2004 at 09:05:03PM +0200, Petr Vandrovec wrote:
> > My LCD monitor turns black and slowly change into all white.
> > There is some very bright white area in lower right corner of monitor.
>
> When monitor goes into this mode? Immediately after kernel starts, or

During kernel boot, before even mounting root and running init.

> after you start X? Picture you see happens with some (stupid) monitors
> if there are missing sync pulses.

Samsung SyncMaster 171s doesn't look stupid to me :-) And XFree86/Xorg
somehow manages to work.

> Are you sure that you do not have any
> fbset or stty commands in your startup scripts?

There was single 'stty onlcr'. After commenting it out nothing changed.

> What if you boot with init=/bin/bash?

No change. Screen melts to white before bash is execed.

> > % dmesg | grep -i matrox
> > matroxfb_crtc2: secondary head of fb0 was registered as fb1
>
> It works for me, with CRT analog monitor... What if you boot with
> video=matroxfb:outputs:010,1280x1024-16@60 (if you plugged your LCD to analog
> output)

This is how my LCD is connected. Tried that - no change, still no picture.
It doesn't work the same way as when no passing 'outputs:' to kernel, so
I presume 'output:010' is default.

> or video=matroxfb:outputs:100,1280x1024-16@60 (if you plugged your LCD to
> digital output with digital-analog connector convertor) ?

With LCD still connected to analog output and outputs:100, LCD turns
itself off during kernel boot.

> You can also try patching your kernel with
> http://platan.vc.cvut.cz/ftp/pub/linux/matrox-latest/matrox-2.6.7-rc2-c1818.gz. It
> should help you if videomode is destroyed by your initscripts.

My initscripts don't mess with videomode, but I will check this patch.

--
Tomasz Torcz "Never underestimate the bandwidth of a station
[email protected] wagon filled with backup tapes." -- Jim Gray

2004-06-19 20:39:57

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sat, Jun 19, 2004 at 09:30:53PM +0200, Tomasz Torcz wrote:
> On Sat, Jun 19, 2004 at 09:05:03PM +0200, Petr Vandrovec wrote:
> > after you start X? Picture you see happens with some (stupid) monitors
> > if there are missing sync pulses.
>
> Samsung SyncMaster 171s doesn't look stupid to me :-) And XFree86/Xorg
> somehow manages to work.

It should present you with some "hsync not supported" or something like that.

> > It works for me, with CRT analog monitor... What if you boot with
> > video=matroxfb:outputs:010,1280x1024-16@60 (if you plugged your LCD to analog
> > output)
>
> This is how my LCD is connected. Tried that - no change, still no picture.
> It doesn't work the same way as when no passing 'outputs:' to kernel, so
> I presume 'output:010' is default.

Default is '111', so you can plug your monitor to any of available outputs.

If you want exactly same videomode as you use under X, you should use

video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48

maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
Petr Vandrovec




2004-06-20 16:06:57

by Tomasz Torcz

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sat, Jun 19, 2004 at 10:39:54PM +0200, Petr Vandrovec wrote:
> > > It works for me, with CRT analog monitor... What if you boot with
> > > video=matroxfb:outputs:010,1280x1024-16@60 (if you plugged your LCD to analog
> > > output)
>
> If you want exactly same videomode as you use under X, you should use
> video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.

Neither one works. During kernel boot resolution is switched to 1280x1024, but
screen become corrupted - there are some green points in upper part of
monitor.

Also, the patch from platan do not compile:

CC drivers/video/fbmem.o
drivers/video/fbmem.c: In function `fb_cursor':
drivers/video/fbmem.c:934: warning: passing arg 1 of `copy_from_user' discards qualifiers from pointer target type
drivers/video/fbmem.c: In function `fb_pan_display2':
drivers/video/fbmem.c:959: error: invalid use of undefined type `struct display'
drivers/video/fbmem.c: In function `fb_set_var':
drivers/video/fbmem.c:1006: error: invalid use of undefined type `struct display'
drivers/video/fbmem.c:1007: error: `vc_cons' undeclared (first use in this function)
drivers/video/fbmem.c:1007: error: (Each undeclared identifier is reported only once
drivers/video/fbmem.c:1007: error: for each function it appears in.)
drivers/video/fbmem.c:1025: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1026: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1027: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1028: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1029: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1030: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1031: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1032: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c:1036: error: dereferencing pointer to incomplete type
drivers/video/fbmem.c: In function `fbcon_vt_ioctl':
drivers/video/fbmem.c:1095: error: `con2fb_map' undeclared (first use in this function)
drivers/video/fbmem.c:1107: error: invalid use of undefined type `struct display'
drivers/video/fbmem.c: In function `fb_ioctl':
drivers/video/fbmem.c:1184: warning: implicit declaration of function `set_all_vcs'
drivers/video/fbmem.c:1185: warning: implicit declaration of function `PROC_CONSOLE'
drivers/video/fbmem.c: In function `register_framebuffer':
drivers/video/fbmem.c:1495: error: `con2fb_map' undeclared (first use in this function)
drivers/video/fbmem.c: In function `unregister_framebuffer':
drivers/video/fbmem.c:1535: error: `con2fb_map' undeclared (first use in this function)
drivers/video/fbmem.c:1528: warning: unused variable `fb_ever_opened'
drivers/video/fbmem.c:1529: warning: unused variable `first'
drivers/video/fbmem.c: In function `video_setup':
drivers/video/fbmem.c:1672: error: `con2fb_map' undeclared (first use in this function)
make[2]: *** [drivers/video/fbmem.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2


I've attached my .config if it helps.

--
Tomasz Torcz There exists no separation between gods and men:
[email protected] one blends softly casual into the other.


Attachments:
(No filename) (3.29 kB)
.config (32.85 kB)
Download all attachments

2004-06-20 17:01:18

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sun, Jun 20, 2004 at 06:04:37PM +0200, Tomasz Torcz wrote:
> On Sat, Jun 19, 2004 at 10:39:54PM +0200, Petr Vandrovec wrote:
> > > > It works for me, with CRT analog monitor... What if you boot with
> > > > video=matroxfb:outputs:010,1280x1024-16@60 (if you plugged your LCD to analog
> > > > output)
> >
> > If you want exactly same videomode as you use under X, you should use
> > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
>
> Neither one works. During kernel boot resolution is switched to 1280x1024, but
> screen become corrupted - there are some green points in upper part of
> monitor.

It works exactly as your kernel is configured. It switched to graphics, but it does
not paint your console there because you told you kernel to not do that.

> Also, the patch from platan do not compile:

And this one too - my patch needs fbcon.

> CONFIG_VGA_CONSOLE=y
> CONFIG_MDA_CONSOLE=m
> CONFIG_DUMMY_CONSOLE=y
> # CONFIG_FRAMEBUFFER_CONSOLE is not set

Enable this. Into the kernel, not as a module.

> #
> # Logo configuration
> #
> # CONFIG_LOGO is not set

And enable this, so we can find whether fbdev works or not...
Best regards,
Petr Vandrovec

2004-06-20 21:37:44

by Tomasz Torcz

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sun, Jun 20, 2004 at 07:01:14PM +0200, Petr Vandrovec wrote:
> > > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
> >
> > Neither one works. During kernel boot resolution is switched to 1280x1024, but
> > screen become corrupted - there are some green points in upper part of
> > monitor.
>
> It works exactly as your kernel is configured. It switched to graphics, but it does
> not paint your console there because you told you kernel to not do that.
> > Also, the patch from platan do not compile:
>
> And this one too - my patch needs fbcon.
> > # CONFIG_FRAMEBUFFER_CONSOLE is not set
>
> Enable this. Into the kernel, not as a module.

Wow! It works! It not the same mode as in XFree (fb is moved lower by one line),
but it is working!
I don't think if I've met CONFIG_FRAMEBUFFER_CONSOLE earlier in 2.6.x. Also
method of selecing videomode (vesa:xxx stuff, not plain resolution and bpp) seems
strange and alien, but it works with your patch.
When mergin with mainline is planned?

--
Tomasz Torcz There exists no separation between gods and men:
[email protected] one blends softly casual into the other.

2004-06-20 21:57:02

by Marek Szuba

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

Hello,

Speaking about matroxfb in 2.6.7, I'd like to mention that both garbage
at the bottom of the screen after switching from X (1024x768) to console
(800x600) and occasional hard lockups of the whole system when switching
either way are still present in this version of the kernel.

Regards,
MS

2004-06-21 01:31:49

by Petr Vandrovec

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Sun, Jun 20, 2004 at 11:37:43PM +0200, Tomasz Torcz wrote:
> On Sun, Jun 20, 2004 at 07:01:14PM +0200, Petr Vandrovec wrote:
> > > > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > > > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
> > >
> > > Neither one works. During kernel boot resolution is switched to 1280x1024, but
> > > screen become corrupted - there are some green points in upper part of
> > > monitor.
> >
> > It works exactly as your kernel is configured. It switched to graphics, but it does
> > not paint your console there because you told you kernel to not do that.
> > > Also, the patch from platan do not compile:
> >
> > And this one too - my patch needs fbcon.
> > > # CONFIG_FRAMEBUFFER_CONSOLE is not set
> >
> > Enable this. Into the kernel, not as a module.
>
> Wow! It works! It not the same mode as in XFree (fb is moved lower by one line),
> but it is working!
> I don't think if I've met CONFIG_FRAMEBUFFER_CONSOLE earlier in 2.6.x. Also
> method of selecing videomode (vesa:xxx stuff, not plain resolution and bpp) seems
> strange and alien, but it works with your patch.

I bet that all this is not needed for you, now when you properly configured your system.

1280x1024-60 just selects some videomode fbdev subsystem thinks your monitor should use,
while vesa:0x11A selects videomode I think you should use. And right/left/... modifies it
to match with your X setup. Maybe I made some math wrong somewhere if you see picture one
line lower. Try using upper=40 or 32 instead of 48 (or 47 if you are talking about
one pixel line, not about one character line). All this is available in standard
kernel, and documented in matroxfb.txt.

> When mergin with mainline is planned?

Never. Main thing that patch does is resurrecting 2.4.x fbcon subsystem. And 2.6.x uses
its own, 2.6.x fbcon subsystem. So you can either use what's in the kernel (and I see no
reason why in-kernel driver should not work for you if you do not need svgalib compatibility
or multihead system or different resolution on each virtual terminal), or you'll have to
patch your kernel. Except resurrecting 2.4.x fbcon patch only adds support for native
text mode (which is impossible with new fbcon), but otherwise in-kernel and in-patch
drivers should be identical.
Best regards,
Petr Vandrovec

2004-06-21 18:10:09

by Tomasz Torcz

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Mon, Jun 21, 2004 at 03:31:36AM +0200, Petr Vandrovec wrote:
> > > > > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > > > > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
>
> 1280x1024-60 just selects some videomode fbdev subsystem thinks your monitor should use,
> while vesa:0x11A selects videomode I think you should use.

Could fbdev be changed to select the same videomode as vesa: switch?

--
Tomasz Torcz 72->| 80->|
[email protected] 72->| 80->|

2004-06-22 00:52:19

by Giuseppe Bilotta

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

Tomasz Torcz wrote:
> On Mon, Jun 21, 2004 at 03:31:36AM +0200, Petr Vandrovec wrote:
> > > > > > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > > > > > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
> >
> > 1280x1024-60 just selects some videomode fbdev subsystem thinks your monitor should use,
> > while vesa:0x11A selects videomode I think you should use.
>
> Could fbdev be changed to select the same videomode as vesa: switch?

There is a vesafb-tng (the next generation) on Gentoo. I
applied it to my 2.6.7; it allows, among other things, to load
the vesafb driver as a module and to specify resolutions with
the "usual" (widthxheight-bitdepth@refresh) syntax.

On my video card (GeForce2 Go) it doesn't seem to work very
well though.

--
Giuseppe "Oblomov" Bilotta

Can't you see
It all makes perfect sense
Expressed in dollar and cents
Pounds shillings and pence
(Roger Waters)

2004-06-22 12:28:19

by Tomasz Torcz

[permalink] [raw]
Subject: Re: Matroxfb in 2.6 still doesn't work in 2.6.7

On Tue, Jun 22, 2004 at 02:51:24AM +0200, Giuseppe Bilotta wrote:
> Tomasz Torcz wrote:
> > On Mon, Jun 21, 2004 at 03:31:36AM +0200, Petr Vandrovec wrote:
> > > > > > > video=matroxfb:vesa:0x11A,right:48,hslen:112,left:248,hslen:112,lower:1,vslen:3,upper:48
> > > > > > > maybe with ',sync:3' if +hsync/+vsync are mandatory for your monitor.
> > >
> > > 1280x1024-60 just selects some videomode fbdev subsystem thinks your monitor should use,
> > > while vesa:0x11A selects videomode I think you should use.
> >
> > Could fbdev be changed to select the same videomode as vesa: switch?
>
> There is a vesafb-tng (the next generation) on Gentoo.

Well, we were talking about matroxfb, switched by video=matroxfb:vesa:xxx option.

--
Tomasz Torcz "God, root, what's the difference?"
[email protected] "God is more forgiving."