# Kernel 2.6 DRI

## Guni P

I have compiled kernel-2.6.0-test9 with DRI compiled in.Modprobed for my radeon driver and agpgart at startup. But how do i get it now to work with xfree? glxinfo shows Direct Render: no.

My graphics card is a ATI M6.

----------

## Zoltan

There should be something about it in /var/log/XFree86.0.log and maybe in /var/log/syslog, /var/log/debug and dmesg. I am using test9 with matrox G400 with matrox DRI compiled as a module, VIA agpgart compiled in and everything seems fine.

----------

## Guni P

Here is my XFree86 log:

```

drmOpenDevice: minor is 0

drmOpenDevice: node name is /dev/dri/card0

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

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

drmOpenDevice: Open failed

drmOpenDevice: minor is 0

drmOpenDevice: node name is /dev/dri/card0

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

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

drmOpenDevice: Open failed

[drm] failed to load kernel module "agpgart"

drmOpenDevice: minor is 0

drmOpenDevice: node name is /dev/dri/card0

drmOpenDevice: open result is 6, (OK)

drmGetBusid returned ''

(II) RADEON(0): [drm] loaded kernel module for "radeon" driver

(II) RADEON(0): [drm] created "radeon" driver at busid "PCI:1:0:0"

(II) RADEON(0): [drm] added 8192 byte SAREA at 0xd08ec000

(II) RADEON(0): [drm] mapped SAREA 0xd08ec000 to 0x4246c000

(II) RADEON(0): [drm] framebuffer handle = 0x88000000

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

(WW) RADEON(0): [agp] AGP not available

(II) RADEON(0): [drm] removed 1 reserved context for kernel

(II) RADEON(0): [drm] unmapping 8192 bytes of SAREA 0xd08ec000 at 0x4246c000

(II) RADEON(0): Memory manager initialized to (0,0) (1024,8191)

(II) RADEON(0): Reserved area from (0,768) to (1024,770)

(II) RADEON(0): Largest offscreen area available: 1024 x 7421

(II) RADEON(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

   Dashed Lines

   Scanline Image Writes

   Offscreen Pixmaps

   Setting up tile and stipple cache:

      32 128x128 slots

      32 256x256 slots

      16 512x512 slots

(II) RADEON(0): Acceleration enabled

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

(==) RADEON(0): Silken mouse enabled

(II) RADEON(0): Using hardware cursor (scanline 770)

(II) RADEON(0): Largest offscreen area available: 1024 x 7417

(II) RADEON(0): Direct rendering disabled

(==) RandR enabled

(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 XFree86-Bigfont

(II) Initializing built-in extension RENDER

(II) Initializing built-in extension RANDR

```

Here is my dmesg code:

