xref: /aosp_15_r20/external/mesa3d/src/gallium/include/frontend/drm_driver.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 
2 #ifndef _DRM_DRIVER_H_
3 #define _DRM_DRIVER_H_
4 
5 #include "util/compiler.h"
6 
7 #include "winsys_handle.h"
8 
9 struct pipe_screen;
10 struct pipe_screen_config;
11 struct pipe_context;
12 struct pipe_resource;
13 struct virgl_renderer_capset_drm;
14 
15 struct drm_driver_descriptor
16 {
17    /**
18     * Identifying prefix/suffix of the binary, used by the pipe-loader.
19     */
20    const char *driver_name;
21 
22    /**
23     * Optional pointer to the array of driOptionDescription describing
24     * driver-specific driconf options.
25     */
26    const struct driOptionDescription *driconf;
27 
28    /* Number of entries in the driconf array. */
29    unsigned driconf_count;
30 
31    /**
32     * Create a pipe srcreen.
33     *
34     * This function does any wrapping of the screen.
35     * For example wrapping trace or rbug debugging drivers around it.
36     */
37    struct pipe_screen* (*create_screen)(int drm_fd,
38                                         const struct pipe_screen_config *config);
39 
40    /**
41     * Optional hook to probe for driver support for virtgpu native-context
42     * support.
43     */
44    bool (*probe_nctx)(int drm_fd, const struct virgl_renderer_capset_drm *caps);
45 };
46 
47 extern const struct drm_driver_descriptor driver_descriptor;
48 
49 #endif
50