df93c94ea832837fb5be7826459c9195cbaaebf7
[mesa.git] / src / gallium / targets / dri / target.c
1 #include "target-helpers/drm_helper.h"
2 #include "target-helpers/sw_helper.h"
3
4 #include "dri_screen.h"
5
6 #define DEFINE_LOADER_DRM_ENTRYPOINT(drivername) \
7 const __DRIextension **__driDriverGetExtensions_##drivername(void); \
8 PUBLIC const __DRIextension **__driDriverGetExtensions_##drivername(void) \
9 { \
10 globalDriverAPI = &galliumdrm_driver_api; \
11 return galliumdrm_driver_extensions; \
12 }
13
14 #if defined(GALLIUM_SOFTPIPE)
15
16 const __DRIextension **__driDriverGetExtensions_swrast(void);
17
18 PUBLIC const __DRIextension **__driDriverGetExtensions_swrast(void)
19 {
20 globalDriverAPI = &galliumsw_driver_api;
21 return galliumsw_driver_extensions;
22 }
23
24 #if defined(HAVE_LIBDRM)
25
26 const __DRIextension **__driDriverGetExtensions_kms_swrast(void);
27
28 PUBLIC const __DRIextension **__driDriverGetExtensions_kms_swrast(void)
29 {
30 globalDriverAPI = &dri_kms_driver_api;
31 return galliumdrm_driver_extensions;
32 }
33
34 #endif
35 #endif
36
37 #if defined(GALLIUM_I915)
38 DEFINE_LOADER_DRM_ENTRYPOINT(i915)
39 #endif
40
41 #if defined(GALLIUM_ILO)
42 DEFINE_LOADER_DRM_ENTRYPOINT(i965)
43 #endif
44
45 #if defined(GALLIUM_NOUVEAU)
46 DEFINE_LOADER_DRM_ENTRYPOINT(nouveau)
47 #endif
48
49 #if defined(GALLIUM_R300)
50 DEFINE_LOADER_DRM_ENTRYPOINT(r300)
51 #endif
52
53 #if defined(GALLIUM_R600)
54 DEFINE_LOADER_DRM_ENTRYPOINT(r600)
55 #endif
56
57 #if defined(GALLIUM_RADEONSI)
58 DEFINE_LOADER_DRM_ENTRYPOINT(radeonsi)
59 #endif
60
61 #if defined(GALLIUM_VMWGFX)
62 DEFINE_LOADER_DRM_ENTRYPOINT(vmwgfx)
63 #endif
64
65 #if defined(GALLIUM_FREEDRENO)
66 DEFINE_LOADER_DRM_ENTRYPOINT(msm)
67 DEFINE_LOADER_DRM_ENTRYPOINT(kgsl)
68 #endif
69
70 #if defined(GALLIUM_VIRGL)
71 DEFINE_LOADER_DRM_ENTRYPOINT(virtio_gpu)
72 #endif
73
74 #if defined(GALLIUM_VC4)
75 DEFINE_LOADER_DRM_ENTRYPOINT(vc4)
76
77 #if defined(USE_VC4_SIMULATOR)
78 /**
79 * When building using the simulator (on x86), we advertise ourselves as the
80 * i965 driver so that you can just make a directory with a link from
81 * i965_dri.so to the built vc4_dri.so, and point LIBGL_DRIVERS_PATH to that
82 * on your i965-using host to run the driver under simulation.
83 */
84 DEFINE_LOADER_DRM_ENTRYPOINT(i965)
85 #endif
86 #endif
87
88 #if defined(GALLIUM_ETNAVIV)
89 DEFINE_LOADER_DRM_ENTRYPOINT(imx_drm)
90 DEFINE_LOADER_DRM_ENTRYPOINT(etnaviv)
91 #endif