f0fcdd834dd5cace6f5b78cf8f8149b00a8b48b9
[mesa.git] / src / gallium / targets / dri-nouveau / target.c
1
2 #include "target-helpers/inline_debug_helper.h"
3 #include "state_tracker/drm_driver.h"
4 #include "nouveau/drm/nouveau_drm_public.h"
5
6 static struct pipe_screen *
7 create_screen(int fd)
8 {
9 struct pipe_screen *screen;
10
11 screen = nouveau_drm_screen_create(fd);
12 if (!screen)
13 return NULL;
14
15 screen = debug_screen_wrap(screen);
16
17 return screen;
18 }
19
20 static const struct drm_conf_ret share_fd_ret = {
21 .type = DRM_CONF_BOOL,
22 .val.val_int = true,
23 };
24
25 static const struct drm_conf_ret *drm_configuration(enum drm_conf conf)
26 {
27 switch (conf) {
28 case DRM_CONF_SHARE_FD:
29 return &share_fd_ret;
30 default:
31 break;
32 }
33 return NULL;
34 }
35
36 DRM_DRIVER_DESCRIPTOR("nouveau", "nouveau", create_screen, drm_configuration)