Skip to contentSkip to conversation

matroxfb, anybody? (More details...)

DISCUSSION Petr Vandrovec Ing. VTEI 4 participants 4 messages Feb 1, 1999 – Feb 2, 1999

lore
Share & tools
lore
#0 lore raw

Hello Owen, hello D?, hello anybody,

Quoted 3 lines

What are the odds that I could get a hold of that, and that it would compile and possibly run under PPC? Slim to none I bet, but it would be nice...

it should work as long as XFree does not do byteswapping because of
Matrox is switched into big endian mode with matroxfb. Unfortunately, I did not test it yet because of my PowerStack refuses to boot with Gabriel's PrepLoader, so I have something important to work out. Sorry.

Quoted 7 lines

And the second, I have managed to get X working on both displays at once, but the first X server freezes until I exit the second. I used "X :1" for the second. Is there some other trick to keep the first one alive? ...Mouse stops, and I tried firing up "xterm -display :0.0 &" and they didn't appear until after I exited the :0.1 X server, at which point all of the xterms I had started popped up on the :0.0 server and the mouse woke back up.

Strange. I tried two fbdev servers (on i386) and they both works. There is only one problem I know of: only one, foreground, server updates screen. I think that fbdev server thinks that he is not visible when it gets console switch signal... SVGA server even switches into textmode... But they work in paralell. Also, maybe that you should run X on fb1 using con2fb /dev/fb1 /dev/tty#X
<switch to tty#X>
FRAMEBUFFER=/dev/fb1 X vt#X
(I'm doing it this way)

Quoted 3 lines

I've used both 2.2 pre 7 and I'm now playing with 2.2.1.
/dev/fb0 = control -- on bootup, this is the console
/dev/fb1 = x86 Matrox Mil. I -- on bootup, displays garbage from last session.

OK.

Quoted 3 lines

So, if I "fbset -i" back on console, then I get the controlfb information as expected, but if I "fbset -i -fb /dev/fb1" the console immediately switches to /dev/fb1, but the fonts are all messed up (I'm guessing the

Cannot comment on this because of my kernel (with my patches) says

# fbset -i -fb /dev/fb1
ioctl_FBIOGET_VSCREENINFO: Invalid cross-device link

That means that fbset tried to work with console belonging to /dev/fb0 through /dev/fb1 device. And it is bug in kernel that it is allowed and it ends up with calling matroxfb_set_var() with console owned by /dev/fb0 without calling FBIOPUT_CON2FBMAP. What happens is unknown, undefined and I think that you are lucky that it did not died :-( (patch to do this is available at ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/fbaddon.gz, but it is for something like 2.2.0-pre1 and will be never included into Linus kernel as is.)

Quoted 2 lines

timing values for fb0 are somehow getting used) I can't see what I type, but the output is definitely trying to go to the matrox. The funny part

Yes, it could happen.

Quoted 4 lines

is the "scroll" is controlled by the kernel, which still correctly scrolls /dev/fb0 (control) so whenever I type enough to get a scroll to occur, matrox doesn't, but control does (even though no new text has appeared on control.)

Yes. You should switch current (or some tty) to /dev/fb1 and then invoke fbset -fb /dev/fb1 from that tty. con2fb is on Geert's home page.

Quoted 3 lines

I then ran "fbset -i -fb /dev/fb1" and console switched back to matrox with messed up fonts. At some point I did a setenv FRAMEBUFFER /dev/fb1 and ran "startx" and it came up on the matrox. The only problem is that

You should not do it with fbset -i -fb /dev/fb1. You should use con2fb, fbset -i -fb /dev/fb1 from tty device on fb0 corrupts internal kernel structures.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

the kernel slightly, in that it assumes if you have a Mac, well then you must have a Mac matrox card, and OF should take care of initialization. Nope, I've got a x86 card, and it has to be initialized by the kernel. Simple one line hack in the init function for matroxfb.

If you have Matrox which cannot be initialized by OF, you should not enable CONFIG_FB_OF. If you have both devices, you can try to persuade OF to have two devices or edit sources. Sorry.

Quoted 8 lines

in drivers/video/matroxfb.c:

#ifndef MODULE
__initfunc(void matroxfb_init(void))
{
DBG("matroxfb_init")
#if defined(CONFIG_FB_OF)
/* Nothing to do, must be called from offb */

Quoted 8 lines
#else
        matrox_init();

#endif
}

matrox_init never gets called on my system, so the card never inits. I just commented out the #ifdef stuff so that matrox_init always gets called and the card magically appears.

Yes, you must add "MTRX,...." somewhere into your OF configuration (my PReP does not have OF and I never saw it...) If you uncommented #define above, be sure that you commented out complement part from drivers/video/offb.c - otherwise matroxfb can be initialized twice, thus you'll get two fb's per one hardware :-(

Quoted 7 lines

The current mode that I'm using, that "sort of works" for matroxfb is:
(I'd _really_ like to be able to change this, but without timing values I can't get it to work, and as I said in the previous e-mail appending to the kernel video=matrox:vesa:<hex-code> results in a immediate panic (no error message, it just freezes) Any ideas short of getting the values from someone with a Mac version of the card who can use vmode or whatever to set the mode properly?)

Could you try put console to serial port and send me panic message, if any comes out through serial port?

Quoted 3 lines

I'm honestly less concerned with the console jumping back and forth. I just want to be able to fire up X on both monitors at the maximum res/depth for each card.

con2fb is your friend...
Best regards,
Petr Vandrovec [email protected]

P.S.: I'm not on the linuxppc-dev list, so CC me if you think that I'm interested in that message.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]] [[ the message 'unsubscribe' to [email protected] ]]

