[Mesa-dev] [RFC 7/7] freedreno: add xa-freedreno target

Rob Clark robdclark at gmail.com
Tue May 28 07:13:32 PDT 2013


From: Rob Clark <robclark at freedesktop.org>

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 configure.ac                                     |  4 +-
 src/gallium/targets/Makefile.am                  |  3 ++
 src/gallium/targets/xa-freedreno/Makefile.am     | 65 ++++++++++++++++++++++++
 src/gallium/targets/xa-freedreno/fd_target.c     | 20 ++++++++
 src/gallium/targets/xa-freedreno/xatracker.pc.in |  9 ++++
 5 files changed, 100 insertions(+), 1 deletion(-)
 create mode 100644 src/gallium/targets/xa-freedreno/Makefile.am
 create mode 100644 src/gallium/targets/xa-freedreno/fd_target.c
 create mode 100644 src/gallium/targets/xa-freedreno/xatracker.pc.in

diff --git a/configure.ac b/configure.ac
index 7e234f4..91bfaba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1800,7 +1800,7 @@ if test "x$with_gallium_drivers" != x; then
             PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
             gallium_require_drm_loader
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
-            gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
+            gallium_check_st "freedreno/drm" "dri-freedreno" "" "xa-freedreno" "" ""
             ;;
         xswrast)
             HAVE_GALLIUM_SOFTPIPE=yes
@@ -2035,6 +2035,8 @@ AC_CONFIG_FILES([Makefile
 		src/gallium/targets/vdpau-r600/Makefile
 		src/gallium/targets/vdpau-radeonsi/Makefile
 		src/gallium/targets/vdpau-softpipe/Makefile
+		src/gallium/targets/xa-freedreno/Makefile
+		src/gallium/targets/xa-freedreno/xatracker.pc
 		src/gallium/targets/xa-vmwgfx/Makefile
 		src/gallium/targets/xa-vmwgfx/xatracker.pc
 		src/gallium/targets/xorg-i915/Makefile
diff --git a/src/gallium/targets/Makefile.am b/src/gallium/targets/Makefile.am
index ff09821..bc87146 100644
--- a/src/gallium/targets/Makefile.am
+++ b/src/gallium/targets/Makefile.am
@@ -52,6 +52,9 @@ if HAVE_GALLIUM_FREEDRENO
 if HAVE_DRI
 SUBDIRS += dri-freedreno
 endif
+if HAVE_ST_XA
+SUBDIRS += xa-freedreno
+endif
 endif
 
 if HAVE_GALLIUM_I915
diff --git a/src/gallium/targets/xa-freedreno/Makefile.am b/src/gallium/targets/xa-freedreno/Makefile.am
new file mode 100644
index 0000000..2541e7a
--- /dev/null
+++ b/src/gallium/targets/xa-freedreno/Makefile.am
@@ -0,0 +1,65 @@
+# Copyright © 2012 Intel 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 $(top_srcdir)/src/gallium/Automake.inc
+
+AM_CFLAGS = \
+	-Wall -pedantic \
+	$(GALLIUM_CFLAGS) \
+	$(XORG_CFLAGS)
+AM_CPPFLAGS = \
+	-I$(top_srcdir)/src/gallium/drivers \
+	-I$(top_srcdir)/src/gallium/winsys
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = xatracker.pc
+
+lib_LTLIBRARIES = libxatracker.la
+
+libxatracker_la_SOURCES = fd_target.c
+
+libxatracker_la_LDFLAGS = -version-number $(XA_MAJOR):$(XA_MINOR):$(XA_TINY)
+
+libxatracker_la_LIBADD = \
+	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
+	$(top_builddir)/src/gallium/state_trackers/xa/libxatracker.la \
+	$(top_builddir)/src/gallium/winsys/freedreno/drm/libfreedrenodrm.la \
+	$(top_builddir)/src/gallium/drivers/freedreno/libfreedreno.la \
+	$(top_builddir)/src/gallium/drivers/trace/libtrace.la \
+	$(top_builddir)/src/gallium/drivers/rbug/librbug.la \
+	$(top_builddir)/src/gallium/drivers/noop/libnoop.la \
+	$(LIBDRM_LIBS) \
+	$(FREEDRENO_LIBS)
+
+
+nodist_EXTRA_libxatracker_la_SOURCES = dummy.cpp
+
+if HAVE_MESA_LLVM
+libxatracker_la_LDFLAGS += $(LLVM_LDFLAGS)
+libxatracker_la_LIBADD += $(LLVM_LIBS)
+endif
+
+# Provide compatibility with scripts for the old Mesa build system for
+# a while by putting a link to the driver into /lib of the build tree.
+all-local: libxatracker.la
+	$(MKDIR_P) $(top_builddir)/$(LIB_DIR)/gallium
+	ln -f .libs/libxatracker.so* $(top_builddir)/$(LIB_DIR)/gallium/
diff --git a/src/gallium/targets/xa-freedreno/fd_target.c b/src/gallium/targets/xa-freedreno/fd_target.c
new file mode 100644
index 0000000..dcaf299
--- /dev/null
+++ b/src/gallium/targets/xa-freedreno/fd_target.c
@@ -0,0 +1,20 @@
+
+#include "target-helpers/inline_debug_helper.h"
+#include "state_tracker/drm_driver.h"
+#include "freedreno/drm/freedreno_drm_public.h"
+
+static struct pipe_screen *
+create_screen(int fd)
+{
+   struct pipe_screen *screen;
+
+   screen = fd_drm_screen_create(fd);
+   if (!screen)
+      return NULL;
+
+   screen = debug_screen_wrap(screen);
+
+   return screen;
+}
+
+DRM_DRIVER_DESCRIPTOR("freedreno", "kgsl", create_screen, NULL)
diff --git a/src/gallium/targets/xa-freedreno/xatracker.pc.in b/src/gallium/targets/xa-freedreno/xatracker.pc.in
new file mode 100644
index 0000000..c99d8d6
--- /dev/null
+++ b/src/gallium/targets/xa-freedreno/xatracker.pc.in
@@ -0,0 +1,9 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=@libdir@
+includedir=@includedir@
+
+Name: xatracker
+Description: Xorg Gallium3D acceleration library
+Version: @XA_VERSION@
+Libs: -L${libdir} -lxatracker
-- 
1.8.1.4



More information about the mesa-dev mailing list