mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 04:40:09 +01:00
read-only mirror of https://gitlab.freedesktop.org/mesa/drm
Whenever `util_open()` is called to open a device for the first matching module, it will skip devices for the `nvidia_drm` kernel module which is not in the list. We could add this module for now, but keeping this list of DRM modules up to date is cumbersome. At the same time walking a list of modules and calling `drmOpen()` for each of them is incredibly expensive (when the user doesn't explicitly specify one with `-M`), as each each call opens every DRM node just to see if they are associated to the requested module. And for no good reason: all we want is the first `DRM_NODE_PRIMARY` (which is what `drmOpen()` also returns) to use by default. For example on the `"msm"` driver, which used to be the 9th in the modules list, all nodes are opened for the 9th time before e.g. `modetest` returns a useful result, which takes ages unless the user painstakingly provides the module for the currently known device on the cmdline. This is very simply solved by calling `drmGetDevices(2)()`, which iterates through all DRM nodes only once and allows us to immediately find + `open()` the first device that has a PRIMARY node. A random search for the error shows that this was also attempted in (a fork of?) kmscube: https://git.ti.com/cgit/glsdk/kmscube/commit/?id=456cabc661caac5c60729751d45efd668faa8e97 Finally we add a `drmIsKMS()` check to make sure we only include primary nodes that actually support rendering, and also print the values from `drmGetVersion()` on success to make it easier to identify the device. In the future we could extrapolate this feature by letting query commands like `modetest -c` list connectors for every device/module, not just the first PRIMARY node that we found. |
||
|---|---|---|
| amdgpu | ||
| android | ||
| data | ||
| etnaviv | ||
| exynos | ||
| freedreno | ||
| include/drm | ||
| intel | ||
| man | ||
| nouveau | ||
| omap | ||
| radeon | ||
| tegra | ||
| tests | ||
| vc4 | ||
| .editorconfig | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| Android.bp | ||
| Android.sources.bp | ||
| Android.sources.bp.mk | ||
| CleanSpec.mk | ||
| CONTRIBUTING.rst | ||
| core-symbols.txt | ||
| gen_table_fourcc.py | ||
| libdrm.pc.in | ||
| libdrm_lists.h | ||
| libdrm_macros.h | ||
| libsync.h | ||
| meson.build | ||
| meson_options.txt | ||
| README.rst | ||
| RELEASING | ||
| symbols-check.py | ||
| util_double_list.h | ||
| util_math.h | ||
| xf86atomic.h | ||
| xf86drm.c | ||
| xf86drm.h | ||
| xf86drmHash.c | ||
| xf86drmHash.h | ||
| xf86drmMode.c | ||
| xf86drmMode.h | ||
| xf86drmRandom.c | ||
| xf86drmRandom.h | ||
| xf86drmSL.c | ||
libdrm - userspace library for drm
----------------------------------
This is libdrm, a userspace library for accessing the DRM, direct rendering
manager, on Linux, BSD and other operating systems that support the ioctl
interface.
The library provides wrapper functions for the ioctls to avoid exposing the
kernel interface directly, and for chipsets with drm memory manager, support
for tracking relocations and buffers.
New functionality in the kernel DRM drivers typically requires a new libdrm,
but a new libdrm will always work with an older kernel.
libdrm is a low-level library, typically used by graphics drivers such as
the Mesa drivers, the X drivers, libva and similar projects.
Syncing with the Linux kernel headers
-------------------------------------
The library should be regularly updated to match the recent changes in the
`include/uapi/drm/`.
libdrm maintains a human-readable version for the token format modifier, with
the simpler ones being extracted automatically from `drm_fourcc.h` header file
with the help of a python script. This might not always possible, as some of
the vendors require decoding/extracting them programmatically. For that
reason one can enhance the current vendor functions to include/provide the
newly added token formats, or, in case there's no such decoding
function, to add one that performs the tasks of extracting them.
For simpler format modifier tokens there's a script (gen_table_fourcc.py) that
creates a static table, by going over `drm_fourcc.h` header file. The script
could be further modified if it can't handle new (simpler) token format
modifiers instead of the generated static table.
Compiling
---------
To set up meson:
meson builddir/
By default this will install into /usr/local, you can change your prefix
with --prefix=/usr (or `meson configure builddir/ -Dprefix=/usr` after
the initial meson setup).
Then use ninja to build and install:
ninja -C builddir/ install
If you are installing into a system location you will need to run install
separately, and as root.