linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: matroxfb, anybody? (More details...)
@ 1999-02-01 15:55 Benjamin Herrenschmidt
  1999-02-01 16:25 ` Geert Uytterhoeven
  0 siblings, 1 reply; 27+ messages in thread
From: Benjamin Herrenschmidt @ 1999-02-01 15:55 UTC (permalink / raw)
  To: linuxppc-dev


On Mon, Feb 1, 1999, Geert Uytterhoeven
<Geert.Uytterhoeven@cs.kuleuven.ac.be> wrote:

>Since BootX creates a fake OF device tree, I suspect it to appear in the
tree.
>Can you use your Mystique under MacOS? This is of course a prerequisite for
>BootX seeing your board.

OF in the machine's ROM (not the card's ROM) should make _any_ PCI board
visible provided that it contains correct config-space registers with a
vendorID and a deviceID, which is required for all PCI cards anyway. The
board itself can optionally contain OF code which can then change things
in the device-tree but you will (should) always at least have a device
tree entry, even if you have no OF code on the board.

BootX will make the fake OF tree from MacOS Name Registry, which is
itself a translated version of OF tree (plus or minus a couple of things
since MacOS drivers can change it).

However, I've read somewhere that there is actually a difference between
Matrox boards with and without OF code: the OF code will set the board to
use big-endian pixels. It may also change a couple of other things, so
you can not rely on the state of the board at driver initialisation. You
will probably also have differences with or without Gabriel PReP
bootloader since it will be able to run any x86 bios code that lives here.


-- 
           E-Mail: <mailto:bh40@calva.net>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>





[[ 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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody? (More details...)
@ 1999-02-02 12:53 Petr Vandrovec Ing. VTEI
  1999-02-04  5:49 ` dhiltgen@toocool.calpoly.edu
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Vandrovec Ing. VTEI @ 1999-02-02 12:53 UTC (permalink / raw)
  To: dhiltgen@toocool.calpoly.edu
  Cc: O.Waller, mlan, linuxppc-dev, Geert.Uytterhoeven


On  2 Feb 99 at 2:37, dhiltgen@toocool.calpoly.edu wrote:
> 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
You have some problem somewhere. If I do (atyfb + matroxfb or vga16fb +
matroxfb):
<switch to tty2>
con2fb /dev/fb1 /dev/tty2
then immediately at this point contents of screen on atyfb/vga16fb is
frozen and output on matroxfb is activated. Without any intervening
fbset, of course. I hope, that resolution on controlfb is compatible
with matroxfb capabilities (i.e. 8-32 bpp, 4bpp only on Millennium I/II).
> The cursor tends to get messed up on matrox... a second "large"
> multi-color funky cursor square (about 4x larger) exists after an fbset.
Could it be forgotten fbcon software cursor (flashing box 1x1 character)?
It could be also 32x32 pixels uninitialized hardware cursor, but I do not
know why driver should forget to initialize it.
> 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.
? Isn't it control problem? vgacon + matroxfb, vga16fb + matroxfb,
atyfb + matroxfb and matroxfb + matroxfb hapilly coexist here...
BTW, updates on non-fg framebuffer are suspended until you switch
to that framebuffer.
> 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)
It could be on tty8. And I think that you want to run `X vt2 :1'
(I hope that it is not fbdev specific option).
> 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
It is kernel issue. At least, it send signals about getting/loosing fg
terminal on every console switch.
> 1) How can I get the two X servers to use different VCs so that I can
> switch between them.  Alternatively...
I did "XF86_Mach64 & ; XF86_SVGA :1 &" just now and I got
Mach64 server running (on top of vga16fb) on /dev/tty24 and Matrox
running on /dev/tty25... /dev/tty24 is available here as right-alt-ctrl-F12,
/dev/tty25 as left-alt-ctrl-F1 + alt-left_arrow... Both hapilly working.
You can switch between them, but, of course, only one updates screen in
one moment. Because of I have dual-input EIZO, it does not cause problems
to me :-)
> 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?
I do not think that it is possible at this moment.
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz

> 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
Why nopan? It must be slow as hell...

[[ 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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody? (More details...)
@ 1999-02-01 18:32 Petr Vandrovec Ing. VTEI
  0 siblings, 0 replies; 27+ messages in thread
From: Petr Vandrovec Ing. VTEI @ 1999-02-01 18:32 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linuxppc-dev


On  1 Feb 99 at 18:15, Geert Uytterhoeven wrote:
> > So, attached patch adds back that matrox_init is called unless you
> > specify `video=matrox:off' on command line. In this case, matrox can
> > be still initialized through offb. If you specify `video=matrox:disabled',
> > driver will be unavailable for offb too.
> Which does not help if you have 2 Matrox boards, due to the single static
> `initialized' variable.
No problem because of driver initializes ALL matroxes once matrox_init is
called, regardless of device_node contents (behavior is determined by
video=matrox:dev:X parameter).
> > Also, driver still does not use device_node passed to driver by offb
> > because of no-one told me what I can expect in that variable... Driver
> You can find the PCI base addresses in there (look at atyfb_of_init() for an
> example).
Unless `register_pci_region' is here, I think that I stay with current
behavior. I'm too lazy to add skipping of already registered devices
into matrox_init().
                                                Petr Vandrovec
                                                vandrove@vc.cvut.cz


[[ 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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody? (More details...)
@ 1999-02-01 17:38 Petr Vandrovec Ing. VTEI
  1999-02-01 17:15 ` Geert Uytterhoeven
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Vandrovec Ing. VTEI @ 1999-02-01 17:38 UTC (permalink / raw)
  To: Owen Waller; +Cc: linuxppc-dev

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1697 bytes --]

