# How to apply GEM/KMS/DRI for dummies



## Pantu (Jul 7, 2011)

Hi,

Could someone please explain how to do the patching from: http://wiki.freebsd.org/Intel_GPU
so that a beginner can understand it.

What are the WIP patches for and what is the Patch version 3.1 for? Do I need both or just Version 3.1?


----------



## SirDice (Jul 7, 2011)

Those patches aren't for beginners.

Hopefully they'll find their way in the various future releases once they've been tested thoroughly.

NB. WIP = Work In Progress.


----------



## Pantu (Jul 7, 2011)

I got most of the stuff done from Patch version 3.1 (against r223823), but If I start Xorg, it tells me that this "Linux Kernel XXX" is not supported, so I guess I have to do this http://people.freebsd.org/~kib/drm/all.3.2.patch for the kernel source. But whenever I try to apply this, it asks me for the files to patch and does it not automatically.

Please dont tell me it is too advanced, it wouldn't be fair. Could anyone just provide some help on the kernel patch?


----------



## SirDice (Jul 7, 2011)

Those patches are against HEAD aka -CURRENT aka 9.0.



> As you read this, keep in mind that FreeBSD-CURRENT is the â€œbleeding edgeâ€ of FreeBSD development. FreeBSD-CURRENT users are expected to have a high degree of technical skill, and should be capable of solving difficult system problems on their own. If you are new to FreeBSD, think twice before installing it.



http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html


----------



## Pantu (Jul 7, 2011)

9-CURRENT is running here, my problem is how to apply the patch to the kernel sources.


----------



## wblock@ (Jul 7, 2011)

Please show what you are doing and the output.  This might be useful.


----------



## Pantu (Jul 7, 2011)

Hi wblock, thanks for the reply.
Right now I don't have my FreeBSD at hand. But I still know from memory.


I want to apply the all.3.3.patch (from http://people.freebsd.org/~kib/drm/) to my kernel sources, so that my kernel supports all the fun as well.


```
patch < all.3.3.patch
...
```
It then asks me which file to patch. Normally I just invoke the patch command and it is done without me interacting with it. So maybe there is some special parameter I have to add to the patch command?


----------



## wblock@ (Jul 7, 2011)

`# patch -p1 -d /usr/src < all.3.3.patch`

Be forewarned that there's a lot more to it than just the kernel patches.  Take notes as you go, because it'll probably take several tries.

Don't do this on a system that needs to be available for normal use.


----------



## Pantu (Jul 7, 2011)

@wblock:
Thanks a lot for the info!!

Can you tell me what you mean by "there's a lot more to it than just the kernel patches"
Do you mean those?:

```
[*]dri2proto

[*]libdrm

[*]intel ddx driver

[*]Mesa
```
I have done them already. Or do you mean something else?


----------



## graudeejs (Jul 7, 2011)

> How to apply GEM/KMS/DRI for dummies


Dummies shouldn't do that.
_Sorry I couldn't resist _


----------



## Pantu (Jul 7, 2011)

very mature comment! Apart from that think about it this way: "dummies" definitely should do it, otherwise they stay dumb. 

Anyway, instead of just posting some personal views, you could also help on this one ;-)


----------



## graudeejs (Jul 7, 2011)

(What, no humour?)

Anyway I can't help you there, I don't have any Intel graphics card & can't test anything I could say (not that I can).


----------



## wblock@ (Jul 7, 2011)

Pantu said:
			
		

> @wblock:
> Thanks a lot for the info!!
> 
> Can you tell me what you mean by "there's a lot more to it than just the kernel patches"
> ...



Yes.  The nice way would be to make new ports for those.  Maybe even trivial for at least the first two.


----------



## Pantu (Jul 7, 2011)

@wblock:
Those 4 parts are the easiest one. it's straightforward (@killasmurf86: even for dummies)
Applying the kernel patch was tough.


----------

