so it goes like this

user
|
xserver
|
mesa
|
gallium3d - which is just a framework
|
kernel