On  1 Feb 99 at 15:30, Owen Waller wrote:
> o.k. well the x86 board definelty doesn't... So we now have a more general
> problem:
> If I have two idential video boards in my Mac one "mac" specific which
> shows up in the OF tree, and one that is x86 sourced and doesn't show up
> under OF how can we initialise both boards correctly.
If you have at least one matrox in your OF tree, driver will initialize
all matroxes from offb. If you have no matrox in OF tree, driver will
initialize them from matrox_init.
> im my case matroxfb will become my primary head, but I'd still like access
> to the internal (control) video in case soemthing in a new kernel dies
> before matroxfb is initialised.
Without offb you can set order by
video=control: video=matrox:
to get control first (or vice versa to get matrox first). With offb I do not
know.

So, attached patch adds back that matrox_init is called unless you
specify `video=matrox:off' on command line. In this case, matrox can
be still initialized through offb. If you specify `video=matrox:disabled',
driver will be unavailable for offb too.
Also, driver still does not use device_node passed to driver by offb
because of no-one told me what I can expect in that variable... Driver
uses nvram_read_byte(NV_VMODE & NV_CMODE) to set initial resolution if
offb is enabled.
                                    Best regards,
                                        Petr Vandrovec
                                        vandrove@vc.cvut.cz

P.S.: I hope that your list survive this 890 bytes long attachment.
P.P.S.: As usual, cc-me if you have comments/question/...
P.P.P.S.: If patch will not apply cleanly, apply Geert's scr_readw()
patches first.

[-- Attachment #2: Text from file 'OW' --]
[-- Type: text/plain, Size: 890 bytes --]

--- linux-2.2.1.dist/drivers/video/matroxfb.c	Fri Jan 15 22:56:49 1999
+++ linux/drivers/video/matroxfb.c	Mon Feb  1 16:55:56 1999
@@ -4,7 +4,7 @@
  *
  * (c) 1998,1999 Petr Vandrovec <vandrove@vc.cvut.cz>
  *
- * Version: 1.9 1999/01/04
+ * Version: 1.13 1999/02/01
  *
  * MTRR stuff: 1998 Tom Rini <tmrini@ntplx.net>
  *
@@ -5743,20 +5748,26 @@
 }
 
 #ifndef MODULE
+static int __init initialized = 0;
+
 __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
