# How can I get direct rendering on FreeBSD 7.1 AMD64?



## randux (Jan 13, 2009)

Hi, I tried the usual trick of adding the DRI section in xorg.conf but I still get errors. I built dri on my i386 install from ports/graphics but it didn't help.


----------



## kamikaze (Jan 13, 2009)

A little more information is necessary here. Let's start with the contents of /var/log/Xorg.0.log.


----------



## randux (Jan 13, 2009)

I can't edit my reply or post the log. I keep getting this message:


Method Not Implemented

POST to /newreply.php not supported.
Apache/2.2.x (FreeBSD) Server at forums.freebsd.org Port 80


----------



## randux (Jan 13, 2009)

apparently there is some very low limit. I can't post the log or attach it....


----------



## kamikaze (Jan 13, 2009)

How can it be, that you cannot post the log, if you _can_ post?

Just copy and paste it into a 
	
	



```
Block.
```


----------



## randux (Jan 13, 2009)

because of a stupid size limit in the forum


----------



## kamikaze (Jan 13, 2009)

Ah, I see. Post it to http://nopaste.bsdforen.de and share the link here.


----------



## randux (Jan 13, 2009)

Ok, please see here http://randux.pastebin.com/m1d5ffe77


----------



## adamk (Jan 13, 2009)

This would be the primary problem:


```
[drm] failed to load kernel module "i915"
```

What's the output of 'kldstat', 'dmesg | grep drm' and 'ls -l /boot/kernel/i915.*' ?

Adam


----------



## randux (Jan 13, 2009)

kldstat is attached above, i915 and drm are both loaded.


```
-r-xr-xr-x  1 root  wheel   35592 Jan  1 09:01 /boot/kernel/i915.ko
-r-xr-xr-x  1 root  wheel  348368 Jan  1 09:01 /boot/kernel/i915.ko.symbols
```

and nothing from dmesg | grep drm


----------



## kamikaze (Jan 13, 2009)

Apparently drm does not support your model. It might be a simple matter of adding your device ID to the kernel.

`# pciconf -lv|grep vgapci` should show you the device ID. Then we can check weather it is listed in src/sys/dev/drm/drm_pciids.h. If not we should create a patch and if you test it successfully, write a PR to get this into the base system.

I had to do the same thing for my video card and I was told what to do by someone else who had once faced this problem.


----------



## randux (Jan 13, 2009)

here is the output of pciconf:


```
vgapci0@pci0:0:2:0:	class=0x030000 card=0x73831462 chip=0x29c28086 rev=0x10 hdr=0x00
vgapci1@pci0:0:2:1:	class=0x038000 card=0x73831462 chip=0x29c38086 rev=0x10 hdr=0x00
```

I am going over to the source file to check it now. Thanks very much.


----------



## randux (Jan 13, 2009)

What should I be looking for in the header file?


----------



## adamk (Jan 13, 2009)

It's not liste...  See all the chips listed in the i915_PCI_IDS define?  Your (0x29C2) isn't there.

It is, however, in the DRM tree in freedesktop git.  You could give that a whirl.

You would need to have /usr/ports/devel/git installed, and then you can clone the repo with:

$ git clone git://anongit.freedesktop.org/git/mesa/drm

You may be able to get away with just:

$ cd drm/bsd-core
$ make
$ sudo make install

If it fails to build the modules, though, you might need to install libdrm in the previous directory (just drm).

Adam


----------



## richardpl (Jan 13, 2009)

randux said:
			
		

> here is the output of pciconf:
> 
> 
> ```
> ...



I think this is known problem which have been properly addressed on 7 STABLE.


----------



## adamk (Jan 14, 2009)

richardpl said:
			
		

> I think this is known problem which have been properly addressed on 7 STABLE.



I don't think so.  I'm running 7.1-RELEASE-p1 and that PCI ID (0x29C2) is not in drm_pciids.h

Maybe -CURRENT?

Adam


----------



## richardpl (Jan 14, 2009)

Recent 7 STABLE (it is different from 7.1-RELEASE) have drm in sync with CURRENT.


```
#define IS_G33(dev)    ((dev)->pci_device == 0x29C2 ||  \
                        (dev)->pci_device == 0x29B2 ||  \
                        (dev)->pci_device == 0x29D2)
```


----------



## adamk (Jan 14, 2009)

Ahhh, sorry.  Thanks for the correction.

Adam


----------



## randux (Jan 14, 2009)

Thank you richardpl. Can I just change the code and do the 

$ cd drm/bsd-core
$ make
$ sudo make install

that adamk suggests?


----------



## kamikaze (Jan 14, 2009)

Yes, should work.


----------



## randux (Jan 14, 2009)

Sorry guys for the dumb questions. It's my first time doing anything on BSD source.

I am supposed to add the #define to i915_drv.h correct?

And then I can't find the directory richardpl told me to change to. Is it already supposed to be here or do I need to use git. I didn't understand from your comment.

Thanks.


----------



## kamikaze (Jan 14, 2009)

Well, it seems that it's already listed in 7-Stable. Maybe you should just csup RELENG_7 sources and give that a try:

```
# cd /usr/src/sys/modules/drm
# make
# make install clean
```

You probably need to reboot afterwards.


----------



## randux (Jan 14, 2009)

What kind of likelihood to break my system by syncing to releng and rebuilding? If it's not too likely, I will try it. Thanks for your help.


----------



## randux (Jan 14, 2009)

I recompiled after changing the header and it searches more cards in dev (/dev/card0, /dev/card1, /dev/cardn ...) but still doesn't work.

I guess I will try pulling down the RELENG_7 source if I can find out how to do that from the FreeBSD handbook and see what happens.

Thanks.


----------

