101e04c3fSmrg#ifndef DRM_HELPER_H
201e04c3fSmrg#define DRM_HELPER_H
301e04c3fSmrg
401e04c3fSmrg#include <stdio.h>
501e04c3fSmrg#include "target-helpers/inline_debug_helper.h"
601e04c3fSmrg#include "target-helpers/drm_helper_public.h"
77ec681f3Smrg#include "frontend/drm_driver.h"
87ec681f3Smrg#include "util/driconf.h"
97ec681f3Smrg
107ec681f3Smrg/**
117ec681f3Smrg * Instantiate a drm_driver_descriptor struct.
127ec681f3Smrg */
137ec681f3Smrg#define DEFINE_DRM_DRIVER_DESCRIPTOR(descriptor_name, driver, _driconf, _driconf_count, func) \
147ec681f3Smrgconst struct drm_driver_descriptor descriptor_name = {         \
157ec681f3Smrg   .driver_name = #driver,                                     \
167ec681f3Smrg   .driconf = _driconf,                                        \
177ec681f3Smrg   .driconf_count = _driconf_count,                            \
187ec681f3Smrg   .create_screen = func,                                      \
197ec681f3Smrg};
207ec681f3Smrg
217ec681f3Smrg/* The static pipe loader refers to the *_driver_descriptor structs for all
227ec681f3Smrg * drivers, regardless of whether they are configured in this Mesa build, or
237ec681f3Smrg * whether they're included in the specific gallium target.  The target (dri,
247ec681f3Smrg * vdpau, etc.) will include this header with the #defines for the specific
257ec681f3Smrg * drivers it's including, and the disabled drivers will have a descriptor
267ec681f3Smrg * with a stub create function logging the failure.
277ec681f3Smrg *
287ec681f3Smrg * The dynamic pipe loader instead has target/pipeloader/pipe_*.c including
297ec681f3Smrg * this header in a pipe_*.so for each driver which will have one driver's
307ec681f3Smrg * GALLIUM_* defined.  We make a single driver_descriptor entrypoint that is
317ec681f3Smrg * dlsym()ed by the dynamic pipe loader.
327ec681f3Smrg */
337ec681f3Smrg
347ec681f3Smrg#ifdef PIPE_LOADER_DYNAMIC
357ec681f3Smrg
367ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR(driver, driconf, driconf_count)           \
377ec681f3Smrg   PUBLIC DEFINE_DRM_DRIVER_DESCRIPTOR(driver_descriptor, driver, driconf, driconf_count, pipe_##driver##_create_screen)
387ec681f3Smrg
397ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR_STUB(driver)
407ec681f3Smrg
417ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR_ALIAS(driver, alias, driconf, driconf_count)
427ec681f3Smrg
437ec681f3Smrg#else
447ec681f3Smrg
457ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR(driver, driconf, driconf_count)                          \
467ec681f3Smrg   DEFINE_DRM_DRIVER_DESCRIPTOR(driver##_driver_descriptor, driver, driconf, driconf_count, pipe_##driver##_create_screen)
477ec681f3Smrg
487ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR_STUB(driver)                              \
497ec681f3Smrg   static struct pipe_screen *                                          \
507ec681f3Smrg   pipe_##driver##_create_screen(int fd, const struct pipe_screen_config *config) \
517ec681f3Smrg   {                                                                    \
527ec681f3Smrg      fprintf(stderr, #driver ": driver missing\n");                    \
537ec681f3Smrg      return NULL;                                                      \
547ec681f3Smrg   }                                                                    \
557ec681f3Smrg   DRM_DRIVER_DESCRIPTOR(driver, NULL, 0)
567ec681f3Smrg
577ec681f3Smrg#define DRM_DRIVER_DESCRIPTOR_ALIAS(driver, alias, driconf, driconf_count) \
587ec681f3Smrg   DEFINE_DRM_DRIVER_DESCRIPTOR(alias##_driver_descriptor, alias, driconf, \
597ec681f3Smrg                                driconf_count, pipe_##driver##_create_screen)
607ec681f3Smrg
617ec681f3Smrg#endif
627ec681f3Smrg
637ec681f3Smrg#ifdef GALLIUM_KMSRO_ONLY
647ec681f3Smrg#undef GALLIUM_V3D
657ec681f3Smrg#undef GALLIUM_VC4
667ec681f3Smrg#undef GALLIUM_FREEDRENO
677ec681f3Smrg#undef GALLIUM_ETNAVIV
687ec681f3Smrg#undef GALLIUM_PANFROST
697ec681f3Smrg#undef GALLIUM_LIMA
707ec681f3Smrg#endif
7101e04c3fSmrg
7201e04c3fSmrg#ifdef GALLIUM_I915
7301e04c3fSmrg#include "i915/drm/i915_drm_public.h"
7401e04c3fSmrg#include "i915/i915_public.h"
7501e04c3fSmrg
767ec681f3Smrgstatic struct pipe_screen *
7701e04c3fSmrgpipe_i915_create_screen(int fd, const struct pipe_screen_config *config)
7801e04c3fSmrg{
7901e04c3fSmrg   struct i915_winsys *iws;
8001e04c3fSmrg   struct pipe_screen *screen;
8101e04c3fSmrg
8201e04c3fSmrg   iws = i915_drm_winsys_create(fd);
8301e04c3fSmrg   if (!iws)
8401e04c3fSmrg      return NULL;
8501e04c3fSmrg
8601e04c3fSmrg   screen = i915_screen_create(iws);
8701e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
8801e04c3fSmrg}
897ec681f3SmrgDRM_DRIVER_DESCRIPTOR(i915, NULL, 0)
9001e04c3fSmrg#else
917ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(i915)
9201e04c3fSmrg#endif
9301e04c3fSmrg
94361fc4cbSmaya#ifdef GALLIUM_IRIS
95361fc4cbSmaya#include "iris/drm/iris_drm_public.h"
96361fc4cbSmaya
977ec681f3Smrgstatic struct pipe_screen *
98361fc4cbSmayapipe_iris_create_screen(int fd, const struct pipe_screen_config *config)
99361fc4cbSmaya{
100361fc4cbSmaya   struct pipe_screen *screen;
101361fc4cbSmaya
102361fc4cbSmaya   screen = iris_drm_screen_create(fd, config);
103361fc4cbSmaya   return screen ? debug_screen_wrap(screen) : NULL;
104361fc4cbSmaya}
105361fc4cbSmaya
1067ec681f3Smrgconst driOptionDescription iris_driconf[] = {
1077ec681f3Smrg      #include "iris/driinfo_iris.h"
1087ec681f3Smrg};
1097ec681f3SmrgDRM_DRIVER_DESCRIPTOR(iris, iris_driconf, ARRAY_SIZE(iris_driconf))
110361fc4cbSmaya
111361fc4cbSmaya#else
1127ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(iris)
1137ec681f3Smrg#endif
114361fc4cbSmaya
1157ec681f3Smrg#ifdef GALLIUM_CROCUS
1167ec681f3Smrg#include "crocus/drm/crocus_drm_public.h"
1177ec681f3Smrg
1187ec681f3Smrgstatic struct pipe_screen *
1197ec681f3Smrgpipe_crocus_create_screen(int fd, const struct pipe_screen_config *config)
120361fc4cbSmaya{
1217ec681f3Smrg   struct pipe_screen *screen;
122361fc4cbSmaya
1237ec681f3Smrg   screen = crocus_drm_screen_create(fd, config);
1247ec681f3Smrg   return screen ? debug_screen_wrap(screen) : NULL;
1257ec681f3Smrg}
126361fc4cbSmaya
1277ec681f3Smrgconst driOptionDescription crocus_driconf[] = {
1287ec681f3Smrg      #include "crocus/driinfo_crocus.h"
1297ec681f3Smrg};
1307ec681f3SmrgDRM_DRIVER_DESCRIPTOR(crocus, crocus_driconf, ARRAY_SIZE(crocus_driconf))
1317ec681f3Smrg#else
1327ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(crocus)
133361fc4cbSmaya#endif
134361fc4cbSmaya
13501e04c3fSmrg#ifdef GALLIUM_NOUVEAU
13601e04c3fSmrg#include "nouveau/drm/nouveau_drm_public.h"
13701e04c3fSmrg
1387ec681f3Smrgstatic struct pipe_screen *
13901e04c3fSmrgpipe_nouveau_create_screen(int fd, const struct pipe_screen_config *config)
14001e04c3fSmrg{
14101e04c3fSmrg   struct pipe_screen *screen;
14201e04c3fSmrg
14301e04c3fSmrg   screen = nouveau_drm_screen_create(fd);
14401e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
14501e04c3fSmrg}
1467ec681f3SmrgDRM_DRIVER_DESCRIPTOR(nouveau, NULL, 0)
14701e04c3fSmrg
14801e04c3fSmrg#else
1497ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(nouveau)
1507ec681f3Smrg#endif
15101e04c3fSmrg
1527ec681f3Smrg#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D)
1537ec681f3Smrgconst driOptionDescription v3d_driconf[] = {
1547ec681f3Smrg      #include "v3d/driinfo_v3d.h"
1557ec681f3Smrg};
15601e04c3fSmrg#endif
15701e04c3fSmrg
158361fc4cbSmaya#ifdef GALLIUM_KMSRO
159361fc4cbSmaya#include "kmsro/drm/kmsro_drm_public.h"
16001e04c3fSmrg
1617ec681f3Smrgstatic struct pipe_screen *
162361fc4cbSmayapipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config)
16301e04c3fSmrg{
16401e04c3fSmrg   struct pipe_screen *screen;
16501e04c3fSmrg
1667ec681f3Smrg   screen = kmsro_drm_screen_create(fd, config);
16701e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
16801e04c3fSmrg}
1697ec681f3Smrg#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D)
1707ec681f3SmrgDRM_DRIVER_DESCRIPTOR(kmsro, v3d_driconf, ARRAY_SIZE(v3d_driconf))
17101e04c3fSmrg#else
1727ec681f3SmrgDRM_DRIVER_DESCRIPTOR(kmsro, NULL, 0)
1737ec681f3Smrg#endif
17401e04c3fSmrg
1757ec681f3Smrg#else
1767ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(kmsro)
17701e04c3fSmrg#endif
17801e04c3fSmrg
17901e04c3fSmrg#ifdef GALLIUM_R300
18001e04c3fSmrg#include "radeon/radeon_winsys.h"
18101e04c3fSmrg#include "radeon/drm/radeon_drm_public.h"
18201e04c3fSmrg#include "r300/r300_public.h"
18301e04c3fSmrg
1847ec681f3Smrgstatic struct pipe_screen *
18501e04c3fSmrgpipe_r300_create_screen(int fd, const struct pipe_screen_config *config)
18601e04c3fSmrg{
18701e04c3fSmrg   struct radeon_winsys *rw;
18801e04c3fSmrg
18901e04c3fSmrg   rw = radeon_drm_winsys_create(fd, config, r300_screen_create);
19001e04c3fSmrg   return rw ? debug_screen_wrap(rw->screen) : NULL;
19101e04c3fSmrg}
1927ec681f3SmrgDRM_DRIVER_DESCRIPTOR(r300, NULL, 0)
19301e04c3fSmrg
19401e04c3fSmrg#else
1957ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(r300)
19601e04c3fSmrg#endif
19701e04c3fSmrg
19801e04c3fSmrg#ifdef GALLIUM_R600
19901e04c3fSmrg#include "radeon/radeon_winsys.h"
20001e04c3fSmrg#include "radeon/drm/radeon_drm_public.h"
20101e04c3fSmrg#include "r600/r600_public.h"
20201e04c3fSmrg
2037ec681f3Smrgstatic struct pipe_screen *
20401e04c3fSmrgpipe_r600_create_screen(int fd, const struct pipe_screen_config *config)
20501e04c3fSmrg{
20601e04c3fSmrg   struct radeon_winsys *rw;
20701e04c3fSmrg
20801e04c3fSmrg   rw = radeon_drm_winsys_create(fd, config, r600_screen_create);
20901e04c3fSmrg   return rw ? debug_screen_wrap(rw->screen) : NULL;
21001e04c3fSmrg}
2117ec681f3SmrgDRM_DRIVER_DESCRIPTOR(r600, NULL, 0)
21201e04c3fSmrg
21301e04c3fSmrg#else
2147ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(r600)
21501e04c3fSmrg#endif
21601e04c3fSmrg
21701e04c3fSmrg#ifdef GALLIUM_RADEONSI
21801e04c3fSmrg#include "radeonsi/si_public.h"
21901e04c3fSmrg
2207ec681f3Smrgstatic struct pipe_screen *
22101e04c3fSmrgpipe_radeonsi_create_screen(int fd, const struct pipe_screen_config *config)
22201e04c3fSmrg{
2237ec681f3Smrg   struct pipe_screen *screen = radeonsi_screen_create(fd, config);
22401e04c3fSmrg
2257ec681f3Smrg   return screen ? debug_screen_wrap(screen) : NULL;
22601e04c3fSmrg}
22701e04c3fSmrg
2287ec681f3Smrgconst driOptionDescription radeonsi_driconf[] = {
2297ec681f3Smrg      #include "radeonsi/driinfo_radeonsi.h"
2307ec681f3Smrg};
2317ec681f3SmrgDRM_DRIVER_DESCRIPTOR(radeonsi, radeonsi_driconf, ARRAY_SIZE(radeonsi_driconf))
23201e04c3fSmrg
23301e04c3fSmrg#else
2347ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(radeonsi)
23501e04c3fSmrg#endif
23601e04c3fSmrg
23701e04c3fSmrg#ifdef GALLIUM_VMWGFX
23801e04c3fSmrg#include "svga/drm/svga_drm_public.h"
23901e04c3fSmrg#include "svga/svga_public.h"
24001e04c3fSmrg
2417ec681f3Smrgstatic struct pipe_screen *
24201e04c3fSmrgpipe_vmwgfx_create_screen(int fd, const struct pipe_screen_config *config)
24301e04c3fSmrg{
24401e04c3fSmrg   struct svga_winsys_screen *sws;
24501e04c3fSmrg   struct pipe_screen *screen;
24601e04c3fSmrg
24701e04c3fSmrg   sws = svga_drm_winsys_screen_create(fd);
24801e04c3fSmrg   if (!sws)
24901e04c3fSmrg      return NULL;
25001e04c3fSmrg
25101e04c3fSmrg   screen = svga_screen_create(sws);
25201e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
25301e04c3fSmrg}
2547ec681f3SmrgDRM_DRIVER_DESCRIPTOR(vmwgfx, NULL, 0)
25501e04c3fSmrg
25601e04c3fSmrg#else
2577ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(vmwgfx)
25801e04c3fSmrg#endif
25901e04c3fSmrg
26001e04c3fSmrg#ifdef GALLIUM_FREEDRENO
26101e04c3fSmrg#include "freedreno/drm/freedreno_drm_public.h"
26201e04c3fSmrg
2637ec681f3Smrgstatic struct pipe_screen *
2647ec681f3Smrgpipe_msm_create_screen(int fd, const struct pipe_screen_config *config)
26501e04c3fSmrg{
26601e04c3fSmrg   struct pipe_screen *screen;
26701e04c3fSmrg
2687ec681f3Smrg   screen = fd_drm_screen_create(fd, NULL, config);
26901e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
27001e04c3fSmrg}
2717ec681f3SmrgDRM_DRIVER_DESCRIPTOR(msm, NULL, 0)
27201e04c3fSmrg#else
2737ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(msm)
27401e04c3fSmrg#endif
2757ec681f3SmrgDRM_DRIVER_DESCRIPTOR_ALIAS(msm, kgsl, NULL, 0)
27601e04c3fSmrg
27701e04c3fSmrg#ifdef GALLIUM_VIRGL
27801e04c3fSmrg#include "virgl/drm/virgl_drm_public.h"
27901e04c3fSmrg#include "virgl/virgl_public.h"
28001e04c3fSmrg
2817ec681f3Smrgstatic struct pipe_screen *
2827ec681f3Smrgpipe_virtio_gpu_create_screen(int fd, const struct pipe_screen_config *config)
28301e04c3fSmrg{
28401e04c3fSmrg   struct pipe_screen *screen;
28501e04c3fSmrg
2867ec681f3Smrg   screen = virgl_drm_screen_create(fd, config);
28701e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
28801e04c3fSmrg}
28901e04c3fSmrg
2907ec681f3Smrgconst driOptionDescription virgl_driconf[] = {
2917ec681f3Smrg      #include "virgl/virgl_driinfo.h.in"
2927ec681f3Smrg};
2937ec681f3SmrgDRM_DRIVER_DESCRIPTOR(virtio_gpu, virgl_driconf, ARRAY_SIZE(virgl_driconf))
29401e04c3fSmrg
2957ec681f3Smrg#else
2967ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(virtio_gpu)
29701e04c3fSmrg#endif
29801e04c3fSmrg
29901e04c3fSmrg#ifdef GALLIUM_VC4
30001e04c3fSmrg#include "vc4/drm/vc4_drm_public.h"
30101e04c3fSmrg
3027ec681f3Smrgstatic struct pipe_screen *
30301e04c3fSmrgpipe_vc4_create_screen(int fd, const struct pipe_screen_config *config)
30401e04c3fSmrg{
30501e04c3fSmrg   struct pipe_screen *screen;
30601e04c3fSmrg
3077ec681f3Smrg   screen = vc4_drm_screen_create(fd, config);
30801e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
30901e04c3fSmrg}
3107ec681f3SmrgDRM_DRIVER_DESCRIPTOR(vc4, v3d_driconf, ARRAY_SIZE(v3d_driconf))
31101e04c3fSmrg#else
3127ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(vc4)
31301e04c3fSmrg#endif
31401e04c3fSmrg
31501e04c3fSmrg#ifdef GALLIUM_V3D
31601e04c3fSmrg#include "v3d/drm/v3d_drm_public.h"
31701e04c3fSmrg
3187ec681f3Smrgstatic struct pipe_screen *
31901e04c3fSmrgpipe_v3d_create_screen(int fd, const struct pipe_screen_config *config)
32001e04c3fSmrg{
32101e04c3fSmrg   struct pipe_screen *screen;
32201e04c3fSmrg
3237ec681f3Smrg   screen = v3d_drm_screen_create(fd, config);
32401e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
32501e04c3fSmrg}
32601e04c3fSmrg
3277ec681f3SmrgDRM_DRIVER_DESCRIPTOR(v3d, v3d_driconf, ARRAY_SIZE(v3d_driconf))
32801e04c3fSmrg
3297ec681f3Smrg#else
3307ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(v3d)
33101e04c3fSmrg#endif
33201e04c3fSmrg
333361fc4cbSmaya#ifdef GALLIUM_PANFROST
334361fc4cbSmaya#include "panfrost/drm/panfrost_drm_public.h"
33501e04c3fSmrg
3367ec681f3Smrgstatic struct pipe_screen *
337361fc4cbSmayapipe_panfrost_create_screen(int fd, const struct pipe_screen_config *config)
33801e04c3fSmrg{
33901e04c3fSmrg   struct pipe_screen *screen;
34001e04c3fSmrg
341361fc4cbSmaya   screen = panfrost_drm_screen_create(fd);
34201e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
34301e04c3fSmrg}
3447ec681f3SmrgDRM_DRIVER_DESCRIPTOR(panfrost, NULL, 0)
34501e04c3fSmrg
34601e04c3fSmrg#else
3477ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(panfrost)
34801e04c3fSmrg#endif
34901e04c3fSmrg
350361fc4cbSmaya#ifdef GALLIUM_ETNAVIV
351361fc4cbSmaya#include "etnaviv/drm/etnaviv_drm_public.h"
35201e04c3fSmrg
3537ec681f3Smrgstatic struct pipe_screen *
3547ec681f3Smrgpipe_etnaviv_create_screen(int fd, const struct pipe_screen_config *config)
35501e04c3fSmrg{
35601e04c3fSmrg   struct pipe_screen *screen;
35701e04c3fSmrg
358361fc4cbSmaya   screen = etna_drm_screen_create(fd);
35901e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
36001e04c3fSmrg}
3617ec681f3SmrgDRM_DRIVER_DESCRIPTOR(etnaviv, NULL, 0)
36201e04c3fSmrg
36301e04c3fSmrg#else
3647ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(etnaviv)
36501e04c3fSmrg#endif
36601e04c3fSmrg
36701e04c3fSmrg#ifdef GALLIUM_TEGRA
36801e04c3fSmrg#include "tegra/drm/tegra_drm_public.h"
36901e04c3fSmrg
3707ec681f3Smrgstatic struct pipe_screen *
37101e04c3fSmrgpipe_tegra_create_screen(int fd, const struct pipe_screen_config *config)
37201e04c3fSmrg{
37301e04c3fSmrg   struct pipe_screen *screen;
37401e04c3fSmrg
37501e04c3fSmrg   screen = tegra_drm_screen_create(fd);
37601e04c3fSmrg
37701e04c3fSmrg   return screen ? debug_screen_wrap(screen) : NULL;
37801e04c3fSmrg}
3797ec681f3SmrgDRM_DRIVER_DESCRIPTOR(tegra, NULL, 0)
38001e04c3fSmrg
38101e04c3fSmrg#else
3827ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(tegra)
38301e04c3fSmrg#endif
38401e04c3fSmrg
385361fc4cbSmaya#ifdef GALLIUM_LIMA
386361fc4cbSmaya#include "lima/drm/lima_drm_public.h"
387361fc4cbSmaya
3887ec681f3Smrgstatic struct pipe_screen *
389361fc4cbSmayapipe_lima_create_screen(int fd, const struct pipe_screen_config *config)
390361fc4cbSmaya{
391361fc4cbSmaya   struct pipe_screen *screen;
392361fc4cbSmaya
393361fc4cbSmaya   screen = lima_drm_screen_create(fd);
394361fc4cbSmaya   return screen ? debug_screen_wrap(screen) : NULL;
395361fc4cbSmaya}
3967ec681f3SmrgDRM_DRIVER_DESCRIPTOR(lima, NULL, 0)
397361fc4cbSmaya
398361fc4cbSmaya#else
3997ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(lima)
4007ec681f3Smrg#endif
401361fc4cbSmaya
4027ec681f3Smrg#ifdef GALLIUM_ZINK
4037ec681f3Smrg#include "zink/zink_public.h"
4047ec681f3Smrg
4057ec681f3Smrgstatic struct pipe_screen *
4067ec681f3Smrgpipe_zink_create_screen(int fd, const struct pipe_screen_config *config)
407361fc4cbSmaya{
4087ec681f3Smrg   struct pipe_screen *screen;
4097ec681f3Smrg   screen = zink_drm_create_screen(fd, config);
4107ec681f3Smrg   return screen ? debug_screen_wrap(screen) : NULL;
411361fc4cbSmaya}
412361fc4cbSmaya
4137ec681f3Smrgconst driOptionDescription zink_driconf[] = {
4147ec681f3Smrg      #include "zink/driinfo_zink.h"
4157ec681f3Smrg};
4167ec681f3SmrgDRM_DRIVER_DESCRIPTOR(zink, zink_driconf, ARRAY_SIZE(zink_driconf))
4177ec681f3Smrg
4187ec681f3Smrg#else
4197ec681f3SmrgDRM_DRIVER_DESCRIPTOR_STUB(zink)
420361fc4cbSmaya#endif
421361fc4cbSmaya
42201e04c3fSmrg#endif /* DRM_HELPER_H */
423