# How do I get DRI with S3 Savage IX in Thinkpad T22?

## Kimmo_S

My machine is an IBM T22 laptop.  ACCEPT_KEYWORDS is x86, kernel is Linux orava 2.6.14-gentoo-r2 #7 PREEMPT Sat Jan 21 20:57:25 EET 2006 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux

# emerge -pv xorg-x11 x11-drm

[ebuild   R   ] x11-base/xorg-x11-6.9.0  -3dfx +bitmap-fonts -cjk -debug -doc -font-server +insecure-drivers +ipv6 -minimal +nls -nocxx +opengl +pam -sdk -static +truetype-fonts +type1-fonts (-uclibc) -xprint +xv 0 kB [1] 

[ebuild   R   ] x11-base/x11-drm-20051223  0 kB

If I load glx and dri in the Modules section of xorg.conf, and have the correct "dri" section, the screen goes black after startx, and won't come back until cold reboot.  The machine keeps working so that I can log in and use "ps -A" to see X and wmaker running.  If I disable dri, everything else works fine.

After having the screen blackened out, lspci shows the Savage as:

01:00.0 VGA compatible unclassified device: Unknown device 200c:0001 (rev 0c)

Before running X with dri enabled, it is shown as:

01:00.0 VGA compatible controller: S3 Inc. 86C270-294 Savage/IX-MV (rev 13)

From a run that caused the screen to go blank, the Xorg.0.log contains (these are parts and excerpts, ask for the complete log or other parts):

(II) LoadModule: "dri"

(II) Loading /usr/lib/modules/extensions/libdri.so

(II) Module dri: vendor="X.Org Foundation"

        compiled for 6.9.0, module version = 1.0.0

        ABI class: X.Org Server Extension, version 0.2

(II) Loading sub module "drm"

(II) LoadModule: "drm"

(II) Loading /usr/lib/modules/linux/libdrm.so

(II) Module drm: vendor="X.Org Foundation"

        compiled for 6.9.0, module version = 1.0.0

        ABI class: X.Org Server Extension, version 0.2

(II) Loading extension XFree86-DRI

(II) LoadModule: "savage"

(II) Loading /usr/lib/modules/drivers/savage_drv.so

(II) Module savage: vendor="X.Org Foundation"

        compiled for 6.9.0, module version = 2.0.2

        Module class: X.Org Video Driver

        ABI class: X.Org Video Driver, version 0.8

(II) SAVAGE(0): initializing int10

(II) SAVAGE(0): Primary V_BIOS segment is: 0xc000

(II) SAVAGE(0): VESA BIOS detected

(II) SAVAGE(0): VESA VBE Version 2.0

(II) SAVAGE(0): VESA VBE Total Mem: 8192 kB

(II) SAVAGE(0): VESA VBE OEM: S3 Incorporated. M7 BIOS

(II) SAVAGE(0): VESA VBE OEM Software Rev: 1.0

(II) SAVAGE(0): VESA VBE OEM Vendor: S3 Incorporated.

(II) SAVAGE(0): VESA VBE OEM Product: VBE 2.0

(II) SAVAGE(0): VESA VBE OEM Product Rev: Rev 1.1

(--) SAVAGE(0): mapping framebuffer @ 0xf0000000 with size 0x800000

(==) SAVAGE(0): Write-combining range (0xf0000000,0x800000)

(II) SAVAGE(0): Splitting WC range: base: 0xf2000000, size: 0x5000000

(II) SAVAGE(0): Splitting WC range: base: 0xf4000000, size: 0x3000000

(==) SAVAGE(0): Write-combining range (0xf6000000,0x1000000)

(==) SAVAGE(0): Write-combining range (0xf4000000,0x3000000)

(==) SAVAGE(0): Write-combining range (0xf2000000,0x5000000)

(II) SAVAGE(0): map aperture:0xb20ad000

(II) SAVAGE(0): 3732 kB of Videoram needed for 3D; 8192 kB of Videoram available

(II) SAVAGE(0): Sufficient Videoram available for 3D

(II) SAVAGE(0): [drm] bpp: 32 depth: 24

(II) SAVAGE(0): [drm] Sarea 2200+284: 2484

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: Open failed

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: open result is -1, (No such device or address)

drmOpenDevice: Open failed

drmOpenByBusid: Searching for BusID pci:0000:01:00.0

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is 8, (OK)

drmOpenByBusid: drmOpenMinor returns 8

drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0

(II) SAVAGE(0): [drm] loaded kernel module for "savage" driver

(II) SAVAGE(0): [drm] DRM interface version 1.2

(II) SAVAGE(0): [drm] created "savage" driver at busid "pci:0000:01:00.0"

(II) SAVAGE(0): [drm] added 8192 byte SAREA at 0xd0a9e000

(II) SAVAGE(0): [drm] mapped SAREA 0xd0a9e000 to 0xb20ab000

(II) SAVAGE(0): [drm] framebuffer handle = 0xf0000000

(II) SAVAGE(0): [drm] added 1 reserved context for kernel

(II) SAVAGE(0): [agp] Mode 0x1f000201 [AGP 0x8086/0x7190; Card 0x5333/0x8c12]

