summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-10-22 18:11:46 +0200
committerThierry Reding <treding@nvidia.com>2016-07-04 11:35:28 +0200
commit1f56f06e88e5fa8ad0964a261bf8992dabb4f426 (patch)
tree2891cd3b0592c09dad6de98707a351c336d0a520
parent025f477e0b9877a8de2c29a3bf10d24566c8d502 (diff)
WIP: tegra: Add pipe loader
This doesn't currently work for unknown reasons. I'll get back to this when it becomes more relevant. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--configure.ac2
-rw-r--r--src/gallium/targets/pipe-loader/Makefile.am16
-rw-r--r--src/gallium/targets/pipe-loader/pipe_tegra.c41
3 files changed, 58 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5cd1d9bd8cd5..93a69e1794ee 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1142,7 +1142,7 @@ AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
# Build the pipe-drivers as separate libraries/modules.
# Do not touch this unless you know what you are doing.
# XXX: Expose via configure option ?
-enable_shared_pipe_drivers=no
+enable_shared_pipe_drivers=yes
dnl
dnl Driver specific build directories
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index 18b403f73315..9635c7aaed1f 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -178,6 +178,22 @@ pipe_msm_la_LIBADD = \
endif
+if HAVE_GALLIUM_TEGRA
+pipe_LTLIBRARIES += pipe_tegra.la
+
+pipe_tegra_la_SOURCES = pipe_tegra.c
+nodist_EXTRA_pipe_tegra_la_SOURCES = dummy.cpp
+pipe_tegra_la_LIBADD = \
+ $(PIPE_LIBS) \
+ $(top_builddir)/src/gallium/winsys/tegra/drm/libtegradrm.la \
+ $(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
+ $(top_builddir)/src/gallium/drivers/tegra/libtegra.la \
+ $(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
+ $(TEGRA_LIBS) \
+ $(NOUVEAU_LIBS) \
+ $(LIBDRM_LIBS)
+endif
+
if HAVE_GALLIUM_SVGA
pipe_LTLIBRARIES += pipe_vmwgfx.la
diff --git a/src/gallium/targets/pipe-loader/pipe_tegra.c b/src/gallium/targets/pipe-loader/pipe_tegra.c
new file mode 100644
index 000000000000..ff952080ac08
--- /dev/null
+++ b/src/gallium/targets/pipe-loader/pipe_tegra.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2014 NVIDIA Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "state_tracker/drm_driver.h"
+#include "target-helpers/inline_debug_helper.h"
+#include "tegra/drm/tegra_drm_public.h"
+
+static struct pipe_screen *
+tegra_create_screen(int fd)
+{
+ struct pipe_screen *screen;
+
+ screen = tegra_drm_screen_create(fd);
+ if (!screen)
+ return NULL;
+
+ return debug_screen_wrap(screen);
+}
+
+PUBLIC
+DRM_DRIVER_DESCRIPTOR("tegra", "tegra", tegra_create_screen, NULL);