Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running X on PCI Sparcs under 2.6
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
Mark Clegg
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 269
Location: ZZ9 Plural Z Alpha

PostPosted: Tue Mar 09, 2004 9:26 pm    Post subject: Running X on PCI Sparcs under 2.6 Reply with quote

The 2.6 kernel on Sparc guide suggests problems running X on Sparcs with the 2.6 kernel.

I just found this....

http://groups.google.com/groups?q=xfree86+2.6+group:linux.debian.ports.sparc&hl=en&lr=&ie=UTF-8&oe=UTF-8&group=linux.debian.ports.sparc&selm=1l96j-2Gs-17%40gated-at.bofh.it&rnum=3

The gist of which seems to be that the problem is down to PCI naming changes in the 2.6 kernel.

Quote:
If you want a quick way, download the kernel source, edit
arch/sparc64/kernel/pci.c:pci_name_bus(). Edit the sprintf line to look
like this:

sprintf(name, "%02x", bus->number);

Then recompiled. Remember, this is a hack. A hack that is only needed
for PCI video cards. Soon enough XFree86 will be made to work correctly.
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Wed Mar 10, 2004 1:33 am    Post subject: Reply with quote

Try this. I can't actually test it right now... It's against 4.3.99.whatever the latest in portage is :P If it works I'll get it added to the xfree ebuilds.

Code:

--- xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c.orig       2004-03-07 18:40:27.165278000 +0000
+++ xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c    2004-03-07 18:48:07.895278000 +0000
@@ -104,6 +104,7 @@
        static int      lbus,ldev,lfunc,fd = -1;
        int             bus, dev, func;
        char            file[32];
+       struct stat     ignored;
 
        bus  = PCI_BUS_FROM_TAG(tag);
        dev  = PCI_DEV_FROM_TAG(tag);
@@ -111,12 +112,21 @@
        if (fd == -1 || bus != lbus || dev != ldev || func != lfunc) {
                if (fd != -1)
                        close(fd);
-               if (bus < 256)
-                       sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
-                               bus, dev, func);
-               else
-                       sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
-                               bus, dev, func);
+               if (bus < 256) {
+                       if (stat("/proc/bus/pci/00", &ignored) < 0)
+                               sprintf(file, "/proc/bus/pci/%02x/%02x.%1x",
+                                       bus, dev, func);
+                       else
+                               sprintf(file, "/proc/bus/pci/0000:%02x/%02x.%1x",
+                                       bus, dev, func);
+               } else {
+                       if (stat("/proc/bus/pci/00", &ignored) < 0)
+                               sprintf(file, "/proc/bus/pci/%04x/%02x.%1x",
+                                       bus, dev, func);
+                       else
+                               sprintf(file, "/proc/bus/pci/0000:%04x/%02x.%1x",
+                                       bus, dev, func);
+               }
                fd = open(file,O_RDWR);
                lbus  = bus;
                ldev  = dev;
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Wed Mar 10, 2004 7:44 pm    Post subject: Reply with quote

I'm an eejit. The conditionals in the above patch are backwards... The bug...
Back to top
View user's profile Send private message
Mark Clegg
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 269
Location: ZZ9 Plural Z Alpha

PostPosted: Thu Mar 11, 2004 6:39 pm    Post subject: Reply with quote

As you know - the Ultra 5 isn't the Ultra-Fastest system in the world...

I'll test and let you know..... when I can get a few hours....
Back to top
View user's profile Send private message
Mark Clegg
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 269
Location: ZZ9 Plural Z Alpha

PostPosted: Sat Mar 13, 2004 10:42 am    Post subject: Reply with quote

Yes - xfree-4.3.99.902-r2 now installs and works. (after downgrading ncurses)

Now for that pesky little rodent...

This is odd...

I have SUN-SU support and Serial Mouse support compiled into the kernel, and dmesg shows the following...

Code:
mice: PS/2 mouse device common for all mice
input: su/serio1/input on su/serio1
input: Sun Mouse on su/serio0


Now for the wierd bit.

The mouse doesn't work.

If I boot into 2.4.xx, the mouse works

If I reboot into 2.6.3 - the mouse now works....

So - what is 2.4.xx initialising in the mouse that 2.6.3 is missing? - When 2.4 boots up I get an additional message - Sun Mouse initialised at 1200 baud, but I don't get this in 2.6. - could this be a clue?
Back to top
View user's profile Send private message
Mark Clegg
Apprentice
Apprentice


Joined: 05 Jan 2004
Posts: 269
Location: ZZ9 Plural Z Alpha

PostPosted: Sun Mar 14, 2004 2:31 pm    Post subject: Reply with quote

Hmmm, it also fixes the problem if I boot under 2.6, unplug the mouse, and plug it back in again....

Methinks this needs a separate thread....

http://forums.gentoo.org/viewtopic.php?p=957404
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum