Skip to contentSkip to conversation

etnaviv_libdrm

PATCH In review Christian Gmeiner 2 participants 4 messages Sep 6, 2016 – Sep 13, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

v2 cover etnaviv_libdrm

As the original patchstack is now about 80 patches, I have choosen to squash the patches together into two seperate parts. The libdrm_etnaviv implementation and tests. All seperate patches can be found here:
https://github.com/austriancoder/libdrm/tree/master

As this work is a collaborative effort of Lucas Stack and myself all of those patches have a fictive author, but our signoff.

The current state of the gallium driver can be found here:
https://github.com/etnaviv/mesa/tree/12.0_etnaviv

Happy reviewing!

Christian

Changes from v1:
- remove not needed AUTOMAKE_OPTIONS from Makefile.am
- set shared library version to 1.0.0
- fix bad comment in etnaviv-symbol-check
- remove of a dead comment line
- correct VIV_FEATURES_WORD_COUNT define
- use generated file from headers_install
- use separate labels and drop all the if checks in tests code
- update header files generated by rnndb
- remove some empty lines with tabs

The etnaviv authors (2):
libdrm: add etnaviv drm support
libdrm: add etnaviv tests

 .gitignore                              |    4 +
 Makefile.am                             |    6 +
 configure.ac                            |   17 +
 etnaviv/Android.mk                      |   18 +
 etnaviv/Makefile.am                     |   26 +
 etnaviv/Makefile.sources                |   12 +
 etnaviv/etnaviv-symbol-check            |   45 +
 etnaviv/etnaviv_bo.c                    |  347 +++++++
 etnaviv/etnaviv_bo_cache.c              |  196 ++++
 etnaviv/etnaviv_cmd_stream.c            |  243 +++++
 etnaviv/etnaviv_device.c                |   96 ++
 etnaviv/etnaviv_drm.h                   |  233 +++++
 etnaviv/etnaviv_drmif.h                 |  188 ++++
 etnaviv/etnaviv_gpu.c                   |  175 ++++
 etnaviv/etnaviv_pipe.c                  |   78 ++
 etnaviv/etnaviv_priv.h                  |  199 ++++
 etnaviv/libdrm_etnaviv.pc.in            |   11 +
 tests/Makefile.am                       |    4 +
 tests/etnaviv/Makefile.am               |   41 +
 tests/etnaviv/cmdstream.xml.h           |  242 +++++
 tests/etnaviv/etnaviv_2d_test.c         |  240 +++++
 tests/etnaviv/etnaviv_bo_cache_test.c   |  121 +++
 tests/etnaviv/etnaviv_cmd_stream_test.c |  123 +++
 tests/etnaviv/state.xml.h               |  375 ++++++++
 tests/etnaviv/state_2d.xml.h            | 1497 +++++++++++++++++++++++++++++++
 tests/etnaviv/write_bmp.c               |  152 ++++
 tests/etnaviv/write_bmp.h               |   34 +
 27 files changed, 4723 insertions(+)
 create mode 100644 etnaviv/Android.mk
 create mode 100644 etnaviv/Makefile.am
 create mode 100644 etnaviv/Makefile.sources
 create mode 100755 etnaviv/etnaviv-symbol-check
 create mode 100644 etnaviv/etnaviv_bo.c
 create mode 100644 etnaviv/etnaviv_bo_cache.c
 create mode 100644 etnaviv/etnaviv_cmd_stream.c
 create mode 100644 etnaviv/etnaviv_device.c
 create mode 100644 etnaviv/etnaviv_drm.h
 create mode 100644 etnaviv/etnaviv_drmif.h
 create mode 100644 etnaviv/etnaviv_gpu.c
 create mode 100644 etnaviv/etnaviv_pipe.c
 create mode 100644 etnaviv/etnaviv_priv.h
 create mode 100644 etnaviv/libdrm_etnaviv.pc.in
 create mode 100644 tests/etnaviv/Makefile.am
 create mode 100644 tests/etnaviv/cmdstream.xml.h
 create mode 100644 tests/etnaviv/etnaviv_2d_test.c
 create mode 100644 tests/etnaviv/etnaviv_bo_cache_test.c
 create mode 100644 tests/etnaviv/etnaviv_cmd_stream_test.c
 create mode 100644 tests/etnaviv/state.xml.h
 create mode 100644 tests/etnaviv/state_2d.xml.h
 create mode 100644 tests/etnaviv/write_bmp.c
 create mode 100644 tests/etnaviv/write_bmp.h
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v2 1/2 libdrm: add etnaviv drm support

