Xorg 7.2.0 on Evo T20

If you're using Ubuntu Feisty (eg. with LTSP-5) on a Compaq Evo T20, then you've probably already noticed that the NSC driver fails to load. The problem occurs only with the latest (2.8.2) version. Reverting back to v2.8.1 fixes it. Here's how to do that ...

If you try to start X with Xorg v7.2.0 and NSC driver v2.8.2, then you get the following error message in your Xorg log file (I'll put here just the tail of the log):
(...)
(II) Setting vga for screen 0.
(II) Loading sub module "vgahw"
(II) LoadModule: "vgahw"
(II) Loading /usr/lib/xorg/modules//libvgahw.so
(II) Module vgahw: vendor="X.Org Foundation"
        compiled for 7.2.0, module version = 0.1.0
        ABI class: X.Org Video Driver, version 1.1
(WW) System lacks support for changing MTRRs

Fatal server error:
xf86MapVidMem: Could not mmap framebuffer (0x00000000,0xfe280000) (Cannot allocate memory)

The fatal error occurs at the place where usually the first NSC log entries would appear. I tried to find a fix for this with Google, but failed. If somebody knows the answer, please share it with me by dropping a comment to this post.

The only fix I know about is going back to the previous version of the NSC driver (namely v2.8.1). I'll describe how to do that. You can run the following as root supposed you've your LTSP in /opt/ltsp/i386 and you've wget installed:
cd /opt/ltsp/i386/tmp
wget 'http://archive.ubuntu.com/ubuntu/pool/main/x/xserver-xorg-video-nsc/xserver-xorg-video-nsc_2.8.1-0ubuntu1_i386.deb'
mount --bind /dev /opt/ltsp/i386/dev
chroot /opt/ltsp/i386 /bin/bash
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root LC_ALL=C LTSP_HANDLE_DAEMONS=false
cd /tmp
dpkg --force-depends -r xserver-xorg-video-nsc
dpkg -i xserver-xorg-video-nsc_2.8.1-0ubuntu1_i386.deb
echo 'xserver-xorg-video-nsc hold' | dpkg --set-selections
umount /dev/pts
umount /sys
umount -lf /proc
exit
umount /opt/ltsp/i386/dev

The dpkg --set-selections command makes sure that a future update will not replace this older version by accident. You'll be notified during all updates of your LTSP tree that there's a newer version of xserver-xorg-video-nsc available, but it was not installed. Of course you can check from time to time whether the latest version of the driver is fixed on the Evo T20. Smile And you could drop a comment here if it is ... Wink

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

How about rebuilding

How about rebuilding 1:2.8.2-2 from Gutsy? Includes a new upstream version:

http://packages.ubuntu.com/gutsy/x11/xserver-xorg-video-nsc

The problem is its dependency on 2:1.3.0.0 xserver-xorg-core though :/

Same problem with Geode based Starbox, I'm currently using a mix of Edgy MueKow and LTSP 4.2

http://www.cappuccinopc.com/star-466.asp

Hi. After 2 days without

Hi.

After 2 days without any result I'm getting mad with the NSC driver. I built a uclibc T20 firmware image and everything is in place except this file. What I have done so far is:

- Downloaded the 2.8.2 and built it without any error againt uclibc.0.29
- Installed it and I get the same error as you
- Downloaded the 2.8.1 and it does not build at all.

Something seems to be strange here. I cannot explain how ubuntu was able to build this driver. The differences between the two versions can be viewed here: http://cgit.freedesktop.org/xorg/driver/xf86-video-nsc. Maybe anyone has a hint.

Markus

building NSC driver

Hi Markus!

I never tried to build the Xorg NSC driver on my own. You asked how the Ubuntu guys could build it and there I might be able to help. As far as I know the method described here should do exactly the same as Ubuntu did for making the Ubuntu-distributed binary versions of the packages. You could try this on the xserver-xorg-video-nsc package and see whether the driver it produces works for you. Of course you'll need an Ubuntu setup for this.

Finally I found out what the

Finally I found out what the numbers want to tell us (implementing debugging messages can help quite a lot). The driver thinks that 0xfe280000 is the size of the framebuffer - this is far too much. The error occurs in nsc_regacc.c in function GetVideoMemSize(). To check the real size I activated framebuffer support in my 2.6.22.5 kernel and got the following output:

...
io scheduler cfq registered
PCI: Fixup for MediaGX/Geode Slave Disconnect Boundary (0x41=0x9c)
gx1fb 0000:00:12.4: 2560 Kibyte of video memory at 0x40800000
fb0: GX1 frame buffer device
Real Time Clock Driver v1.12ac
...

I modded the driver to tell it only to use 2MB but this does not help further. The fix in nsc_gx1_driver.c only resulted in an signal 11.

...
pGeode->FBSize = GetVideoMemSize();
/* experimental fix */
pGeode->FBSize = 0x200000;
...

As the framebuffer size detection code is exactly the same as in 2.8.1 I'm wondering why it should work with the previous driver release.

Markus

Re: Finally I found out ...

Maybe going through a diff of the two versions of nsc_regacc.c might help? Did you try what Steve-o suggested a few comments above (compiling the latest version of the NSC driver from Gutsy)?

Again, one step

Again, one step further.

The driver seems to have problems when accessing the PCI bus. The function gfx_detect_cpu() in module gfx_init.c tries to read the vendor ID of the Geode graphic PCI device with the following code:

value = gfx_pci_config_read(0x80000000);
if (value == PCI_VENDOR_DEVICE_GXM) {
...
value = gfx_pci_config_read(0x80000800);
if (value == PCI_VENDOR_DEVICE_REDCLOUD) {
...

Obviously it uses the standard PCI access through ports 0x0CF8/0x0CFC. After implementing further debug messages I got the following X result:

...
DBG:gfx_pci_config_read(0x80000000)=0 but expected PCI_VENDOR_DEVICE_GXM=69752
DBG:gfx_pci_config_read(0x80000800)=0 but expected PCI_VENDOR_DEVICE_REDCLOUD=2625547
...

Both read request result in an 0 reply and not in vendor id as expected. As I'm no PCI expert at all, I guess it is not a driver problem but a general access problem when reading the PCI configuration.

Markus

Re: Again, one step

I've got the feeling that you'll dig as deep as necessary to find the answer. Smile

I just checkd the different

I just checkd the different NSC driver versions 2.8.0, 2.8.1 & 2.8.2 and the source of above mentioned ubuntu version. The only changes that were implemented are renaming of functions that had naming conflicts. This should not interfere with the behaviour of device detection.

After spending a bit more time in this I'm getting more and more confused. Every read access to the PCI or device ports results in an totally strange result. For example the total build in RAM of my T20 ist detected with about 20MB and the framebuffer address is detected with about 50MB. And with Videoram = TotalRAM - FramebufferBase = 20MB-50MB this results in -30MB (=0xFE280000).

The deeper I dig the more weired it gets.

Markus

Re: I just checked ...

But there must be something between 2.8.1 and 2.8.2 that makes a difference! Shock Otherwise how would you explain that Xorg works with the 2.8.1 and does not with 2.8.2?

changes

I've downloaded the NSC 2.8.1 and 2.8.2 sources from the Ubuntu archive, applied the Ubuntu patches and made a diff of the source trees of the two versions. The diff got 550KB long! I suspect there must be a few changes between the two versions besides the resolution of naming conflicts. Shock

Looking through the ubuntu

Looking through the ubuntu patches I come to the conclusion that they only patch the package build process but not the driver sources or the make files. So I took the 2.8.1 (once again) and tried to build them with the following error:

In file included from ../src/panel/pnl_init.c:175,
from panel.c:178:
../src/panel/platform.c:197: error: conflicting types for 'protected_mode_access'
../src/panel/gx2_9211.c:174: error: previous definition of 'protected_mode_access' was here
../src/panel/platform.c: In function 'protected_mode_access':
../src/panel/platform.c:525: warning: assignment makes pointer from integer without a cast
make[2]: *** [panel.lo] Error 1
make[2]: Leaving directory `/tmp/xf86-video-nsc-2.8.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/xf86-video-nsc-2.8.1'
make: *** [all] Error 2

And that's most important thing what the version 2.8.2 is about. I hope it comes clear why I'm so worried that the 2.8.1 version could be compiled without any errors. Maybe it was done with an older X11 version and not 7.2.

This is an extract log

This is an extract log output of the X server with the 2.8.2 driver. Could you please provide the corresponding part of the 2.8.1 driver. Tanks in advance.

(II) Primary Device is: PCI 00:12:4
(--) Assigning device section with no busID to primary device
(--) Chipset 5530 found
(II) resource ranges after xf86ClaimFixedResources() call:
[0] -1 0 0x00100000 - 0x0fffffff (0xff00000) MX[B]E(B)
[1] -1 0 0x000f0000 - 0x000fffff (0x10000) MX[B]
[2] -1 0 0x000c0000 - 0x000effff (0x30000) MX[B]
[3] -1 0 0x00000000 - 0x0009ffff (0xa0000) MX[B]
[4] -1 0 0x000cc000 - 0x000ccfff (0x1000) MX[B]
[5] -1 0 0x40011000 - 0x4001107f (0x80) MX[B]
[6] -1 0 0x40012000 - 0x400120ff (0x100) MX[B]
[7] -1 0 0x10010000 - 0x10010fff (0x1000) MX[B]
[8] -1 0 0x40010000 - 0x40010fff (0x1000) MX[B](B)
[9] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
[10] -1 0 0x00000000 - 0x000000ff (0x100) IX[B]
[11] -1 0 0x0000fb00 - 0x0000fb7f (0x80) IX[B]
[12] -1 0 0x0000f800 - 0x0000f8ff (0x100) IX[B]
(II) resource ranges after probing:
[0] -1 0 0x00100000 - 0x0fffffff (0xff00000) MX[B]E(B)
[1] -1 0 0x000f0000 - 0x000fffff (0x10000) MX[B]
[2] -1 0 0x000c0000 - 0x000effff (0x30000) MX[B]
[3] -1 0 0x00000000 - 0x0009ffff (0xa0000) MX[B]
[4] -1 0 0x000cc000 - 0x000ccfff (0x1000) MX[B]
[5] -1 0 0x40011000 - 0x4001107f (0x80) MX[B]
[6] -1 0 0x40012000 - 0x400120ff (0x100) MX[B]
[7] -1 0 0x10010000 - 0x10010fff (0x1000) MX[B]
[8] -1 0 0x40010000 - 0x40010fff (0x1000) MX[B](B)
[9] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
[10] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
[11] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
[12] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
[13] -1 0 0x00000000 - 0x000000ff (0x100) IX[B]
[14] -1 0 0x0000fb00 - 0x0000fb7f (0x80) IX[B]
[15] -1 0 0x0000f800 - 0x0000f8ff (0x100) IX[B]
[16] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
[17] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
(II) Setting vga for screen 0.


Markus

extract for 2.8.1

Here's the same extract from the log of NSC 2.8.1 ...

(II) Primary Device is: PCI 00:12:4
(--) Chipset 5530 found
(II) resource ranges after xf86ClaimFixedResources() call:
[0] -1 0 0x00100000 - 0x0fffffff (0xff00000) MX[B]E(B)
[1] -1 0 0x000f0000 - 0x000fffff (0x10000) MX[B]
[2] -1 0 0x000c0000 - 0x000effff (0x30000) MX[B]
[3] -1 0 0x00000000 - 0x0009ffff (0xa0000) MX[B]
[4] -1 0 0x000cc000 - 0x000ccfff (0x1000) MX[B]
[5] -1 0 0x40011000 - 0x4001107f (0x80) MX[B]
[6] -1 0 0x40012000 - 0x400120ff (0x100) MX[B]
[7] -1 0 0x10010000 - 0x10010fff (0x1000) MX[B]
[8] -1 0 0x40010000 - 0x40010fff (0x1000) MX[B](B)
[9] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
[10] -1 0 0x00000000 - 0x000000ff (0x100) IX[B]
[11] -1 0 0x0000fb00 - 0x0000fb7f (0x80) IX[B]
[12] -1 0 0x0000f800 - 0x0000f8ff (0x100) IX[B]
(II) resource ranges after probing:
[0] -1 0 0x00100000 - 0x0fffffff (0xff00000) MX[B]E(B)
[1] -1 0 0x000f0000 - 0x000fffff (0x10000) MX[B]
[2] -1 0 0x000c0000 - 0x000effff (0x30000) MX[B]
[3] -1 0 0x00000000 - 0x0009ffff (0xa0000) MX[B]
[4] -1 0 0x000cc000 - 0x000ccfff (0x1000) MX[B]
[5] -1 0 0x40011000 - 0x4001107f (0x80) MX[B]
[6] -1 0 0x40012000 - 0x400120ff (0x100) MX[B]
[7] -1 0 0x10010000 - 0x10010fff (0x1000) MX[B]
[8] -1 0 0x40010000 - 0x40010fff (0x1000) MX[B](B)
[9] 0 0 0x000a0000 - 0x000affff (0x10000) MS[B]
[10] 0 0 0x000b0000 - 0x000b7fff (0x8000) MS[B]
[11] 0 0 0x000b8000 - 0x000bffff (0x8000) MS[B]
[12] -1 0 0x0000ffff - 0x0000ffff (0x1) IX[B]
[13] -1 0 0x00000000 - 0x000000ff (0x100) IX[B]
[14] -1 0 0x0000fb00 - 0x0000fb7f (0x80) IX[B]
[15] -1 0 0x0000f800 - 0x0000f8ff (0x100) IX[B]
[16] 0 0 0x000003b0 - 0x000003bb (0xc) IS[B]
[17] 0 0 0x000003c0 - 0x000003df (0x20) IS[B]
(II) Setting vga for screen 0.

same

The two extracts are the same except for this one line:
(--) Assigning device section with no busID to primary device

This was not part of the 2.8.1 log, only the 2.8.2 log.

Finally the breakthrough.

Finally the breakthrough. The new driver seems to have massive problems with the implemented in/out functions. Reading and writing to ports does not seem to have any effect. So I replaced the functions with default functions
from io.h (remember to use #include <sys/io.h> in the corresponding modules.

unsigned char
gfx_gxm_config_read(unsigned char index)
{
unsigned char value = 0xFF;
unsigned char lock;

/* OUTB(0x22, GXM_CONFIG_CCR3);
lock = INB(0x23);
OUTB(0x22, GXM_CONFIG_CCR3);
OUTB(0x23, (unsigned char)(lock | 0x10));
OUTB(0x22, index);
value = INB(0x23);
OUTB(0x22, GXM_CONFIG_CCR3);
OUTB(0x23, lock); */

outb(GXM_CONFIG_CCR3,0x22);
lock = inb(0x23);
outb(GXM_CONFIG_CCR3,0x22);
outb( (unsigned char)(lock | 0x10),0x23);
outb( index,0x22);
value = inb(0x23);
outb(GXM_CONFIG_CCR3,0x22);
outb( lock,0x23);

return (value);
}

unsigned long
gfx_pci_config_read(unsigned long address)
{
unsigned long value = 0xFFFFFFFF;

outl(address, PCI_CONFIG_ADDR);
value = inl(PCI_CONFIG_DATA);
/* OUTD(PCI_CONFIG_ADDR, address);
value = IND(PCI_CONFIG_DATA); */

return (value);
}

I don't know if I have to fix further code lines but these two corrections help to get past the error...

Markus

Re: Finally the breakthrough

Nice work! Congratulations! Smile There's only one thing to do: you should contact the maintainer of the NSC Xorg driver (probably through Xorg's bug report website?) and discuss the fix with him (or her Smile ) so future Xorg versions will contain already a working driver.

To sum it all up. X.Org has

To sum it all up.

X.Org has removed the "#define XFree86Server 1" from their build environment. Without this the precompiler gets mad and takes paths that it never was intended for. I've sent a mail to the developer and hope to get an answer soon.

Best regards.

Markus

There's a 2.8.3-2 in Ubuntu

There's a 2.8.3-2 in Ubuntu Hardy with a new upstream release, does this incorporate the fixes?

https://bugs.launchpad.net/ubuntu/hardy/+source/xserver-xorg-video-nsc/1:2.8.3-2

Re: There's a 2.8.3-2 in Ubuntu

I'll check it in a few hours (when I get to work). The new 2.8.3 version was already available for some time now at archive.ubuntu.com, but only as a diff and I didn't bother. Now there's a complete .deb package for the new version (uploaded on 2nd Nov). It's worth a try.

Xorg NSC v2.8.3-2 driver works with the Evo T20

I've checked the new NSC driver and it works. Smile
However you need some extra tweaks if you want to use the new driver with your Ubuntu Feisty installation. There are multiple dependencies that have to be overridden, but if you do override, then it'll work in the end.

First, you've to get the new Debian package installed on your Ubuntu system. Since I use LTSP, I'll describe how to get the new NSC driver installed in an LTSP root (supposing your LTSP installation uses default locations).

cd /opt/ltsp/i386/tmp
wget 'http://archive.ubuntu.com/ubuntu/pool/main/x/xserver-xorg-video-nsc/xserver-xorg-video-nsc_2.8.3-2_i386.deb'
mount --bind /dev /opt/ltsp/i386/dev
chroot /opt/ltsp/i386 /bin/bash
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
export HOME=/root LC_ALL=C
cd /tmp
dpkg --force-depends -r xserver-xorg-video-nsc
dpkg --force-depends -i xserver-xorg-video-nsc_2.8.3-2_i386.deb
echo 'xserver-xorg-video-nsc hold' | dpkg --set-selections
mkdir -p /etc/ltsp/screen.d
cp /usr/lib/ltsp/screen.d/startx /etc/ltsp/screen.d/startx-custom
# At this point edit the /etc/ltsp/screen.d/startx-custom file
# and add a new line following the XF_ARGS initialization to set
# the ignoreABI parameter.
# Eg. XF_ARGS="$XF_ARGS -ignoreABI"
# Then edit /etc/lts.conf and specify that the startx-custom script
# should be invoked instead of whatever used to be invoked.
# Eg. SCREEN_07 = startx_custom
umount /dev/pts
umount /sys
umount -lf /proc
exit
umount /opt/ltsp/i386/dev

The "-ignoreABI" parameter is required for starting Xorg, otherwise it'll fail to load the NSC driver complaining about version differences (something like "module ABI major version (0) doesn't match the server's version (1)").

From now on if you try to upgrade your LTSP root with apt-get, you'll always get a warning about unmet dependencies. If that bothers you, then stick with the 2.8.1 NSC driver (as described above), until the new Ubuntu is released and you can upgrade the full LTSP root.