#1 lore raw
Quoted 3 lines · Petr Vandrovec Ing. VTEI

Strange. I tried two fbdev servers (on i386) and they both works. There is only one problem I know of: only one, foreground, server updates screen. I think that fbdev server thinks that he is not visible when it gets

The console subsystem isn't yet multi-head aware. The X server shouldn't receive the console switch signal when you switch to another VC on a different frame buffer device. But to make that work and make really use of that, we need support for multiple input devices first.

Quoted 2 lines

console switch signal... SVGA server even switches into textmode... But they work in paralell. Also, maybe that you should run X on fb1 using

Yes, XF86_SVGA switches to text mode on VC switch. BTW, have you tried XF86_SVGA with Gerd Knorr's patches to make it use fbdev? I assume that one will keep the display image on VC switch.

Greetings,

Geert

--
Geert Uytterhoeven [email protected]
Wavelets, Linux/{m68k~Amiga,PPC~CHRP} http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]] [[ the message 'unsubscribe' to [email protected] ]]

#2 lore raw
In reply to Petr Vandrovec Ing. VTEI

Hi Petr, Daniel and everyone else.

o.k. well after a weekend updating my kernel sources to 2.2.1 here's what I get...

Quoted 7 lines
Quoted 7 lines

And the second, I have managed to get X working on both displays at but the first X server freezes until I exit the second. I used "X :1" for the second. Is there some other trick to keep the first one alive? ...Mouse stops, and I tried firing up "xterm -display :0.0 &" and they didn't appear until after I exited the :0.1 X server, at which point all of the xterms I had started popped up on the :0.0 server and the mouse woke back up.

Quoted 9 lines

Strange. I tried two fbdev servers (on i386) and they both works. There is only one problem I know of: only one, foreground, server updates screen. I think that fbdev server thinks that he is not visible when it gets console switch signal... SVGA server even switches into textmode... But they work in paralell. Also, maybe that you should run X on fb1 using con2fb /dev/fb1 /dev/tty#X
<switch to tty#X>
FRAMEBUFFER=/dev/fb1 X vt#X
(I'm doing it this way)

Daniel, I haven't tried this yet on my Mystique. If Petr's suggestions still doesn't work let me know nad I'll try testing this on my machine. The last time I tried con2fb (a few months ago) it worked fine for moving the console about, but I didn't try X.

Quoted 3 lines
Quoted 3 lines

So, if I "fbset -i" back on console, then I get the controlfb information as expected, but if I "fbset -i -fb /dev/fb1" the console immediately switches to /dev/fb1, but the fonts are all messed up (I'm guessing the

as far as I can tell fbset -i reports the correct information for fb0 - matrox and fb1 - control. But I'll double check this when I get back tonight.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

the kernel slightly, in that it assumes if you have a Mac, well then you must have a Mac matrox card, and OF should take care of initialization. Nope, I've got a x86 card, and it has to be initialized by the kernel. Simple one line hack in the init function for matroxfb.

Quoted 15 lines

If you have Matrox which cannot be initialized by OF, you should not enable CONFIG_FB_OF. If you have both devices, you can try to persuade OF to have two devices or edit sources. Sorry.

Quoted 12 lines

in drivers/video/matroxfb.c:

#ifndef MODULE
__initfunc(void matroxfb_init(void))
{
DBG("matroxfb_init")
#if defined(CONFIG_FB_OF)
/* Nothing to do, must be called from offb */

#else
        matrox_init();

#endif
}

Daniel, well after some poking around in the kernel source I'll agree with you on this ;-). When I first got 2.2.1 compiled it didn't even see the Mystique. Once I took your hack though things seem to be o.k.

Quoted 8 lines
Quoted 3 lines

matrox_init never gets called on my system, so the card never inits. I just commented out the #ifdef stuff so that matrox_init always gets called and the card magically appears.

Yes, you must add "MTRX,...." somewhere into your OF configuration (my PReP does not have OF and I never saw it...) If you uncommented #define above, be sure that you commented out complement part from drivers/video/offb.c - otherwise matroxfb can be initialized twice, thus you'll get two fb's per one hardware :-(

Is there any way that this could be changed? I don't need my internal video (control) to work, but I'd rather have it and the matrox compiled into the one kernel without a hack. Unless Geert you know some way of "fudging" an non-OF card into the OF device tree? OR Petr could you possibly work in a #define construct so that Daniel's "hack" became official? (mind you neither of these are very general solutions).

As for editing drivers/video/offb.c - I don't think this is important. In my case the card never shows up in the device-tree, cat'ing /proc/device-tree doesn't show the card. It only appears on the PCI bus, cat'ing /proc/pci does show the card. So if the card isn't in the device tree then the matrox clause of offb.c is never called. Correct?

Also does anybody know how this situation changes if you use BootX to boot (I don't so I can't comment on this). Would BootX map the mystique from the PCI space into the OF device tree??

Quoted 4 lines
Quoted 4 lines

The current mode that I'm using, that "sort of works" for matroxfb is:
(I'd _really_ like to be able to change this, but without timing values I can't get it to work, and as I said in the previous e-mail appending to the kernel video=matrox:vesa:<hex-code> results in a immediate panic

I'm currently running with:

video=matrox:vesa:0x105 (or 0x118), and things have been rock solid.

Daniel how are you booting via, bootX or direct from OF?

Quoted 2 lines

P.S.: I'm not on the linuxppc-dev list, so CC me if you think that I'm interested in that message.

consider it done :-)

Cheers

-------------------------------------------------------------------------

Owen Waller                     |   "...sometimes I think I'm a little
PhD. Student in Control Eng.    |    more English than I am French..."
Queens University               |              - Alain Prost 
Belfast                         |
Tele: +44 (0)1232 274085        |    Fax: +44 (0)1232 667023

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]] [[ the message 'unsubscribe' to [email protected] ]]

#3 lore raw

OK, I've made a bit more progress...

Using con2fb makes the console switching much happier... I associated tty2 to matrox and left the rest on control. The tty2 console didn't move immediately; I had to run fbset -i -fb /dev/fb1 on tty2 (still visually on control) at which point it popped over to matrox. From then on I could switch back and forth and everything worked as expected.

The cursor tends to get messed up on matrox... a second "large" multi-color funky cursor square (about 4x larger) exists after an fbset. As soon as I switch consoles back to control, the cursor cleared back up. (This was consistent every time I ran fbset.)

Scrolling is still messed up. When the matrox scrolls off the end, control gets the scroll action. Again, if I switch consoles things get reset as they should be. ^L will also clean it up temporarily.

I can get two X servers started, and I tried to use "X :0 tty1" for one of them and "X :1 tty2" for the other, but I can't get them to co-exist happily. The first one always takes tty7. I even tried "-keeptty" as it sounded like it might force the X server to stick to the initial tty instead of 7. Bottom line: I can switch from either one to console, but I can only get back to the first one that I started through tty7. (Either matrox or control but never both)

Also, only the active X server is "alive." The second one just freezes as if it thinks it lost the console to a VC switch.... not the desired result. So is this an X server issue, (Should ignore the VC switch) or a kernel issue? Sounds like a kernel issue, as the kernel should realize that the X server still has the framebuffer, and therefore should still "think" that it is active. If no-one speaks up I might go hacking next week and see if I can cludge something to get it to the point where both X servers get console data... Geert, any thoughts?

So, two questions.

1) How can I get the two X servers to use different VCs so that I can switch between them. Alternatively...

2) Is there any way to get the mouse to "fall off" one side and end up on the other X server (Like Sun's with multiple heads.) XFree86 4.0 maybe? Is it even close to usable yet if I signed up to be a developer, or is it really messy right now?

Oh, and I've downloaded 3.3.3 and applied the SVGA patch and it didn't build out of the box (unrelated to the patch, looks like ppc issues with other parts of the build.) I haven't started tweaking yet but as soon as I get some more free time I'll see if I can get it to build.

Note: All of this was without passing any kernel parameters. I'm now running with "video=matrox:vesa:0x11a,nopan,fv:80" and only using the matrox buffer and it works great as /dev/fb0. Now all I have to do is
get that darn accelerated X server working. ;) Of course if I try to do
stuff with control (/dev/fb1 now) things start getting screwy again.

Thanks.

Signature · 9 lines
Daniel Kerry Hiltgen     Computer Science     Cal Poly, San Luis Obispo, CA  
[email protected]    http://www.itslab.calpoly.edu/~dhiltgen/

"In a world without fences who needs Gates?"  1997 JavaOne Conference

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]]
[[ not forced back to the list, so be sure to  Cc linuxppc-dev  if your ]]
[[ reply is of general interest. To unsubscribe from linuxppc-dev, send ]]
[[ the message 'unsubscribe' to [email protected] ]]