|
From: ludovic p. <pl...@nn...> - 2004-09-23 05:42:28
|
Hello...
I think you misunderstood me : Do not activate the hack video stuff. It=20
prevents X from activating the mga mmio and bios (it was the problem in m=
y=20
case)
Maybe you can enable your mga manually with lspci/setpci : the idea is to=
use=20
the config set by the i386 kernel, on the amd64 one...
You can create a dump of your matrox pci configuration on your i386 kerne=
l,=20
assuming the busid of the mga is 00:0a.a
lspci -x -s 00:0a.0 > mga.pci
You will need to transform it into a setpci command line, by piping it in=
to=20
this perl script :
#!/usr/bin/perl
$line=3D<STDIN>;
$i =3D 0;
while($line =3D <STDIN>) {
$line=3D~s/^[0-9a-fA-F][0-9a-fA-F]://;
while($line=3D~m/^ ([0-9a-fA-F][0-9a-fA-F])(.*)$/) {
$line =3D $2;
print sprintf(" %x.b=3D$1",$i);
$i++;
}
}
print "\n";
It will give you something looking like : 0.b=3D2b 1.b=3D10 2.b=3D1a 3.b=
=3D05=20
4.b=3D87 ...
Then on the amd64 kernel, issue the setpci command with the registers val=
ues :
setpci -s XX:XX.X 0.b=3D2b 1.b=3D10 2.b=3D1a 3.b=3D05 4.b=3D87
If it works, your mga should be enabled in lspci...
Beware that if the memory/IRQ ressources used on i386 are not available o=
n=20
x86-64, it will certainly just crash your box.
Ludovic Pollet
Le mercredi 22 Septembre 2004 23:35, Johannes Gajdosik a =E9crit :
> Dear list members,
>
> thank you very much for your replies!
> Because Vojtech Pavlik wrote that it has to do
> with x86-64 mainboards I installed on the same hardware
> (AMD64+K8S8XMainboard+NVidiaFX5200+MGAMillenium)
> 2.4.27 kernel for i386 architecture with Jean-Daniel Paugets
> patch. lspci -v showed:
>
> 00:0a.0 VGA compatible controller: Matrox Graphics, Inc. MGA 2064W
> [Millennium] (rev 01) (prog-if 00 [VGA])
> Flags: stepping, medium devsel, IRQ 5
> Memory at 40000000 (32-bit, non-prefetchable) [disabled]
> [size=3D16K]
> Memory at 40800000 (32-bit, prefetchable) [disabled] [size=3D8M=
]
> Expansion ROM at ffff0000 [disabled] [size=3D64K]
> ...
> 01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX
> 5200] (rev a1) (prog-if 00 [VGA])
> Flags: bus master, 66Mhz, medium devsel, latency 248, IRQ 11
> Memory at fd000000 (32-bit, non-prefetchable) [size=3D16M]
> Memory at f0000000 (32-bit, prefetchable) [size=3D128M]
> Expansion ROM at feae0000 [disabled] [size=3D128K]
> Capabilities: [60] Power Management version 2
> Capabilities: [44] AGP version 3.0
>
> I wrote
> echo 1 > /proc/bus/pci/hackvideo
> and started the second XServer from
> an xterm on the first XServer:
> X :1 -layout MGA vt17
> which gave me the error
> (EE) MGA(0): Cannot read V_BIOS
>
> I must point out that I used XFree86 4.0.3.1 from
> SuSE 9.0 distribution without prefbusid-patch.
>
> Nothing was displayed on the second monitor and I
> had to kill -9 the second XServer from another xterm,
> it did not react on <Ctrl-Alt-Backspace> from the second
> keyboard.
>
> When I stoped all XServers and started only one Xserver with
> X -layout MGA
> from the console both monitors went blank, the leds on my
> keyboard did not work any more and I had to turn the power off.
>
> Yours,
> Johannes Gajdosik
>
> -----------------------------
>
> Ludovic Pollet wrote:
> > Does lspci returns the same before and after you start the X server ?
>
> Yes, it does.
> ----------------------------
>
> Petr Vandrovec wrote:
> > > When I start X on the MGA I get the error
> > > (WW) ****INVALID MEM ALLOCATION**** b: 0xffffc000 e: 0xffffc000
> > > correcting
> > > (EE) MGA(0): No valid MMIO address in PCI config space
> > > (EE) Screen(s) found, but none have a usable configuration.
> >
> > If you'll build matroxfb into kernel, it should force kernel to
> > allocate
> > MMIO regions for Matrox card, and it will also take a care about
> > initializing
> > matrox's hardware during bootup (X do not contain that code).
>
> Im sorry but make menuconfig tells me:
> Support for frame buffer devices (NOT IMPLEMENTED)
> with the 2.4.27 bruby kernel.
> But I will try 2.6.8.1 later.
>
> ------------
>
> Aivils wrote:
> >> I have kernel 2.4.27 for AMD64 (xf86_64) and use Jean-Daniel .
> >> Paugets
> >> patch which I have slightly modified by replacing "i386" with
> >> "x86_64"
> >> where it seemed appropriate to me.
> >
> > --- arch/x86_64/kernel/setup.c~ 2004-08-19 14:40:13.000000000 +0300
> > +++ arch/x86_64/kernel/setup.c 2004-09-22 09:46:59.952898432 +0300
> > @@ -577,7 +577,7 @@ void __init setup_arch(char **cmdline_p)
> > iommu_hole_init();
> > #endif
> >
> > -#ifdef CONFIG_VT
> > +#if 0
> > #if defined(CONFIG_VGA_CONSOLE)
> > conswitchp =3D &vga_con;
> > #elif defined(CONFIG_DUMMY_CONSOLE)
>
> Thanks very much for the patch. I had to remove the whole block
> in order to make it compile.
>
> >> I had to hack a little on IA32
> >> support, but finally the result was quite ok for me.
>
> I wanted to ask you about arch/x86_64/ia32/ia32_ioctl.c.
> I did the following:
>
>
> ----------------------------------------------------
> static int do_fontx_ioctl(unsigned int fd, int cmd, struct
> consolefontdesc32 *user_cfd, struct file *file)
> {
> struct consolefontdesc cfdarg;
> struct console_font_op op;
> int i, perm;
>
> perm =3D vt_check(file);
> if (perm < 0) return perm;
>
> if (copy_from_user(&cfdarg, user_cfd,
> sizeof(struct consolefontdesc32)))
> return -EFAULT;
>
> cfdarg.chardata =3D (unsigned char *)
> A(((struct consolefontdesc32 *)&cfdarg)->chardata);
>
> switch (cmd) {
> case PIO_FONTX:
> /*gaj
> if (!perm)
> */
> return -EPERM;
> /*
> op.op =3D KD_FONT_OP_SET;
> op.flags =3D 0;
> op.width =3D 8;
> op.height =3D cfdarg.charheight;
> op.charcount =3D cfdarg.charcount;
> op.data =3D cfdarg.chardata;
> return con_font_op(fg_console, &op);
> */
> case GIO_FONTX:
> /* gaj
> if (!cfdarg.chardata)
> */
> return 0;
> /*
> op.op =3D KD_FONT_OP_GET;
> op.flags =3D 0;
> op.width =3D 8;
> op.height =3D cfdarg.charheight;
> op.charcount =3D cfdarg.charcount;
> op.data =3D cfdarg.chardata;
> i =3D con_font_op(fg_console, &op);
> if (i)
> return i;
> cfdarg.charheight =3D op.height;
> cfdarg.charcount =3D op.charcount;
> ((struct consolefontdesc32 *)&cfdarg)->chardata =3D
> (unsigned long)cfdarg.chardata;
> if (copy_to_user(user_cfd, &cfdarg,
> sizeof(struct consolefontdesc32)))
> return -EFAULT;
> return 0;
> */
> }
> return -EINVAL;
> }
>
> static int do_kdfontop_ioctl(unsigned int fd, unsigned int cmd,
> struct console_font_op32 *fontop, struct file *file)
> {
> struct console_font_op op;
> int perm =3D vt_check(file), i;
> struct vt_struct *vt;
>
> if (perm < 0) return perm;
>
> if (copy_from_user(&op, (void *) fontop,
> sizeof(struct console_font_op32)))
> return -EFAULT;
> if (!perm && op.op !=3D KD_FONT_OP_GET)
> return -EPERM;
> op.data =3D (unsigned char *)
> A(((struct console_font_op32 *)&op)->data);
> op.flags |=3D KD_FONT_FLAG_OLD;
> vt =3D (struct vt_struct *)((struct tty_struct *)
> file->private_data)->driver_data;
>
> /*gaj
> i =3D con_font_op(vt->vc_num, &op);
> */
> i =3D con_font_op(vt->fg_console->vc_num, &op);
>
> if (i) return i;
> ((struct console_font_op32 *)&op)->data =3D
> (unsigned long)op.data;
> if (copy_to_user((void *) fontop, &op,
> sizeof(struct console_font_op32)))
> return -EFAULT;
> return 0;
> }
>
> static int do_unimap_ioctl(unsigned int fd, unsigned int cmd,
> struct unimapdesc32 *user_ud, struct file *file)
> {
> struct unimapdesc32 tmp;
> int perm =3D vt_check(file);
>
> if (perm < 0) return perm;
> if (copy_from_user(&tmp, user_ud, sizeof tmp))
> return -EFAULT;
> switch (cmd) {
> case PIO_UNIMAP:
> /* gaj
> if (!perm)
> */
> return -EPERM;
> /*
> return con_set_unimap(fg_console, tmp.entry_ct,
> (struct unipair *)A(tmp.entries));
> */
> case GIO_UNIMAP:
> return -EPERM;
> /* gaj
> return con_get_unimap(fg_console, tmp.entry_ct,
> &(user_ud->entry_ct),
> (struct unipair *)A(tmp.entries));
> */
> }
> return 0;
> }
>
> --------------------------------------------------------------------
> I do not care much about fonts on the console but you certainly
> know a better solution.
>
> Also thank you for your hint using 2.6.8 kernel, I will try that.
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Linuxconsole-dev mailing list
> Lin...@li...
> https://lists.sourceforge.net/lists/listinfo/linuxconsole-dev
--=20
Yes, we will be going to OSI, Mars, and Pluto, but not necessarily in
that order.
-- Jeffrey Honig
|