```

Linux version 2.6.0-test9-bk9 (root@localhost) (gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)) #1 Tue Nov 4 21:33:24 Local time zone must be set--see zic manua

BIOS-provided physical RAM map:

 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)

 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)

 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)

 BIOS-e820: 0000000000100000 - 000000000ffe0000 (usable)

 BIOS-e820: 000000000ffe0000 - 000000000fff8000 (ACPI NVS)

 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)

255MB LOWMEM available.

On node 0 totalpages: 65504

  DMA zone: 4096 pages, LIFO batch:1

  Normal zone: 61408 pages, LIFO batch:14

  HighMem zone: 0 pages, LIFO batch:1

DMI 2.3 present.

ACPI: RSDP (v000 Acer                                      ) @ 0x000fe030

ACPI: RSDT (v001 Acer   TMH2     0x00000001 Acer 0x00000000) @ 0x0ffe0000

ACPI: FADT (v001 Acer   TMH2     0x00000001 Acer 0x00000000) @ 0x0ffe0054

ACPI: BOOT (v001 Acer   TMH2     0x00000001 Acer 0x00000000) @ 0x0ffe002c

ACPI: DSDT (v001   MED       H2  0x00001000 MSFT 0x0100000d) @ 0x00000000

Building zonelist for node : 0

Kernel command line: 

Initializing CPU#0

PID hash table entries: 1024 (order 10: 8192 bytes)

Detected 2000.349 MHz processor.

Console: colour VGA+ 80x25

Memory: 254732k/262016k available (2500k kernel code, 6588k reserved, 784k data, 136k init, 0k highmem)

Calibrating delay loop... 3956.73 BogoMIPS

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

checking if image is initramfs...it isn't (no cpio magic); looks like an initrd

Freeing initrd memory: 415k freed

CPU:     After generic identify, caps: 3febf9ff 00000000 00000000 00000000

CPU:     After vendor identify, caps: 3febf9ff 00000000 00000000 00000000

CPU: Trace cache: 12K uops, L1 D cache: 8K

CPU: L2 cache: 512K

CPU:     After all inits, caps: 3febf9ff 00000000 00000000 00000080

CPU: Intel(R) Pentium(R) 4 CPU 2.00GHz stepping 04

Enabling fast FPU save and restore... done.

Enabling unmasked SIMD FPU exception support... done.

Checking 'hlt' instruction... OK.

POSIX conformance testing by UNIFIX

NET: Registered protocol family 16

PCI: PCI BIOS revision 2.10 entry at 0xf0200, last bus=2

PCI: Using configuration type 1

mtrr: v2.0 (20020519)

ACPI: Subsystem revision 20031002

ACPI: IRQ 9 was Edge Triggered, setting to Level Triggerd

ACPI: Interpreter enabled

ACPI: Using PIC for interrupt routing

ACPI: PCI Root Bridge [PCI0] (00:00)

PCI: Probing PCI hardware (bus 00)

Transparent bridge - 0000:00:1e.0

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGP0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCI1._PRT]

ACPI: PCI Interrupt Link [PILA] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILB] (IRQs 3 4 5 6 7 *10 11 12 14 15)

ACPI: PCI Interrupt Link [PILC] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILD] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILE] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILF] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILG] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: PCI Interrupt Link [PILH] (IRQs 3 4 5 6 7 10 *11 12 14 15)

ACPI: Embedded Controller [EC0] (gpe 29)

SCSI subsystem initialized

Linux Kernel Card Services

  options:  [pci] [cardbus] [pm]

ACPI: PCI Interrupt Link [PILD] enabled at IRQ 11

ACPI: PCI Interrupt Link [PILB] enabled at IRQ 10

ACPI: PCI Interrupt Link [PILH] enabled at IRQ 11

ACPI: PCI Interrupt Link [PILA] enabled at IRQ 11

ACPI: PCI Interrupt Link [PILF] enabled at IRQ 11

ACPI: PCI Interrupt Link [PILC] enabled at IRQ 11

ACPI: PCI Interrupt Link [PILG] enabled at IRQ 11

PCI: Using ACPI for IRQ routing

PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'

SBF: Simple Boot Flag extension found and enabled.

SBF: Setting boot flags 0x80

devfs: v1.22 (20021013) Richard Gooch (rgooch@atnf.csiro.au)

devfs: boot_options: 0x1

SGI XFS for Linux with ACLs, realtime, no debug enabled

SGI XFS Quota Management subsystem

pty: 256 Unix98 ptys configured

Real Time Clock Driver v1.12

RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize

Equalizer2002: Simon Janes (simon@ncm.com) and David S. Miller (davem@redhat.com)

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

ICH2: IDE controller at PCI slot 0000:00:1f.1

ICH2: chipset revision 5

ICH2: not 100% native mode: will probe irqs later

    ide0: BM-DMA at 0xd000-0xd007, BIOS settings: hda:DMA, hdb:pio

    ide1: BM-DMA at 0xd008-0xd00f, BIOS settings: hdc:DMA, hdd:pio

hda: FUJITSU MHR2020AT, ATA DISK drive

Using anticipatory io scheduler

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

hdc: QSI CD-RW/DVD-ROM SBW-081, ATAPI CD/DVD-ROM drive

ide1 at 0x170-0x177,0x376 on irq 15

hda: max request size: 1024KiB

hda: 39070080 sectors (20003 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100)

 /dev/ide/host0/bus0/target0/lun0: p1 p2 < p5 p6 p7 p8 p9 >

hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)

Uniform CD-ROM driver Revision: 3.12

mice: PS/2 mouse device common for all mice

i8042.c: Detected active multiplexing controller, rev 1.1.

serio: i8042 AUX0 port at 0x60,0x64 irq 12

input: ImExPS/2 Logitech Explorer Mouse on isa0060/serio2

serio: i8042 AUX1 port at 0x60,0x64 irq 12

serio: i8042 AUX2 port at 0x60,0x64 irq 12

input: PS/2 Synaptics TouchPad on isa0060/serio4

serio: i8042 AUX3 port at 0x60,0x64 irq 12

input: AT Translated Set 2 keyboard on isa0060/serio0

serio: i8042 KBD port at 0x60,0x64 irq 1

NET: Registered protocol family 2

IP: routing cache hash table of 2048 buckets, 16Kbytes

TCP: Hash tables configured (established 16384 bind 32768)

NET: Registered protocol family 1

NET: Registered protocol family 10

IPv6 over IPv4 tunneling driver

NET: Registered protocol family 17

ACPI: (supports S0 S3 S4 S4bios S5)

RAMDISK: Compressed image found at block 0

VFS: Mounted root (ext2 filesystem).

Mounted devfs on /dev

found reiserfs format "3.6" with standard journal

Reiserfs journal params: device hda7, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

reiserfs: checking transaction log (hda7) for (hda7)

Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem) readonly.

Trying to move old root to /initrd ... failed

Unmounting old root

Trying to free ramdisk memory ... okay

Mounted devfs on /dev

Freeing unused kernel memory: 136k freed

Adding 297160k swap on /dev/hda9.  Priority:-1 extents:1

st: Version 20030811, fixed bufsize 32768, s/g segs 256

drivers/usb/core/usb.c: registered new driver usbfs

drivers/usb/core/usb.c: registered new driver hub

i82365: Unknown parameter `tcic'

Yenta: CardBus bridge found at 0000:02:09.0 [1025:1027]

