Kristian Høgsberg | 1b064cc | 2009-11-20 17:08:28 -0500 | [diff] [blame] | 1 | libdrm - userspace library for drm |
Eric Engestrom | 403f3c9 | 2018-11-07 16:15:32 +0000 | [diff] [blame] | 2 | ---------------------------------- |
Adam Jackson | 07d23f9 | 2005-07-10 22:42:42 +0000 | [diff] [blame] | 3 | |
Eric Engestrom | 403f3c9 | 2018-11-07 16:15:32 +0000 | [diff] [blame] | 4 | This is libdrm, a userspace library for accessing the DRM, direct rendering |
| 5 | manager, on Linux, BSD and other operating systems that support the ioctl |
| 6 | interface. |
| 7 | The library provides wrapper functions for the ioctls to avoid exposing the |
| 8 | kernel interface directly, and for chipsets with drm memory manager, support |
| 9 | for tracking relocations and buffers. |
| 10 | New functionality in the kernel DRM drivers typically requires a new libdrm, |
| 11 | but a new libdrm will always work with an older kernel. |
| 12 | |
| 13 | libdrm is a low-level library, typically used by graphics drivers such as |
| 14 | the Mesa drivers, the X drivers, libva and similar projects. |
Brian | 5c8561a | 2007-04-25 14:52:29 -0600 | [diff] [blame] | 15 | |
Marius Vlad | 5d97031 | 2021-02-11 13:08:05 +0200 | [diff] [blame] | 16 | Syncing with the Linux kernel headers |
| 17 | ------------------------------------- |
| 18 | |
| 19 | The library should be regularly updated to match the recent changes in the |
| 20 | `include/uapi/drm/`. |
| 21 | |
| 22 | libdrm maintains a human-readable version for the token format modifier, with |
| 23 | the simpler ones being extracted automatically from `drm_fourcc.h` header file |
| 24 | with the help of a python script. This might not always possible, as some of |
| 25 | the vendors require decoding/extracting them programmatically. For that |
| 26 | reason one can enhance the current vendor functions to include/provide the |
| 27 | newly added token formats, or, in case there's no such decoding |
| 28 | function, to add one that performs the tasks of extracting them. |
| 29 | |
| 30 | For simpler format modifier tokens there's a script (gen_table_fourcc.py) that |
| 31 | creates a static table, by going over `drm_fourcc.h` header file. The script |
| 32 | could be further modified if it can't handle new (simpler) token format |
| 33 | modifiers instead of the generated static table. |
Brian | 5c8561a | 2007-04-25 14:52:29 -0600 | [diff] [blame] | 34 | |
| 35 | Compiling |
| 36 | --------- |
| 37 | |
Eric Engestrom | fc93365 | 2019-10-18 18:05:45 +0100 | [diff] [blame] | 38 | To set up meson: |
Dylan Baker | fd9bcb7 | 2017-12-15 14:40:29 -0800 | [diff] [blame] | 39 | |
| 40 | meson builddir/ |
| 41 | |
| 42 | By default this will install into /usr/local, you can change your prefix |
| 43 | with --prefix=/usr (or `meson configure builddir/ -Dprefix=/usr` after |
| 44 | the initial meson setup). |
| 45 | |
| 46 | Then use ninja to build and install: |
| 47 | |
| 48 | ninja -C builddir/ install |
| 49 | |
| 50 | If you are installing into a system location you will need to run install |
| 51 | separately, and as root. |