Miscellaneous declarations for Linux.
More...
#include <fcntl.h>
#include <filesystem>
#include <unistd.h>
#include <vector>
#include "src/utility.h"
Go to the source code of this file.
|
|
typedef void(* | dyn::apiproc) (void) |
| | Generic GLX procedure pointer returned by the loader.
|
| |
|
| void * | dyn::handle (const std::vector< const char * > &libs) |
| | Return the native handle owned by the wrapper.
|
| |
| int | dyn::load (void *handle, const std::vector< std::tuple< apiproc *, const char * > > &funcs, bool strict) |
| | Load persisted state from its backing store.
|
| |
| int | platf::open_drm_card_fd (const std::filesystem::path &path, int flags) |
| | Open a DRM card node, dropping implicit DRM master when possible.
|
| |
Miscellaneous declarations for Linux.
◆ window_system_e
Enumerates supported window system options.
| Enumerator |
|---|
| NONE | No window system.
|
| X11 | X11.
|
| WAYLAND | Wayland.
|
◆ handle()
| void * dyn::handle |
( |
const std::vector< const char * > & | libs | ) |
|
Return the native handle owned by the wrapper.
- Parameters
-
| libs | List of libraries to probe for the requested symbol. |
- Returns
- Native dynamic-library handle, or nullptr when no library can be opened.
◆ load()
| int dyn::load |
( |
void * | handle, |
|
|
const std::vector< std::tuple< apiproc *, const char * > > & | funcs, |
|
|
bool | strict = true ) |
Load persisted state from its backing store.
- Parameters
-
| handle | Native library or object handle used by the operation. |
| funcs | Function table populated from the loaded library. |
| strict | Whether missing functions should be treated as an error. |
- Returns
- 0 when all required symbols are loaded; nonzero when loading fails.
◆ open_drm_card_fd()
| int platf::open_drm_card_fd |
( |
const std::filesystem::path & | path, |
|
|
int | flags ) |
Open a DRM card node, dropping implicit DRM master when possible.
Open a DRM card node and drop implicit DRM master, if any.
See misc.h for full documentation. Master check/drop failures are logged as warnings but do not fail the call.
Performs open(path, flags | O_CLOEXEC) and probes the resulting fd with DRM_IOCTL_AUTH_MAGIC. If the kernel implicitly handed us master, calls drmDropMaster and re-verifies before returning. Master check/drop failures are logged as warnings but do not fail the call: the caller still receives a usable fd.
Callers should use this helper for any /dev/dri/cardN open so we never keep implicit master and block compositors from re-acquiring it on VT switches.
- Parameters
-
| path | Path to the DRM card node (e.g. /dev/dri/card0). |
| flags | open() flags. O_CLOEXEC is always OR-ed in. |
- Returns
- A file descriptor on success, or
-1 if open() itself fails.