(II) SAVAGE(0): [agp] 16384 kB allocated with handle 0x00000001

(II) SAVAGE(0): [agp] DMA buffers handle = 0xf8000000

(II) SAVAGE(0): [agp] agpTextures handle = 0xf8200000

(II) SAVAGE(0): [drm] aperture handle = 0xf2000000

(II) SAVAGE(0): [drm] Added 32 65536 byte DMA buffers

(II) SAVAGE(0): [dri] visual configs initialized

(**) SAVAGE(0): DRI is enabled

(--) SAVAGE(0): Chose mode 112 at 60Hz.

(II) SAVAGE(0): virtualX:640,virtualY:480

(II) SAVAGE(0): bpp:32,tiledwidthBytes:2560,tiledBufferSize:1228800 

(II) SAVAGE(0): bpp:32,widthBytes:2560,BufferSize:1228800 

(II) SAVAGE(0): videoRambytes:0x00800000 

(II) SAVAGE(0): textureSize:0x0025b000 

(II) SAVAGE(0): textureSize:0x0025b000 

(II) SAVAGE(0): textureOffset:0x00584000 

(II) SAVAGE(0): depthOffset:0x00458000,depthPitch:2560

(II) SAVAGE(0): backOffset:0x0032c000,backPitch:2560

(II) SAVAGE(0): Memory manager initialized to (0,0) (640,1298)

(II) SAVAGE(0): Largest offscreen area available: 640 x 818

(II) SAVAGE(0): Reserved back buffer at offset 0x32c000

(II) SAVAGE(0): Reserved depth buffer at offset 0x458000

(II) SAVAGE(0): Reserved 2412 kb for textures at offset 0x584000

(II) SAVAGE(0): Using XFree86 Acceleration Architecture (XAA)

        Screen to screen bit blits

        Solid filled rectangles

        8x8 mono pattern filled rectangles

        Indirect CPU to Screen color expansion

        Solid Lines

        Image Writes

        Offscreen Pixmaps

        Setting up tile and stipple cache:

                30 128x128 slots

(==) SAVAGE(0): Backing store disabled

(**) Option "dpms"

(**) SAVAGE(0): DPMS enabled

(II) SAVAGE(0): X context handle = 0x1

(II) SAVAGE(0): [DRI] installation complete

 --- Lots and lots of information here, with [junkers] and some parameters and values associated with them

(II) SAVAGE(0): Direct rendering enabled

(==) RandR enabled

(II) Setting vga for screen 0.

(II) Initializing built-in extension MIT-SHM

(II) Initializing built-in extension XInputExtension

(II) Initializing built-in extension XTEST

(II) Initializing built-in extension XKEYBOARD

(II) Initializing built-in extension LBX

(II) Initializing built-in extension XC-APPGROUP

(II) Initializing built-in extension SECURITY

(II) Initializing built-in extension XINERAMA

(II) Initializing built-in extension XFIXES

(II) Initializing built-in extension XFree86-Bigfont

(II) Initializing built-in extension RENDER

(II) Initializing built-in extension RANDR

(II) Initializing built-in extension COMPOSITE

(II) Initializing built-in extension DAMAGE

(II) Initializing built-in extension XEVIE

----------

## Kimmo_S

Section "Device"

        Identifier      "Savaagi"

        Driver          "savage"

#       BusID           "PCI:1:0:0"

#       Option          "MergedFB"      "true"

        Option          "ShadowStatus"  "false"

#       Option          "BCIforxv"      "false"

#       Option          "DmaMode"       "None"

#       Option          "BusType"       "AGP"

#       Option          "hw cursor"     "off"

#       Option          "sw cursor"     "on"

#       Option          "forceinit"     "yes"

#       Option          "MetaModes"     "1024x768-800x600 1024x768-640x480"

EndSection

BusID had no effect with anything.  Same goes with ShadowStatus and DmaMode.

With BusType set, I had a couple of hard locks, so I forgot about it.

ForceInit fixed the screen blanking problem once, so I could have DRI according to Xorg.0.log but no DRI according to glxinfo, but now I always get the blanked screen if DRI is enabled.

----------

## volatile void

Try

```
Option "BusType" "PCI"
```

It costs you some performance but X should start and 3D acceleration should work. I had the same notebook and issues like you. Unfortunately, until now there was no solution found to this problem...

Thomas

----------

## Kimmo_S

With bustype pci, X did start, glxinfo reported direct rendering, but glxgears caused a hard lock.  The glxgears window did appear.  Trying to move mouse after that, it was stuck, but skipped forward twice after some seconds.  Then, nothing.  An ssh login also stopped responding, and I did a hard reset.

 - With shadowstatus true and forceinit yes, X became so slow that I could see individual lines and characters appear one after another in Eterm window and Windowmaker's buttons.  It did accept Ctrl+Alt+Backspace and so I could try the next combination.

 - With only forceinit true, and shadowstatus commented out, another blankout happened.  The ssh login stayed responsive, and I used it to reboot the machine.

 - With shadowstatus true, forceinit commented out, another blankout, and by "ps -A" I could tell X was no longer running.

 - With shadowstatus and forceinit both again turned on, a regular blankout.  Didn't look if X was still running.

 - With shadowstatus and forceinit both again commented out, software cursor on and dmamode "none", another blankout and X no longer running.  A reboot from ssh login won't restore the display, so I must "shutdown now -h" everytime I lose picture.

 - With swcursor, dmamode, shadowstatus and forceinit commented out, it took 5 minutes of blankness until the Windowmaker background finally appeared.  X is using 99% CPU and nothing is visible beyond the cursor.  Two minutes after that, the background of the paperclip button appeared.  Typing "shutdown now -h" via ssh login, the X screen was visible until the actual powerdown.