Yenta: Enabling burst memory read transactions

Yenta: Using CSCINT to route CSC interrupts to PCI

Yenta: Routing CardBus interrupts to PCI

Yenta: ISA IRQ list 00f8, PCI irq11

Socket status: 30000011

Yenta: CardBus bridge found at 0000:02:09.1 [1025:1027]

Yenta: Using CSCINT to route CSC interrupts to PCI

Yenta: Routing CardBus interrupts to PCI

Yenta: ISA IRQ list 00f8, PCI irq11

Socket status: 30000006

cs: IO port probe 0x0c00-0x0cff: clean.

cs: IO port probe 0x0800-0x08ff: clean.

cs: IO port probe 0x0100-0x04ff: excluding 0x2f8-0x2ff 0x378-0x38f 0x3c0-0x3df 0x3f8-0x3ff 0x4d0-0x4d7

cs: IO port probe 0x0a00-0x0aff: clean.

cs: memory probe 0xa0000000-0xa0ffffff: clean.

airo:  Probing for PCI adapters

airo:  Finished probing for PCI adapters

airo: Doing fast bap_reads

airo: MAC enabled eth0 0:40:96:36:32:a5

eth0: index 0x05: Vcc 5.0, Vpp 5.0, irq 3, io 0x0100-0x013f

eth0: no IPv6 routers present

Linux agpgart interface v0.100 (c) Dave Jones

[drm] Initialized radeon 1.9.0 20020828 on minor 0

[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held

[drm:radeon_unlock] *ERROR* Process 3639 using kernel context 0

spurious 8259A interrupt: IRQ7.

```

Is there something i should change in my XFreeConfig cause with kernel 2.4 it works but with kernel 2.6 it doesnt.

----------

## Guni P

i tried to build agpgart in the kernel but still no luck.

Anyone any ideas?

----------

## didl

For radeon cards you can try to get direct rendering work by 

(assumning apggart + DRI support is compiled into your kernel)

```

export MESA_FORCE_SSE=1

```

preferably by putting it into /etc/profile.

Works fine for my RADEON 7500.

BTW: This is a bug in xfree AFAIK

----------

## Guni P

 *didl wrote:*   

> For radeon cards you can try to get direct rendering work by 
> 
> (assumning apggart + DRI support is compiled into your kernel)
> 
> ```
> ...

 

Still doesn't work  :Sad: 

----------

## gorjusborg

I am having the same problem with my setup...

I have VIA agpgart support compiled into the kernel, along with DRM and the Radeon DRI driver. 

I have tried recompiling the Radeon driver as a module... doesn't really work... the module gets loaded, along with agpgart, but direct rendering is still NO-GO..

This used to Just Work with the 2.4 kernels.

Sometimes.......... I just get tired of debugging...

----------

## renumerator42

Did any of you get an answer to this?  I am having exactly the same problem

from dmesg:

[drm] Initialized radeon 1.9.0 20020828 on minor 0

[drm:radeon_cp_init] *ERROR* radeon_cp_init called without lock held

[drm:radeon_unlock] *ERROR* Process 3556 using kernel context 0

----------

## angagon

Don't know if this helps, but when I was trying to emerge xfree-drm onto the 2.6.0 kernel I got a

```
!!! ERROR: x11-base/xfree-drm-4.3.0-r6 failed.

!!! Function src_unpack, Line 88, Exitcode 0

!!! Please link /usr/src/linux to 2.4 kernel sources. xfree-drm is not yet working with 2.6 kernels, use the DRM in the kernel.
```

----------

## pontifikas

I just upgraded to 2.6 kernel.And I have DRI warking perfectly.

I have an ATI Radeon 9100

-First unmerge xfree-drm.It doesn't work for 2.6 kernels.

-Then go to kernel configuration and :

Device Drivers->Character Devices

     And select as built in the following:

     <*> Enhanced Real Time Clock Support

     <*> /dev/agpgart (AGP Support)

     <*>   VIA chipset support(!!!!!!!!!THIS IS MY CHIP.YOU CHOOSE YOUR OWN!!!!!)

      [*] Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

Do NOT choose your cards type!!The choises after DRI should remain unchecked!!

The driver will take care of this.

Additionally The above may be working as modules but I 'm not sure.

-save kernel configuratio.

-make bzImage

-Remember to emerge "module-init-tools" to upgrade your systems module handling(skip this step if you have already done so)

-make modules modules_install

-Download and install the appropriate driver for your card(Mine is "ati-driver")

Remember to add the following line to your make.conf:

```
VIDEO_CARDS="radeon"
```

(use your driver type instead of radeon)

NOTE:A frind of mine told me to add the following to my USE variable otherwise the X whould crash:

```
-xinerama
```

I dont know if it is necessary but the system did not complain and works perfectly.

-Run the X configuration tool of your driver(mine is fglrxconfig)

-Follow the Direct Rendering Guide in the documentation of Gentoo in order to check the further needed changes in XF86Config.

-Add your driver's module name in the /etc/modules.autoload.d/kernel-2.6 so it can be loaded at boot time.

-reboot

I hope I've been of help.

----------

