xref: /gfx-drm/README (revision 249186c6)
16132907eSGordon Ross
216217fa2SGordon RossThis is the "graphics/DRM" gate, in which we build the
316217fa2SGordon RossDRM kernel modules and related DRM libraries.
416217fa2SGordon Ross
516217fa2SGordon Ross
616217fa2SGordon RossIntroduction:
716217fa2SGordon Ross
816217fa2SGordon RossDRM stands for Direct Rendering Manager, which is a collection of
916217fa2SGordon Rosskernel modules and libraries that allow programs like the Xorg
1016217fa2SGordon Rossserver to operate hardware-accelerated graphics cards.  This
1116217fa2SGordon Rosssoftware currently supports Intel (R) integrated graphics devices
1216217fa2SGordon Rosswith hardware acceleration, video memory management, Graphics
1316217fa2SGordon RossExecution Manager (GEM), and kernel modesetting (KMS).
1416217fa2SGordon Ross
1516217fa2SGordon Ross
1616217fa2SGordon RossHow to build:
1716217fa2SGordon Ross
1816217fa2SGordon RossClone this repo. onto an OpenIndiana or similar build system
1916217fa2SGordon Rosswith the "build-essential" packages installed, then:
2016217fa2SGordon Ross	cd (top of clone)
21b6448328SGordon Ross	make install
22b6448328SGordon Ross	make package
236132907eSGordon Ross
246132907eSGordon Ross
2516217fa2SGordon RossOverview:
2616217fa2SGordon Ross
2716217fa2SGordon RossThe major kernel components are:
2816217fa2SGordon Ross
2916217fa2SGordon Ross	usr/src/uts/intel/io/i915	i915 driver
3016217fa2SGordon Ross	usr/src/uts/common/io/drm/	DRM "misc" support
3116217fa2SGordon Ross	usr/src/uts/intel/io/agpmaster	AGP master support
3216217fa2SGordon Ross	usr/src/uts/intel/io/agpgart	AGP GART, AGP target
3316217fa2SGordon Ross
3416217fa2SGordon Ross	Dependendencies:
3516217fa2SGordon Ross		i915 -> drm
3616217fa2SGordon Ross		drm -> agpmaster, gfx_private
3716217fa2SGordon Ross
3816217fa2SGordon RossThe user-level libraries are:
3916217fa2SGordon Ross
4016217fa2SGordon Ross	usr/src/lib/libdrm/		DRM driver
4116217fa2SGordon Ross	usr/src/lib/libdrm_*		H/W-specific DRM support
4216217fa2SGordon Ross	usr/src/lib/libkms		Kernel Mode Setting support
4316217fa2SGordon Ross
4416217fa2SGordon RossNote that the source for those libraries is EXTERNAL, and
4516217fa2SGordon RossNOT checked into this gate.  At build time, the library
4616217fa2SGordon Rosssources are downloaded from:
4716217fa2SGordon Ross	http://dri.freedesktop.org/libdrm/
4816217fa2SGordon Rossand then unpacked and patched under:
4916217fa2SGordon Ross	usr/src/common/libdrm/
5016217fa2SGordon Ross
5116217fa2SGordon RossThat makes this gate a little unusual, sort of a "hybrid"
5216217fa2SGordon Rossbetween how illumos-gate does things and how the "userland"
5316217fa2SGordon Rossgate does things.  There are good reasons for this.
5416217fa2SGordon Ross
5516217fa2SGordon RossThe kernel code is very much operaging-system-specific,
5616217fa2SGordon Rossand therefore can not simply track some "upstream" like
5716217fa2SGordon Rossthe user-level library code can.  It's also a little
5816217fa2SGordon Rosstricky to build kernel code "correctly", which is why
5916217fa2SGordon Rossthe kernel build parts of this gate are based on the
6016217fa2SGordon Ross"ON skeleton" gate:  https://github.com/gwr/on-skel
6116217fa2SGordon Ross
6216217fa2SGordon RossThe user-level libraries here are built with minimal
6316217fa2SGordon Rosschanges relatative to the upstream, and therefore can
6416217fa2SGordon Rossuse a strategy similar to that in the "userland" gate:
6516217fa2SGordon Ross	https://github.com/OpenIndiana/oi-userland
6616217fa2SGordon Ross
6716217fa2SGordon Ross
6816217fa2SGordon RossDevelopment and testing:
696132907eSGordon Ross
7016217fa2SGordon RossIf you find you need to make changes to library code
7116217fa2SGordon Ross(such as when updating to a new version) the easiest
7216217fa2SGordon Rossway is to save a copy of the unpacked library source
7316217fa2SGordon Rossbefore patching (use "make unpack"), then go ahead
7416217fa2SGordon Rossand edit files as needed, and once you're happy with
7516217fa2SGordon Rossthe changes use "diff -u saved-lib edited-lib" to
7616217fa2SGordon Rossupdate the files in the patches directory.  Use:
7716217fa2SGordon Ross  usr/src/common/libdrm/Check-patches
7816217fa2SGordon Rossto check that your patches are in sync with edits.
796132907eSGordon Ross
8016217fa2SGordon RossWhen doing incremental work in the gate, i.e. fixing
8116217fa2SGordon Rosscompilation errors, it's handy to run an editor in a
8216217fa2SGordon Ross"bldenv" environment, as follows:
83*249186c6SAlexander Pyhalov	ksh93 tools/bldenv -d myenv.sh
846132907eSGordon Ross
8516217fa2SGordon RossThat gets you a new shell, in which you can run an
8616217fa2SGordon Rossemacs if you like "meta-x compile", or whatever.
8716217fa2SGordon RossJust cd to where the top-level make had problems
8816217fa2SGordon Rossand run make.  Then fix bugs, open pull requests.
8963be7eaeSAdam Števko
9016217fa2SGordon RossPlease run the tests before submitting pull requests.
9116217fa2SGordon RossThey're installed as /opt/drm-test/*
92