tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: many in-tree xorg packages updated



On Fri, Jun 12, 2009 at 02:27:38PM -0600, Sverre Froyen wrote:
> On Friday 12 June 2009 12:10:10 Nicolas Joly wrote:
> > On Sat, Jun 13, 2009 at 03:42:19AM +1000, matthew green wrote:
> > >    I updated my amd64 laptop, and encountered some problems.
> >
> > [...]
> >
> > >    2) Trying to start the X server fails because of missing default `glx'
> > >       module which does not exists anymore ...
> > >
> > > this shouldn't be fatal... i do see it myself, but i'm not sure what
> > > is up.  i won't be able to look at this for a couple of days.
> >
> > Indeed. The real problem comes from libpciaccess which is not able to
> > read the video bios for the intel driver ...
> >
> > root@nicodeme [~]# gdb Xorg Xorg.core
> > [...]
> > #8  0x00007f7ffa23a4a6 in i830_bios_init (pScrn=0x7f7ffb05f800)
> >     at
> > /local/src/NetBSD/xsrc/external/mit/xf86-video-intel/dist/src/i830_bios.c:2
> >37 237         ret = pci_device_read_rom (pI830->PciInfo, bios);
> >
> > Looking at the code, pci_device_read_rom() is not implemented for
> > NetBSD :(
> >
> > static const struct pci_system_methods netbsd_pci_methods = {
> >         pci_system_netbsd_destroy,
> >         NULL,
> >         NULL,                        <--- read_rom()
> >         pci_device_netbsd_probe,
> >         pci_device_netbsd_map_range,
> >         pci_device_netbsd_unmap_range,
> >         pci_device_netbsd_read,
> >         pci_device_netbsd_write,
> >         pci_fill_capabilities_generic
> > };
> 
> Do you have the latest libpciaccess?  0.10.6 (from pkgsrc) shows:

That's the one from xsrc.

> static const struct pci_system_methods netbsd_pci_methods = {
>         pci_system_netbsd_destroy,
>         NULL,
>         pci_device_netbsd_read_rom,
> ...

Ah ... pci_device_netbsd_read_rom() comes from patch-ac.

> That said, I cannot get the radeon driver to work.

With the attached patch, X is back with the intel driver.
But i'm pretty sure this will break on non x86 archs.

Thanks for the tip.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: external/mit/libpciaccess/dist/src/netbsd_pci.c
===================================================================
RCS file: /cvsroot/xsrc/external/mit/libpciaccess/dist/src/netbsd_pci.c,v
retrieving revision 1.2
diff -u -p -r1.2 netbsd_pci.c
--- external/mit/libpciaccess/dist/src/netbsd_pci.c     10 Jun 2009 01:55:37 
-0000      1.2
+++ external/mit/libpciaccess/dist/src/netbsd_pci.c     12 Jun 2009 20:48:42 
-0000
@@ -202,6 +202,26 @@ pci_device_netbsd_write(struct pci_devic
        return 0;
 }
 
+static int
+pci_device_netbsd_read_rom(struct pci_device *device, void *buf)
+{
+       int fd, res, err;
+
+       fd = open("/dev/mem", O_RDONLY, 0);
+       if (fd < 0)
+               return errno;
+
+       lseek(fd, 0xc0000, SEEK_SET);
+       res = read(fd, buf, 64*1024);
+       if (res < 0) {
+               err = errno;
+               close(fd);
+               return err;
+       }
+       close(fd);
+       return 0;
+}
+
 static void
 pci_system_netbsd_destroy(void)
 {
@@ -292,7 +312,7 @@ pci_device_netbsd_probe(struct pci_devic
 static const struct pci_system_methods netbsd_pci_methods = {
        pci_system_netbsd_destroy,
        NULL,
-       NULL,
+       pci_device_netbsd_read_rom,
        pci_device_netbsd_probe,
        pci_device_netbsd_map_range,
        pci_device_netbsd_unmap_range,


Home | Main Index | Thread Index | Old Index