summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-10-02 23:27:36 +0100
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:43 +0000
commit9fa7400564244bdd333066eb71285c3703b537f7 (patch)
tree42eeead155acf0e18a5fda823799f7e0ce72b62b /src/gallium/auxiliary
parent4249e4a598a3057af71e095e70b98cf710d325ad (diff)
zink: add dri loader
export MESA_LOADER_DRIVER_OVERRIDE=zink should now work without using swrast paths Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c4
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper.h22
-rw-r--r--src/gallium/auxiliary/target-helpers/drm_helper_public.h4
3 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 3b9b39f62a3..2e1bff4c233 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -135,6 +135,10 @@ static const struct drm_driver_descriptor driver_descriptors[] = {
.driver_name = "lima",
.create_screen = pipe_lima_create_screen,
},
+ {
+ .driver_name = "zink",
+ .create_screen = pipe_zink_create_screen,
+ },
};
static const struct drm_driver_descriptor default_driver_descriptor = {
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h
index 6c5902d3c27..01b65d6c7f8 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper.h
@@ -414,4 +414,26 @@ pipe_lima_create_screen(int fd, const struct pipe_screen_config *config)
#endif
+#ifdef GALLIUM_ZINK
+#include "zink/zink_public.h"
+
+struct pipe_screen *
+pipe_zink_create_screen(int fd, const struct pipe_screen_config *config)
+{
+ struct pipe_screen *screen;
+ screen = zink_drm_create_screen(fd);
+ return screen ? debug_screen_wrap(screen) : NULL;
+}
+
+#else
+
+struct pipe_screen *
+pipe_zink_create_screen(int fd, const struct pipe_screen_config *config)
+{
+ fprintf(stderr, "zink: driver missing\n");
+ return NULL;
+}
+
+#endif
+
#endif /* DRM_HELPER_H */
diff --git a/src/gallium/auxiliary/target-helpers/drm_helper_public.h b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
index 99018f0df88..82dfe9e2575 100644
--- a/src/gallium/auxiliary/target-helpers/drm_helper_public.h
+++ b/src/gallium/auxiliary/target-helpers/drm_helper_public.h
@@ -60,4 +60,8 @@ pipe_tegra_create_screen(int fd, const struct pipe_screen_config *config);
struct pipe_screen *
pipe_lima_create_screen(int fd, const struct pipe_screen_config *config);
+struct pipe_screen *
+pipe_zink_create_screen(int fd, const struct pipe_screen_config *config);
+
+
#endif /* _DRM_HELPER_PUBLIC_H */