5 #include "pipe/p_compiler.h"
11 #define DRM_API_HANDLE_TYPE_SHARED 0
12 #define DRM_API_HANDLE_TYPE_KMS 1
13 #define DRM_API_HANDLE_TYPE_FD 2
17 * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
22 * Input for texture_from_handle, valid values are
23 * DRM_API_HANDLE_TYPE_SHARED or DRM_API_HANDLE_TYPE_FD.
24 * Input to texture_get_handle,
25 * to select handle for kms, flink, or prime.
29 * Input for texture_get_handle, allows to export the offset
30 * of a specific layer of an array texture.
34 * Input to texture_from_handle.
35 * Output for texture_get_handle.
39 * Input to texture_from_handle.
40 * Output for texture_get_handle.
44 * Input to texture_from_handle.
45 * Output for texture_get_handle.
53 * Configuration queries.
56 /* How many frames to allow before throttling. Or -1 to indicate any number */
57 DRM_CONF_THROTTLE
, /* DRM_CONF_INT. */
58 /* Can this driver, running on this kernel, import and export dma-buf fds? */
59 DRM_CONF_SHARE_FD
, /* DRM_CONF_BOOL. */
64 * Type of configuration answer
74 * Return value from the configuration function.
77 enum drm_conf_type type
;
86 struct drm_driver_descriptor
89 * Identifying prefix/suffix of the binary, used by the pipe-loader.
94 * Kernel driver name, as accepted by drmOpenByName.
96 const char *driver_name
;
99 * Create a pipe srcreen.
101 * This function does any wrapping of the screen.
102 * For example wrapping trace or rbug debugging drivers around it.
104 struct pipe_screen
* (*create_screen
)(int drm_fd
);
108 * Return a configuration value.
110 * If this function is NULL, or if it returns NULL
111 * the state tracker- or state
112 * tracker manager should provide a reasonable default value.
114 const struct drm_conf_ret
*(*configuration
) (enum drm_conf conf
);
117 extern struct drm_driver_descriptor driver_descriptor
;
120 * Instantiate a drm_driver_descriptor struct.
122 #define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func, conf) \
123 struct drm_driver_descriptor driver_descriptor = { \
125 .driver_name = driver_name_str, \
126 .create_screen = func, \
127 .configuration = (conf), \