+	
+	if (!initialized) {
+		initialized = 1;
+		matrox_init();
+	}
 }
 
 #if defined(CONFIG_FB_OF)
 __initfunc(int matrox_of_init(struct device_node *dp)) {
 	DBG("matrox_of_init");
-	matrox_init();
+	
+	if (!initialized) {
+		initialized = 1;
+		matrox_init();
+	}
 	if (!fb_list) return -ENXIO;
 	return 0;
 }

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody? (More details...)
@ 1999-02-01 12:51 Petr Vandrovec Ing. VTEI
  1999-02-01 12:08 ` Geert Uytterhoeven
  0 siblings, 1 reply; 27+ messages in thread
From: Petr Vandrovec Ing. VTEI @ 1999-02-01 12:51 UTC (permalink / raw)
  To: Owen Waller; +Cc: dhiltgen, mlan, Geert.Uytterhoeven, linuxppc-dev


On  1 Feb 99 at 11:35, Owen Waller wrote:
> > (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).
There is a problem. What if you HAVE matrox in OF ? Of course,
I remove this #ifdef from driver and add some variable to ensure, that
driver will be initialized only once... And if matroxfb is not your primary
head, you can, as temporary solution, compile it as module. It should
work without problems then.
> 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
As I do not have anything with OF around here, tell me what you want
and I'll do it...
                                                    Petr Vandrovec
                                                    vandrove@vc.cvut.cz

P.S.: I'm not on the list, so please CC me...
P.P.S.: Should not I remove whole #ifdef CONFIG_FB_OF from driver?
Is there anybody who uses this additional feature?

[[ 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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody? (More details...)
@ 1999-02-01 10:34 Petr Vandrovec Ing. VTEI
  1999-02-01 10:04 ` Geert Uytterhoeven
  1999-02-01 12:35 ` Owen Waller
  0 siblings, 2 replies; 27+ messages in thread
From: Petr Vandrovec Ing. VTEI @ 1999-02-01 10:34 UTC (permalink / raw)
  To: dhiltgen@toocool.calpoly.edu, O.Waller; +Cc: mlan, linuxppc-dev


Hello Owen, hello D?, hello anybody,
> 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.
> 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)
> 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.
> 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.)
> 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.
> 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.
> 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.
> > > 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.
> 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
> }
>
> 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 :-(
> 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?
> 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
                                            vandrove@vc.cvut.cz

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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: matroxfb, anybody?
@ 1999-01-30 10:00 dhiltgen@toocool.calpoly.edu
  1999-01-30 15:32 ` Owen Waller
  0 siblings, 1 reply; 27+ messages in thread
From: dhiltgen@toocool.calpoly.edu @ 1999-01-30 10:00 UTC (permalink / raw)
  To: mlan, O.Waller; +Cc: linuxppc-dev


Add me to the list of people playing with matroxfb and controlfb.

Does anyone have some fbset outputs suitable for fb.modes for the
matrox Mil I card?  I'm having a heck of a time trying to change from the
default mode.  In Documentation/fb/matroxfb they talk about passing kernel
parameters to set the modes, but whenever I do that the kernel panics
before ever spitting anything out.  I assume it's a "no bios" thing.
I'm hoping someone with a Mac version of the card might already have
the various timings etc that fbset wants, and that they'll be the same
as the PC version.

And the one other simple question... how in the heck do you tell 
XF68 which /dev/fb* to go to?  Right now I'm moving the devices
around by hand, but I'd eventually like to get a Dual headed X setup
going.

...aside...

I'm running an x86 Matrox card in my 8600, and it "sort of" works
right now on 2.2.0.  It appears that there are definitely some kernel
bugs as far as mode switching, as sometimes control and matrox end up
duplicating each other resulting in very funky displays.  I had to hack
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.  

Thanks for any input.

-- 
Daniel Kerry Hiltgen     Computer Science     Cal Poly, San Luis Obispo, CA  
dhiltgen@www.itslab.calpoly.edu    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 linuxppc-dev-request@lists.linuxppc.org ]]

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~1999-02-06 15:22 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-02-01 15:55 matroxfb, anybody? (More details...) Benjamin Herrenschmidt
1999-02-01 16:25 ` Geert Uytterhoeven
1999-02-02 15:10   ` Owen Waller
1999-02-02 20:03     ` Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
1999-02-02 12:53 Petr Vandrovec Ing. VTEI
1999-02-04  5:49 ` dhiltgen@toocool.calpoly.edu
1999-02-04 22:52   ` Takashi Oe
1999-02-01 18:32 Petr Vandrovec Ing. VTEI
1999-02-01 17:38 Petr Vandrovec Ing. VTEI
1999-02-01 17:15 ` Geert Uytterhoeven
1999-02-01 20:32   ` Owen Waller
1999-02-01 12:51 Petr Vandrovec Ing. VTEI
1999-02-01 12:08 ` Geert Uytterhoeven
1999-02-01 16:30   ` Owen Waller
1999-02-01 16:18     ` Geert Uytterhoeven
1999-02-01 19:14     ` Benjamin Herrenschmidt
1999-02-01 20:30       ` Owen Waller
1999-02-02 15:04       ` Owen Waller
1999-02-01 10:34 Petr Vandrovec Ing. VTEI
1999-02-01 10:04 ` Geert Uytterhoeven
1999-02-01 12:35 ` Owen Waller
1999-02-02 10:37   ` dhiltgen@toocool.calpoly.edu
1999-01-30 10:00 matroxfb, anybody? dhiltgen@toocool.calpoly.edu
1999-01-30 15:32 ` Owen Waller
1999-01-30 23:34   ` matroxfb, anybody? (More details...) dhiltgen@toocool.calpoly.edu
1999-01-31  9:38     ` Gerd Knorr
1999-01-31 14:24       ` Geert Uytterhoeven
1999-02-06 15:22         ` Gerd Knorr
1999-01-31 14:36     ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).