From: The etnaviv authors <[email protected]>

Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific interfaces to the DRM.

---
 .gitignore                   |   1 +
 Makefile.am                  |   6 +
 configure.ac                 |  16 ++
 etnaviv/Android.mk           |  18 +++
 etnaviv/Makefile.am          |  26 ++++
 etnaviv/Makefile.sources     |  12 ++
 etnaviv/etnaviv-symbol-check |  45 ++++++
 etnaviv/etnaviv_bo.c         | 347 +++++++++++++++++++++++++++++++++++++++++++
 etnaviv/etnaviv_bo_cache.c   | 196 ++++++++++++++++++++++++
 etnaviv/etnaviv_cmd_stream.c | 243 ++++++++++++++++++++++++++++++
 etnaviv/etnaviv_device.c     |  96 ++++++++++++
 etnaviv/etnaviv_drm.h        | 233 +++++++++++++++++++++++++++++
 etnaviv/etnaviv_drmif.h      | 188 +++++++++++++++++++++++
 etnaviv/etnaviv_gpu.c        | 175 ++++++++++++++++++++++
 etnaviv/etnaviv_pipe.c       |  78 ++++++++++
 etnaviv/etnaviv_priv.h       | 199 +++++++++++++++++++++++++
 etnaviv/libdrm_etnaviv.pc.in |  11 ++
 17 files changed, 1890 insertions(+)
 create mode 100644 etnaviv/Android.mk
 create mode 100644 etnaviv/Makefile.am
 create mode 100644 etnaviv/Makefile.sources
 create mode 100755 etnaviv/etnaviv-symbol-check
 create mode 100644 etnaviv/etnaviv_bo.c
 create mode 100644 etnaviv/etnaviv_bo_cache.c
 create mode 100644 etnaviv/etnaviv_cmd_stream.c
 create mode 100644 etnaviv/etnaviv_device.c
 create mode 100644 etnaviv/etnaviv_drm.h
 create mode 100644 etnaviv/etnaviv_drmif.h
 create mode 100644 etnaviv/etnaviv_gpu.c
 create mode 100644 etnaviv/etnaviv_pipe.c
 create mode 100644 etnaviv/etnaviv_priv.h
 create mode 100644 etnaviv/libdrm_etnaviv.pc.in
.gitignore +1 -0
index a44566f..3226b3a 100644
@@ -57,6 +57,7 @@ libdrm_exynos.pc
 libdrm_freedreno.pc
 libdrm_amdgpu.pc
 libdrm_vc4.pc
+libdrm_etnaviv.pc
 libkms.pc
 libtool
 ltmain.sh
Makefile.am +6 -0
index 2ceb352..630edc4 100644
@@ -36,6 +36,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-freedreno \
 	--enable-freedreno-kgsl\
 	--enable-tegra-experimental-api \
+	--enable-etnaviv-experimental-api \
 	--enable-install-test-programs \
 	--enable-cairo-tests \
 	--enable-manpages \
@@ -84,6 +85,10 @@ if HAVE_VC4
 VC4_SUBDIR = vc4
 endif
 
+if HAVE_ETNAVIV
+ETNAVIV_SUBDIR = etnaviv
+endif
+
 if BUILD_MANPAGES
 if HAVE_MANPAGES_STYLESHEET
 MAN_SUBDIR = man
@@ -102,6 +107,7 @@ SUBDIRS = \
 	$(FREEDRENO_SUBDIR) \
 	$(TEGRA_SUBDIR) \
 	$(VC4_SUBDIR) \
+	$(ETNAVIV_SUBDIR) \
 	tests \
 	$(MAN_SUBDIR)
 
configure.ac +16 -0
index e3048c7..64f3e6c 100644
@@ -132,6 +132,11 @@ AC_ARG_ENABLE(vc4,
 	      [Enable support for vc4's API (default: auto, enabled on arm)]),
 	      [VC4=$enableval], [VC4=auto])
 
+AC_ARG_ENABLE(etnaviv-experimental-api,
+	      AS_HELP_STRING([--enable-etnaviv-experimental-api],
+	      [Enable support for etnaviv's experimental API (default: disabled)]),
+	      [ETNAVIV=$enableval], [ETNAVIV=no])
+
 AC_ARG_ENABLE(install-test-programs,
 		  AS_HELP_STRING([--enable-install-test-programs],
 		  [Install test programs (default: no)]),
@@ -274,6 +279,9 @@ if test "x$drm_cv_atomic_primitives" = "xnone"; then
 
 	LIBDRM_ATOMICS_NOT_FOUND_MSG($TEGRA, tegra, NVIDIA Tegra, tegra-experimental-api)
 	TEGRA=no
+
+	LIBDRM_ATOMICS_NOT_FOUND_MSG($ETNAVIV, etnaviv, Vivante, etnaviv-experimental-api)
+	ETNAVIV=no
 else
 	if test "x$INTEL" = xauto; then
 		case $host_cpu in
@@ -413,6 +421,11 @@ if test "x$VC4" = xyes; then
 	AC_DEFINE(HAVE_VC4, 1, [Have VC4 support])
 fi
 
+AM_CONDITIONAL(HAVE_ETNAVIV, [test "x$ETNAVIV" = xyes])
+if test "x$ETNAVIV" = xyes; then
+	AC_DEFINE(HAVE_ETNAVIV, 1, [Have etnaviv support])
+fi
+
 AM_CONDITIONAL(HAVE_INSTALL_TESTS, [test "x$INSTALL_TESTS" = xyes])
 if test "x$INSTALL_TESTS" = xyes; then
 	AC_DEFINE(HAVE_INSTALL_TESTS, 1, [Install test programs])
@@ -524,6 +537,8 @@ AC_CONFIG_FILES([
 	tegra/libdrm_tegra.pc
 	vc4/Makefile
 	vc4/libdrm_vc4.pc
+	etnaviv/Makefile
+	etnaviv/libdrm_etnaviv.pc
 	tests/Makefile
 	tests/modeprint/Makefile
 	tests/modetest/Makefile
@@ -555,4 +570,5 @@ echo "  EXYNOS API     $EXYNOS"
 echo "  Freedreno API  $FREEDRENO (kgsl: $FREEDRENO_KGSL)"
 echo "  Tegra API      $TEGRA"
 echo "  VC4 API        $VC4"
+echo "  Etnaviv API    $ETNAVIV"
 echo ""
etnaviv/Android.mk new file +18 -0
new file mode 100644
index 0000000..a3a2295
@@ -0,0 +1,18 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+# Import variables LIBDRM_ETNAVIV_FILES, LIBDRM_ETNAVIV_H_FILES
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_MODULE := libdrm_etnaviv
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libdrm
+
+LOCAL_SRC_FILES := $(patsubst %.h, , $(LIBDRM_ETNAVIV_FILES))
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
+
+LOCAL_CFLAGS := \
+	-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
+
+include $(BUILD_SHARED_LIBRARY)
etnaviv/Makefile.am new file +26 -0
new file mode 100644
index 0000000..be96ba8
@@ -0,0 +1,26 @@
+include Makefile.sources
+
+AM_CFLAGS = \
+	$(WARN_CFLAGS) \
+	-I$(top_srcdir) \
+	$(PTHREADSTUBS_CFLAGS) \
+	-I$(top_srcdir)/include/drm
+
+libdrm_etnaviv_ladir = $(libdir)
+libdrm_etnaviv_la_LTLIBRARIES = libdrm_etnaviv.la
+libdrm_etnaviv_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+libdrm_etnaviv_la_LIBADD = \
+	../libdrm.la \
+	@PTHREADSTUBS_LIBS@ \
+	@CLOCK_LIB@
+
+libdrm_etnaviv_la_SOURCES = $(LIBDRM_ETNAVIV_FILES)
+
+libdrm_etnavivincludedir = ${includedir}/libdrm
+libdrm_etnavivinclude_HEADERS = $(LIBDRM_ETNAVIV_H_FILES)
+
+pkgconfigdir = @pkgconfigdir@
+pkgconfig_DATA = libdrm_etnaviv.pc
+
+TESTS = etnaviv-symbol-check
+EXTRA_DIST = $(TESTS)
etnaviv/Makefile.sources new file +12 -0
new file mode 100644
index 0000000..5258056
@@ -0,0 +1,12 @@
+LIBDRM_ETNAVIV_FILES := \
+	etnaviv_device.c \
+	etnaviv_gpu.c \
+	etnaviv_bo.c \
+	etnaviv_bo_cache.c \
+	etnaviv_pipe.c \
+	etnaviv_cmd_stream.c \
+	etnaviv_drm.h \
+	etnaviv_priv.h
+
+LIBDRM_ETNAVIV_H_FILES := \
+	etnaviv_drmif.h
etnaviv/etnaviv-symbol-check new file +45 -0

45 lines not on this page · raw message

etnaviv/etnaviv_bo.c new file +347 -0

347 lines not on this page · raw message

etnaviv/etnaviv_bo_cache.c new file +196 -0

196 lines not on this page · raw message

etnaviv/etnaviv_cmd_stream.c new file +243 -0

243 lines not on this page · raw message

etnaviv/etnaviv_device.c new file +96 -0

96 lines not on this page · raw message

etnaviv/etnaviv_drm.h new file +233 -0

233 lines not on this page · raw message

etnaviv/etnaviv_drmif.h new file +188 -0

188 lines not on this page · raw message

etnaviv/etnaviv_gpu.c new file +175 -0

175 lines not on this page · raw message

etnaviv/etnaviv_pipe.c new file +78 -0

78 lines not on this page · raw message

etnaviv/etnaviv_priv.h new file +199 -0

199 lines not on this page · raw message

etnaviv/libdrm_etnaviv.pc.in new file +11 -0
new file mode 100644
index 0000000..13fed01
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdrm_etnaviv
+Description: Userspace interface to etnaviv kernel DRM services
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -ldrm_etnaviv
+Cflags: -I${includedir} -I${includedir}/libdrm
+Requires.private: libdrm
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] libdrm: add etnaviv drm support

Quoted 6 lines · Christian Gmeiner

From: The etnaviv authors <[email protected]>

Add the libdrm_etnaviv helper library to encapsulate etnaviv-specific interfaces to the DRM.

Android is not completely working, but it builds and at least gets thru the early stages, so:

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

PATCH v2 2/2 libdrm: add etnaviv tests

In reply to Christian Gmeiner

From: The etnaviv authors <[email protected]>

This adds the following basic unit tests:

- etnaviv_2d_test
Let the 2D core render a defined pattern into a bo and store it as bmp.

- etnaviv_bo_cache_test
Basic tests to validate the bo-cache behavior.

- etnaviv_cmd_stream_test
Tests for the etna_cmd_stream API.

---
 .gitignore                              |    3 +
 configure.ac                            |    1 +
 tests/Makefile.am                       |    4 +
 tests/etnaviv/Makefile.am               |   41 +
 tests/etnaviv/cmdstream.xml.h           |  242 +++++
 tests/etnaviv/etnaviv_2d_test.c         |  240 +++++
 tests/etnaviv/etnaviv_bo_cache_test.c   |  121 +++
 tests/etnaviv/etnaviv_cmd_stream_test.c |  123 +++
 tests/etnaviv/state.xml.h               |  375 ++++++++
 tests/etnaviv/state_2d.xml.h            | 1497 +++++++++++++++++++++++++++++++
 tests/etnaviv/write_bmp.c               |  152 ++++
 tests/etnaviv/write_bmp.h               |   34 +
 12 files changed, 2833 insertions(+)
 create mode 100644 tests/etnaviv/Makefile.am
 create mode 100644 tests/etnaviv/cmdstream.xml.h
 create mode 100644 tests/etnaviv/etnaviv_2d_test.c
 create mode 100644 tests/etnaviv/etnaviv_bo_cache_test.c
 create mode 100644 tests/etnaviv/etnaviv_cmd_stream_test.c
 create mode 100644 tests/etnaviv/state.xml.h
 create mode 100644 tests/etnaviv/state_2d.xml.h
 create mode 100644 tests/etnaviv/write_bmp.c
 create mode 100644 tests/etnaviv/write_bmp.h
.gitignore +3 -0
index 3226b3a..d51e619 100644
@@ -102,4 +102,7 @@ tests/radeon/radeon_ttm
 tests/exynos/exynos_fimg2d_event
 tests/exynos/exynos_fimg2d_perf
 tests/exynos/exynos_fimg2d_test
+tests/etnaviv/etnaviv_2d_test
+tests/etnaviv/etnaviv_cmd_stream_test
+tests/etnaviv/etnaviv_bo_cache_test
 man/*.3
configure.ac +1 -0
index 64f3e6c..330358a 100644
@@ -551,6 +551,7 @@ AC_CONFIG_FILES([
 	tests/exynos/Makefile
 	tests/tegra/Makefile
 	tests/nouveau/Makefile
+	tests/etnaviv/Makefile
 	tests/util/Makefile
 	man/Makefile
 	libdrm.pc])
tests/Makefile.am +4 -0
index 58feb12..4a499e4 100644
@@ -22,6 +22,10 @@ if HAVE_TEGRA
 SUBDIRS += tegra
 endif
 
+if HAVE_ETNAVIV
+SUBDIRS += etnaviv
+endif
+
 AM_CFLAGS = \
 	$(WARN_CFLAGS)\
 	-I $(top_srcdir)/include/drm \
tests/etnaviv/Makefile.am new file +41 -0

41 lines not on this page · raw message

tests/etnaviv/cmdstream.xml.h new file +242 -0

242 lines not on this page · raw message

tests/etnaviv/etnaviv_2d_test.c new file +240 -0

240 lines not on this page · raw message

tests/etnaviv/etnaviv_bo_cache_test.c new file +121 -0

121 lines not on this page · raw message

tests/etnaviv/etnaviv_cmd_stream_test.c new file +123 -0

123 lines not on this page · raw message

tests/etnaviv/state.xml.h new file +375 -0

375 lines not on this page · raw message

tests/etnaviv/state_2d.xml.h new file +1497 -0

1,497 lines not on this page · raw message

tests/etnaviv/write_bmp.c new file +152 -0

152 lines not on this page · raw message

tests/etnaviv/write_bmp.h new file +34 -0
new file mode 100644
index 0000000..667fa87
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2011      Luc Verhaegen <[email protected]>
+ *
+ * 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, sub license,
+ * 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 NON-INFRINGEMENT. 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.
+ *
+ */
+#ifndef BMP_DUMP_H
+#define BMP_DUMP_H 1
+#include <stdbool.h>
+/* write 32-bit image (y axis upwards) */
+void bmp_dump32(char *buffer, unsigned width, unsigned height, bool bgra, const char *filename);
+/* write 32-bit image (y axis downwards) */
+void bmp_dump32_noflip(char *buffer, unsigned width, unsigned height, bool bgra, const char *filename);
+/* write 32-bit image */
+void bmp_dump32_ex(char *buffer, unsigned width, unsigned height, bool flip, bool bgra, bool alpha, const char *filename);
+
+#endif /* BMP_DUMP_H */
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel