Subject: Compilation of DRMs fails
To: None <tech-x11@netbsd.org>
From: Hernani Marques Madeira <hmm@tuners.ch>
List: tech-x11
Date: 07/27/2003 20:58:55
Hello Folks!

I'm trying to get 3D-acceleration working on NetBSD, via DRI on XFree86 4.3.0. 
I've a Radeon Mobility M7 (Modell: 7500) graphics chip on my lap and it would 
be nice to have the GL things accelerated, cause i've plans to code something 
in this direction - and i want to code and to see it working natively on 
NetBSD.
Okay, i'm using the -current branch of NetBSD and noticed some time ago that 
the DRM (direct rendering modules for use with the DRI framework provided by 
XFree86 4.x) implementation (i think mainly maintained and developed by Eric 
Anholt) for NetBSD has now been included into the xsrc tree.
And so i tried to compile the LKM-version of these modules with no success, 
here what i did:

 i jumped into 
xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel 
and invoked a `make -f Makefile.bsd`, after compiling XFree86 4.3.0 how it's 
explained here: 
http://groups.google.ch/groups?q=DRI+Netbsd&hl=de&lr=&ie=UTF-8&oe=UTF-8&as_drrb=b&as_mind=1&as_minm=3&as_miny=2003&as_maxd=27&as_maxm=7&as_maxy=2003&selm=beksj2%241f68%241%40FreeBSD.csie.NCTU.edu.tw&rnum=9

Yes, i also read this post:
http://mail-index.netbsd.org/tech-x11/2003/03/19/0000.html

The errors i get are of following type:

/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../mga_drv.c:32: 
sys/types.h: No such file or directory
In file included from 
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drmP.h:75,
                 from 
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../mga_drv.c:35:
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:1: 
sys/param.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:2: 
sys/queue.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:3: 
sys/malloc.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:4: 
sys/kernel.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:5: 
sys/systm.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:6: 
sys/conf.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:7: 
sys/stat.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:8: 
sys/proc.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:9: 
sys/lock.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:10: 
sys/fcntl.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:11: 
sys/uio.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:12: 
sys/filio.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:13: 
sys/sysctl.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:14: 
sys/select.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:15: 
sys/device.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:16: 
sys/mman.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:17: 
uvm/uvm.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:18: 
sys/vnode.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:19: 
sys/poll.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:21: 
sys/ttycom.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:23: 
uvm/uvm.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:25: 
machine/pmap.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:26: 
machine/bus.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:27: 
sys/resourcevar.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:28: 
machine/sysarch.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:29: 
machine/mtrr.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:31: 
dev/pci/pcireg.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:32: 
dev/pci/pcivar.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:34: 
drmvar.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:42: 
dev/pci/agpvar.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm_os_netbsd.h:43: 
sys/agpio.h: No such file or directory
In file included from 
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drmP.h:78,
                 from 
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../mga_drv.c:35:
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../drm.h:54: 
sys/ioccom.h: No such file or directory
/usr/src.current/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/mga/../mga_drv.c:37: 
mga_drm.h: No such file or directory

A lot of header files, including but not limited to elementar includes of the 
system that are not found. The last line for e.g. show the file mga_drm.h 
which is not found in the drm tree because it effectively does not exist 
there. The same thing for the r128, radeon and tdfx drivers, with .h files 
for these specific chipsets that are not found because they aren't present 
there.
But, i then noticed that in
xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel
one can find practically all missed chipset-specific files, including .c 
files. I tried copying them into the other directory, modified a little bit 
the Makefiles so that the system includes have also been found and tried 
again to compile the thing, but ... it failed again, because there is one 
file i could not found on the whole system, that one called "drmvar.h".

Any suggestions?

Thank you for any help!

Hernani Marques Madeira