19bd392adSmrglibdrm - userspace library for drm
29bd392adSmrg----------------------------------
39bd392adSmrg
49bd392adSmrgThis is libdrm, a userspace library for accessing the DRM, direct rendering
59bd392adSmrgmanager, on Linux, BSD and other operating systems that support the ioctl
69bd392adSmrginterface.
79bd392adSmrgThe library provides wrapper functions for the ioctls to avoid exposing the
89bd392adSmrgkernel interface directly, and for chipsets with drm memory manager, support
99bd392adSmrgfor tracking relocations and buffers.
109bd392adSmrgNew functionality in the kernel DRM drivers typically requires a new libdrm,
119bd392adSmrgbut a new libdrm will always work with an older kernel.
129bd392adSmrg
139bd392adSmrglibdrm is a low-level library, typically used by graphics drivers such as
149bd392adSmrgthe Mesa drivers, the X drivers, libva and similar projects.
159bd392adSmrg
164babd585SmrgSyncing with the Linux kernel headers
174babd585Smrg-------------------------------------
184babd585Smrg
194babd585SmrgThe library should be regularly updated to match the recent changes in the
204babd585Smrg`include/uapi/drm/`.
214babd585Smrg
224babd585Smrglibdrm maintains a human-readable version for the token format modifier, with
234babd585Smrgthe simpler ones being extracted automatically from `drm_fourcc.h` header file
244babd585Smrgwith the help of a python script.  This might not always possible, as some of
254babd585Smrgthe vendors require decoding/extracting them programmatically.  For that
264babd585Smrgreason one can enhance the current vendor functions to include/provide the
274babd585Smrgnewly added token formats, or, in case there's no such decoding
284babd585Smrgfunction, to add one that performs the tasks of extracting them.
294babd585Smrg
304babd585SmrgFor simpler format modifier tokens there's a script (gen_table_fourcc.py) that
314babd585Smrgcreates a static table, by going over `drm_fourcc.h` header file. The script
324babd585Smrgcould be further modified if it can't handle new (simpler) token format
334babd585Smrgmodifiers instead of the generated static table.
349bd392adSmrg
359bd392adSmrgCompiling
369bd392adSmrg---------
379bd392adSmrg
389bd392adSmrgTo set up meson:
399bd392adSmrg
409bd392adSmrg    meson builddir/
419bd392adSmrg
429bd392adSmrgBy default this will install into /usr/local, you can change your prefix
439bd392adSmrgwith --prefix=/usr (or `meson configure builddir/ -Dprefix=/usr` after 
449bd392adSmrgthe initial meson setup).
459bd392adSmrg
469bd392adSmrgThen use ninja to build and install:
479bd392adSmrg
489bd392adSmrg    ninja -C builddir/ install
499bd392adSmrg
509bd392adSmrgIf you are installing into a system location you will need to run install
519bd392adSmrgseparately, and as root.
52