Kernel has: CONFIG_AGP=m, CONFIG_AGP_INTEL=m and # CONFIG_DRM is not set

Now recompiling kernel without AGP modules.  Did remember to re-emerge x11-drm.  Next tries:

 - With shadowstatus, forceinit and swcursor true and dmamode none: X crashed, screen stays blank, /var/log/Xorg.0.log seems ok.

Are there any more combinations I should or could try?

EDIT: Added some details (twice)Last edited by Kimmo_S on Sun Jan 22, 2006 7:06 pm; edited 1 time in total

----------

## volatile void

Try the DRI drivers from http://dri.freedesktop.org/. I used them and they worked pretty well in PCI mode. You need the "common" and "savage"-snapshots from http://dri.freedesktop.org/snapshots/. Run the install-scripts and try running X again.

Thomas

----------

## Kimmo_S

Did use common-20060122-linux.i386 and savage-20060122-linux.i386, and both went in fine.  There is now maybe 20 seconds between icons when they appear onto the Windowmaker desktop.  It takes 6 seconds from touching the mouse for the cursor to actually move.  Going forward with trying different combinations for options in xorg.conf.  The CPU usage has been at 99% for the couple of minutes the Windowmaker desktop took to appear, and is still there.

Pressed Ctrl-Alt-Backspace.  After 6 seconds, text disappeared from one paperclip icon.  For some reason I had two of them.  After another 6 seconds, the other paperclip disappeared entirely.  For two minutes after that, nothing has happened and I'm contemplating another shutdown and power-up while I send this.

----------

## firephoto

I finally got mine working, modular xorg-7, 2.6.15-ck2 (2.6.15.1) with the in kernel drm and savage modules, and added the DmaMode option to the xorg.conf.

I made sure that "savage" was loaded before I started X and I think this makes a difference currently, also there was a drm fix that went into 2.6.15-git9 but this might be the same as what's provided by x11-drm.

Before when it wasn't working I was using the x11-drm-20051223 from portage and was not loading the savage driver before X started. I had glxinfo reporting that things were loaded but if I ran glxgears it would just segfault, I never had X crash or a kernel oops.

```

Section "Device"

        Identifier  "Videocard0"

        Driver      "savage"

        VendorName  "Videocard vendor"

        BoardName   "S3 Savage/IX"

        Option "ShadowStatus" "true"

        Option "AGPMode" "2"

        Option "DmaMode" "None"

EndSection

```

This is on a thinkpad t20 btw.

----------

## rapidsquirrel

I tried the setting you suggested firephoto (on a t22) and they seem to work mostly. GLX gears gives me about 450 frames a second and doesn't lock up which is nice. But it locks up hard when I try to play Enemy-territory, right after the opening video.  I guess I need to try a couple of other 3d programs and see if they work. Anyone have any ideas as to how I can figure out where and why it is locking up on me?

----------

## firephoto

I read about the same effect you're seeing so maybe that kernel fix will help (not sure what release kernel it's in) since they were all talking about it being a kernel issue somehow.

----------

## rapidsquirrel

I'm running vanilla 2.6.15.1 just FYI

----------

## firephoto

I guess I forgot to mention I didn't run anything besides glxgears but I imagine I'll have the same problem with those full opengl using apps.

----------

## rapidsquirrel

I decided to try a new kernel(vanilla 2.6.15.2-rc6 to be exact) and discovered that some where after 2.6.15.1 they fixed the bugs. I've tried bzflag which worked and am going to try ET to see if it breaks. So it seems that the problem will be fixed for most people when maintianers feel that they can umask the newer kernel sources.

Edit: nevermind, doesn't work after reboot. stupid computer.

----------

## Zarhan

 *firephoto wrote:*   

> 
> 
> ```
> 
> Section "Device"
> ...

 

  Just a stupid question, but where did you find out about all those options? "man savage" only tells about ShadowStatus, there is nothing about Dmamode or AGPMode. And I'm running Xorg 7.

----------

## firephoto

 *Zarhan wrote:*   

>  *firephoto wrote:*   
> 
> ```
> 
> Section "Device"
> ...

 

Not sure, maybe here since I have that bookmarked.

----------

## rapidsquirrel

In the process of fooling around with my laptop I noticed a strange oddity in my dmesg text after starting X11.

```
mtrr: base(0xf2000000) is not aligned on a size(0x5000000) boundary
```

Could this have something to do with the fact that 3d still refuses to work?

and if not, still any ideas on were I could find a fix for it?

----------

