All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 00/22] RFC: meson build system support
@ 2017-09-05 12:36 Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
                   ` (33 more replies)
  0 siblings, 34 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Hi all,

Ok, this time around a proper patch series with cover letter and a pile of
fixes (bunch of them thanks to Eric) thrown on top.

The motivation for this has 2 primary reasons:

- I want a build system that's fast, especially for hacking on the
  library. Currently with over 300 binaries the relinking step every time
  you change the library is extremely painful.

- I want a build system that I can hack on. After years of automake, I
  still don't get it. After a few days of meson I have at least the
  illusion I understand stuff. And that's with an obviously still fairly
  fresh tool with the occasional sharp corner (lesson learned: if it
  complains about the meson files, it's a missing comman nearby).

- Finally there's the question of whether this will die like previous
  attempts at a better build toolchain, or whether the meson/ninja combo
  will win. There's a lot of very enthusastic initial conversion in
  various X.org projects, and the people I've chatted are extremely
  positive on this. I think meson/ninja could very well be the git of the
  build: Painful to use in the first years, but has the fundamental rights
  and will win in the end.

Assuming we can get some consensus around this I'd like to merge it and
polish the meson support in-tree, it's kinda growing into a bigger series
already. And of course we need to keep autohell working for probably a
fairly long time, at least for the tools that distro install.

Comments and testing very much welcom.

Cheers, Daniel

Daniel Vetter (19):
  build: Define _GNU_SOURCE in Makefile.am
  build: Nuke #ifdef HAVE_CONFIG_H cargo-cult
  build: use HAVE_LIBGEN_H consistently
  build: remove _GNU_SOURCE from source files
  tests/gem_spin_batch: Fix warning
  lib: prefix frame_dump_path
  lib: clean up header includes
  tests/igt_command_line.sh: Allow testing individual tests
  lib/uwildmat: Use include paths
  demos: remove
  assembler/test: Prep work for meson
  meson: basic build system support
  lib/ioctl_wrappers: make the valgrind wrapper always emit a
    statement:w
  tests/kms_plane: Appease gcc -Wempty-body
  meson: detect cc flags
  meson: add manpage support
  meson: igt_frame also needs pixman
  meson: Minimal README update
  meson: Bump required version to 0.40

Eric Anholt (3):
  meson: Add some compiler flags to reduce warnings.
  meson: Don't build the igt audio test without gsl available.
  meson: Use static libs to handle IGT_LOG_DOMAIN.

 .gitignore                       |   1 +
 Makefile.am                      |   2 +-
 README                           |  16 +
 assembler/meson.build            |  73 +++
 assembler/test/run-test.sh       |  16 +-
 benchmarks/Makefile.am           |   2 +-
 benchmarks/gem_exec_tracer.c     |   2 -
 benchmarks/gem_latency.c         |   1 -
 benchmarks/gem_syslatency.c      |   2 -
 benchmarks/meson.build           |  36 ++
 demos/.gitignore                 |   1 -
 demos/Android.mk                 |  32 --
 demos/Makefile.am                |  12 -
 demos/Makefile.sources           |   7 -
 demos/intel_sprite_on.c          | 960 ---------------------------------------
 lib/Makefile.am                  |   1 +
 lib/drmtest.c                    |   4 +-
 lib/dummy.c                      |   0
 lib/igt_alsa.c                   |   3 +-
 lib/igt_alsa.h                   |   3 -
 lib/igt_audio.c                  |   3 +-
 lib/igt_audio.h                  |   3 -
 lib/igt_aux.c                    |   4 +-
 lib/igt_chamelium.c              |   6 +-
 lib/igt_chamelium.h              |   8 +-
 lib/igt_core.c                   |  16 +-
 lib/igt_core.h                   |   2 +-
 lib/igt_dummyload.c              |  11 +-
 lib/igt_fb.c                     |   1 -
 lib/igt_frame.c                  |  13 +-
 lib/igt_frame.h                  |   3 -
 lib/igt_gvt.c                    |  10 +-
 lib/igt_kmod.c                   |   6 +-
 lib/igt_sysfs.h                  |   1 +
 lib/igt_vgem.c                   |  10 +-
 lib/igt_vgem.h                   |   1 +
 lib/igt_x86.c                    |   2 -
 lib/intel_os.c                   |   2 -
 lib/ioctl_wrappers.c             |   6 +-
 lib/meson.build                  | 180 ++++++++
 lib/sw_sync.c                    |   4 +-
 lib/tests/Makefile.am            |   1 +
 lib/tests/igt_exit_handler.c     |   1 -
 lib/tests/meson.build            |  34 ++
 lib/uwildmat/uwildmat.c          |   2 +-
 lib/version.h.in                 |   1 +
 man/defs.rst.in                  |   5 +
 man/meson.build                  |  45 ++
 man/rst2man.sh                   |  16 +
 meson.build                      | 124 +++++
 overlay/meson.build              |  59 +++
 overlay/overlay.h                |   2 -
 overlay/x11/position.c           |   2 -
 tests/Makefile.am                |   1 +
 tests/amdgpu/amd_basic.c         |   2 -
 tests/core_get_client_auth.c     |   1 -
 tests/core_setmaster_vs_auth.c   |   1 -
 tests/debugfs_test.c             |   2 -
 tests/drm_import_export.c        |   1 -
 tests/drv_missed_irq.c           |   1 -
 tests/gem_fence_thrash.c         |   2 -
 tests/gem_fence_upload.c         |   2 -
 tests/gem_fenced_exec_thrash.c   |   2 -
 tests/gem_flink_race.c           |   1 -
 tests/gem_mmap_gtt.c             |   1 -
 tests/gem_mmap_wc.c              |   1 -
 tests/gem_persistent_relocs.c    |   1 -
 tests/gem_reloc_vs_gpu.c         |   1 -
 tests/gem_render_linear_blits.c  |   2 -
 tests/gem_reset_stats.c          |   1 -
 tests/gem_spin_batch.c           |   2 +-
 tests/gem_streaming_writes.c     |   1 -
 tests/gem_workarounds.c          |   1 -
 tests/generate_testlist.sh       |  10 +
 tests/igt_command_line.sh        |  39 +-
 tests/kms_cursor_legacy.c        |   1 -
 tests/kms_flip.c                 |   2 -
 tests/kms_plane.c                |   3 +-
 tests/kms_render.c               |   2 -
 tests/kms_setmode.c              |   2 -
 tests/meson.build                | 290 ++++++++++++
 tests/pm_rc6_residency.c         |   1 -
 tests/pm_rps.c                   |   1 -
 tests/prime_mmap.c               |   1 -
 tests/prime_self_import.c        |   1 -
 tests/testdisplay.c              |   2 -
 tests/testdisplay_hotplug.c      |   2 -
 tests/tools_test.c               |   2 -
 tools/Makefile.am                |   2 +-
 tools/aubdump.c                  |   2 -
 tools/intel_audio_dump.c         |   1 -
 tools/intel_dump_decode.c        |   1 -
 tools/intel_error_decode.c       |   1 -
 tools/intel_framebuffer_dump.c   |   1 -
 tools/intel_gpu_frequency.c      |   1 -
 tools/intel_gpu_top.c            |   2 -
 tools/intel_guc_logger.c         |   1 -
 tools/intel_gvtg_test.c          |   2 -
 tools/intel_l3_parity.c          |   3 -
 tools/intel_l3_udev_listener.c   |   5 -
 tools/meson.build                |  59 +++
 tools/null_state_gen/meson.build |  15 +
 102 files changed, 1071 insertions(+), 1169 deletions(-)
 create mode 100644 assembler/meson.build
 create mode 100644 benchmarks/meson.build
 delete mode 100644 demos/.gitignore
 delete mode 100644 demos/Android.mk
 delete mode 100644 demos/Makefile.am
 delete mode 100644 demos/Makefile.sources
 delete mode 100644 demos/intel_sprite_on.c
 create mode 100644 lib/dummy.c
 create mode 100644 lib/meson.build
 create mode 100644 lib/tests/meson.build
 create mode 100644 lib/version.h.in
 create mode 100644 man/defs.rst.in
 create mode 100644 man/meson.build
 create mode 100755 man/rst2man.sh
 create mode 100644 meson.build
 create mode 100644 overlay/meson.build
 create mode 100755 tests/generate_testlist.sh
 create mode 100644 tests/meson.build
 create mode 100644 tools/meson.build
 create mode 100644 tools/null_state_gen/meson.build

-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 16:19   ` [PATCH i-g-t] " Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 02/22] build: Nuke #ifdef HAVE_CONFIG_H cargo-cult Daniel Vetter
                   ` (32 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

In meson I want to just set this everywhere (no reason not to), and
doing so will allow us to clean up a few things.

But that means autofoo needs to follow suit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 benchmarks/Makefile.am | 2 +-
 lib/Makefile.am        | 1 +
 lib/tests/Makefile.am  | 1 +
 tests/Makefile.am      | 1 +
 tools/Makefile.am      | 2 +-
 5 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am
index 1232753917af..9d1838db1178 100644
--- a/benchmarks/Makefile.am
+++ b/benchmarks/Makefile.am
@@ -8,7 +8,7 @@ endif
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
-	    $(WERROR_CFLAGS)
+	    $(WERROR_CFLAGS) -D_GNU_SOURCE
 LDADD = $(top_builddir)/lib/libigt.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 40399be12da9..abc61640dda4 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -64,6 +64,7 @@ AM_CFLAGS = \
 	    $(ALSA_CFLAGS) \
 	    -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \
 	    -DIGT_DATADIR=\""$(pkgdatadir)"\" \
+	    -D_GNU_SOURCE \
 	    -DIGT_LOG_DOMAIN=\""$(subst _,-,$*)"\" \
 	    -pthread
 
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 91440a27a5e8..661292a16446 100644
--- a/lib/tests/Makefile.am
+++ b/lib/tests/Makefile.am
@@ -12,6 +12,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
 	-I$(srcdir)/.. \
 	-include "$(srcdir)/../../lib/check-ndebug.h" \
 	-DIGT_DATADIR=\""$(abs_srcdir)"\" \
+	-D_GNU_SOURCE
 	$(NULL)
 
 LDADD = ../libigt.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) $(TIMER_LIBS)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3d9ea87ef4ee..c7447e1fdafe 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -76,6 +76,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) -Wno-unused-result $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
+	-D_GNU_SOURCE \
 	$(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
 	$(NULL)
 
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 5991b4988865..6307a4bd54d7 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -18,7 +18,7 @@ SUBDIRS = null_state_gen registers
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
 AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
 	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \
-	    $(WERROR_CFLAGS)
+	    $(WERROR_CFLAGS) -D_GNU_SOURCE
 LDADD = $(top_builddir)/lib/libigt.la
 AM_LDFLAGS = -Wl,--as-needed
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 02/22] build: Nuke #ifdef HAVE_CONFIG_H cargo-cult
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 03/22] build: use HAVE_LIBGEN_H consistently Daniel Vetter
                   ` (31 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

We have it. Daniel Stone said the #ifdef HAVE_CONFIG_H comes from the
X11 transition to the modular build, where in the imake -> modular
build transition config.h wasn't universally available. Now we just
make this a requirement (so yeah Android better generate one too).

v2: Improve commit message a bit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_alsa.h                  | 2 --
 lib/igt_audio.h                 | 2 --
 lib/igt_chamelium.h             | 2 --
 lib/igt_frame.h                 | 2 --
 lib/igt_x86.c                   | 2 --
 lib/intel_os.c                  | 2 --
 overlay/overlay.h               | 2 --
 overlay/x11/position.c          | 2 --
 tests/amdgpu/amd_basic.c        | 2 --
 tests/debugfs_test.c            | 2 --
 tests/gem_fence_thrash.c        | 2 --
 tests/gem_fence_upload.c        | 2 --
 tests/gem_render_linear_blits.c | 2 --
 tests/kms_flip.c                | 2 --
 tests/kms_render.c              | 2 --
 tests/kms_setmode.c             | 2 --
 tests/testdisplay.c             | 2 --
 tests/testdisplay_hotplug.c     | 2 --
 tests/tools_test.c              | 2 --
 tools/intel_gpu_top.c           | 2 --
 tools/intel_gvtg_test.c         | 2 --
 tools/intel_l3_parity.c         | 2 --
 tools/intel_l3_udev_listener.c  | 2 --
 23 files changed, 46 deletions(-)

diff --git a/lib/igt_alsa.h b/lib/igt_alsa.h
index f3949d262a4f..8f7724ad9727 100644
--- a/lib/igt_alsa.h
+++ b/lib/igt_alsa.h
@@ -27,9 +27,7 @@
 #ifndef IGT_ALSA_H
 #define IGT_ALSA_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <stdbool.h>
diff --git a/lib/igt_audio.h b/lib/igt_audio.h
index 507e7ab9c661..21adfee82756 100644
--- a/lib/igt_audio.h
+++ b/lib/igt_audio.h
@@ -27,9 +27,7 @@
 #ifndef IGT_AUDIO_H
 #define IGT_AUDIO_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <stdbool.h>
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index 2a0fa234ec60..a2d626eca957 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -26,9 +26,7 @@
 #ifndef IGT_CHAMELIUM_H
 #define IGT_CHAMELIUM_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <stdbool.h>
diff --git a/lib/igt_frame.h b/lib/igt_frame.h
index 1d9bbf6a7010..680ad5bbd293 100644
--- a/lib/igt_frame.h
+++ b/lib/igt_frame.h
@@ -27,9 +27,7 @@
 #ifndef IGT_FRAME_H
 #define IGT_FRAME_H
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <stdbool.h>
diff --git a/lib/igt_x86.c b/lib/igt_x86.c
index 6f03849f6ff2..0f0963ced044 100644
--- a/lib/igt_x86.c
+++ b/lib/igt_x86.c
@@ -25,9 +25,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #ifdef HAVE_CPUID_H
 #include <cpuid.h>
diff --git a/lib/intel_os.c b/lib/intel_os.c
index e5dea6e5a619..6e0a46b3c35c 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/overlay/overlay.h b/overlay/overlay.h
index 793816d2e044..7bc7ada7eafa 100644
--- a/overlay/overlay.h
+++ b/overlay/overlay.h
@@ -25,9 +25,7 @@
 #ifndef OVERLAY_H
 #define OVERLAY_H
 
-#ifdef HAVE_CONFIG_H
 #include"config.h"
-#endif
 
 #include <cairo.h>
 
diff --git a/overlay/x11/position.c b/overlay/x11/position.c
index cd0035394086..9e3db3709ef7 100644
--- a/overlay/x11/position.c
+++ b/overlay/x11/position.c
@@ -22,9 +22,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <X11/Xlib.h>
 #ifdef HAVE_XRANDR
diff --git a/tests/amdgpu/amd_basic.c b/tests/amdgpu/amd_basic.c
index 5e44b123fcaf..9f21de65bf10 100644
--- a/tests/amdgpu/amd_basic.c
+++ b/tests/amdgpu/amd_basic.c
@@ -22,9 +22,7 @@
  * Based on libdrm/tests/amdgpu/basic_tests.c
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/debugfs_test.c b/tests/debugfs_test.c
index 1663fd41eab8..5e7805e1559e 100644
--- a/tests/debugfs_test.c
+++ b/tests/debugfs_test.c
@@ -20,9 +20,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 #include "igt.h"
 #include "igt_sysfs.h"
 #include <fcntl.h>
diff --git a/tests/gem_fence_thrash.c b/tests/gem_fence_thrash.c
index 52095f26fdca..14d026a99f71 100644
--- a/tests/gem_fence_thrash.c
+++ b/tests/gem_fence_thrash.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <unistd.h>
diff --git a/tests/gem_fence_upload.c b/tests/gem_fence_upload.c
index 7d9acdc0fcb3..f3b0e62fa7a7 100644
--- a/tests/gem_fence_upload.c
+++ b/tests/gem_fence_upload.c
@@ -25,9 +25,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <unistd.h>
diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c
index 5fc8cc5e3abe..db34d427385a 100644
--- a/tests/gem_render_linear_blits.c
+++ b/tests/gem_render_linear_blits.c
@@ -33,9 +33,7 @@
  * The goal is to simply ensure the basics work.
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <stdlib.h>
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 837ebecda733..06cb3ff29351 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -21,9 +21,7 @@
  * IN THE SOFTWARE.
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 
diff --git a/tests/kms_render.c b/tests/kms_render.c
index fd33dfb7cafe..d2208e38f84e 100644
--- a/tests/kms_render.c
+++ b/tests/kms_render.c
@@ -20,9 +20,7 @@
  * Authors:
  *    Imre Deak <imre.deak@intel.com>
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <cairo.h>
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index a7a48de44b0e..206d360607bb 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -20,9 +20,7 @@
  * Authors:
  *    Imre Deak <imre.deak@intel.com>
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <cairo.h>
diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index f2a41fa0e53b..b0156c5cf0e1 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -45,9 +45,7 @@
  *  - DP commands (e.g. poweroff)
  * - verify outputs against VBT/physical connectors
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <cairo.h>
diff --git a/tests/testdisplay_hotplug.c b/tests/testdisplay_hotplug.c
index cf1551183c56..ca1d849d978d 100644
--- a/tests/testdisplay_hotplug.c
+++ b/tests/testdisplay_hotplug.c
@@ -29,9 +29,7 @@
 #include <sys/stat.h>
 
 #include "testdisplay.h"
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 
 #ifdef HAVE_UDEV
diff --git a/tests/tools_test.c b/tests/tools_test.c
index ccd165de6ca8..3122bb4f7da2 100644
--- a/tests/tools_test.c
+++ b/tests/tools_test.c
@@ -20,9 +20,7 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  * IN THE SOFTWARE.
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 #include "igt.h"
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 3fe77f707705..7454de878dd1 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -27,9 +27,7 @@
  *
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tools/intel_gvtg_test.c b/tools/intel_gvtg_test.c
index 3db2c89bdac4..7a29fbdde7cd 100644
--- a/tools/intel_gvtg_test.c
+++ b/tools/intel_gvtg_test.c
@@ -28,9 +28,7 @@
  * TODO:
  * Enable more GVT-g related test cases.
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #include "igt.h"
 #include <errno.h>
diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c
index eb00c50d33e4..26b7caaa1576 100644
--- a/tools/intel_l3_parity.c
+++ b/tools/intel_l3_parity.c
@@ -39,9 +39,7 @@
 #include "intel_io.h"
 #include "igt_sysfs.h"
 #include "drmtest.h"
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 #ifdef HAVE_UDEV
 #include <libudev.h>
 #include <syslog.h>
diff --git a/tools/intel_l3_udev_listener.c b/tools/intel_l3_udev_listener.c
index 270bfff44f0f..57a0f0bf713b 100644
--- a/tools/intel_l3_udev_listener.c
+++ b/tools/intel_l3_udev_listener.c
@@ -21,9 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
 
 #ifdef HAVE_UDEV
 #include <libudev.h>
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 03/22] build: use HAVE_LIBGEN_H consistently
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 02/22] build: Nuke #ifdef HAVE_CONFIG_H cargo-cult Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 04/22] build: remove _GNU_SOURCE from source files Daniel Vetter
                   ` (30 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Also, we are _GNU_SOURCE, so simplify the conditions accordingly.

The next patch will remove _GNU_SOURCE everywhere else.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/drmtest.c        | 4 +---
 lib/igt_aux.c        | 4 +---
 lib/igt_core.c       | 4 +---
 lib/ioctl_wrappers.c | 4 +---
 lib/sw_sync.c        | 4 +---
 5 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 158af68283b8..8a07152c701a 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifndef ANDROID
-#define _GNU_SOURCE
-#else
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
 #endif
 #include <stdio.h>
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index d808fe3ed27a..0c83a1f48ed2 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifndef ANDROID
-#define _GNU_SOURCE
-#else
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
 #endif
 #include <stdio.h>
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 7e5aa34237f1..ff6d19fc9bad 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifndef ANDROID
-#define _GNU_SOURCE
-#else
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
 #endif
 #include <stdio.h>
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 51000bac0513..b4d6210d5942 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -26,9 +26,7 @@
  *
  */
 
-#ifndef ANDROID
-#define _GNU_SOURCE
-#else
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
 #endif
 #include <stdio.h>
diff --git a/lib/sw_sync.c b/lib/sw_sync.c
index 7bd76702c8d1..9b36dd85c192 100644
--- a/lib/sw_sync.c
+++ b/lib/sw_sync.c
@@ -24,9 +24,7 @@
  *    Robert Foss <robert.foss@collabora.com>
  */
 
-#ifndef ANDROID
-#define _GNU_SOURCE
-#else
+#ifdef HAVE_LIBGEN_H
 #include <libgen.h>
 #endif
 #include <fcntl.h>
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 04/22] build: remove _GNU_SOURCE from source files
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (2 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 03/22] build: use HAVE_LIBGEN_H consistently Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 05/22] tests/gem_spin_batch: Fix warning Daniel Vetter
                   ` (29 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

We are, the build system takes care of that.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 benchmarks/gem_exec_tracer.c   | 2 --
 benchmarks/gem_latency.c       | 1 -
 benchmarks/gem_syslatency.c    | 2 --
 lib/igt_fb.c                   | 1 -
 lib/igt_vgem.c                 | 2 --
 lib/tests/igt_exit_handler.c   | 1 -
 tests/core_get_client_auth.c   | 1 -
 tests/core_setmaster_vs_auth.c | 1 -
 tests/drm_import_export.c      | 1 -
 tests/drv_missed_irq.c         | 1 -
 tests/gem_fenced_exec_thrash.c | 2 --
 tests/gem_flink_race.c         | 1 -
 tests/gem_mmap_gtt.c           | 1 -
 tests/gem_mmap_wc.c            | 1 -
 tests/gem_persistent_relocs.c  | 1 -
 tests/gem_reloc_vs_gpu.c       | 1 -
 tests/gem_reset_stats.c        | 1 -
 tests/gem_streaming_writes.c   | 1 -
 tests/gem_workarounds.c        | 1 -
 tests/kms_cursor_legacy.c      | 1 -
 tests/pm_rc6_residency.c       | 1 -
 tests/pm_rps.c                 | 1 -
 tests/prime_mmap.c             | 1 -
 tests/prime_self_import.c      | 1 -
 tools/aubdump.c                | 2 --
 tools/intel_audio_dump.c       | 1 -
 tools/intel_dump_decode.c      | 1 -
 tools/intel_error_decode.c     | 1 -
 tools/intel_framebuffer_dump.c | 1 -
 tools/intel_gpu_frequency.c    | 1 -
 tools/intel_guc_logger.c       | 1 -
 tools/intel_l3_parity.c        | 1 -
 tools/intel_l3_udev_listener.c | 3 ---
 33 files changed, 40 deletions(-)

diff --git a/benchmarks/gem_exec_tracer.c b/benchmarks/gem_exec_tracer.c
index a49c11a967f0..8ee29b5d8916 100644
--- a/benchmarks/gem_exec_tracer.c
+++ b/benchmarks/gem_exec_tracer.c
@@ -21,8 +21,6 @@
  * IN THE SOFTWARE.
  */
 
-#define _GNU_SOURCE /* for RTLD_NEXT */
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/benchmarks/gem_latency.c b/benchmarks/gem_latency.c
index 6cb16ba4f051..c3fc4bf0f74c 100644
--- a/benchmarks/gem_latency.c
+++ b/benchmarks/gem_latency.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <pthread.h>
 
 #include "igt.h"
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index 83bfac78d02b..4ed23638e717 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -22,8 +22,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index fbdfca8ad278..95434a699dcf 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -25,7 +25,6 @@
  * 	Damien Lespiau <damien.lespiau@intel.com>
  */
 
-#define _GNU_SOURCE
 #include <stdio.h>
 #include <math.h>
 
diff --git a/lib/igt_vgem.c b/lib/igt_vgem.c
index 21cccb375c51..3dd9621d0459 100644
--- a/lib/igt_vgem.c
+++ b/lib/igt_vgem.c
@@ -21,8 +21,6 @@
  * IN THE SOFTWARE.
  */
 
-#define _GNU_SOURCE
-
 #include "igt.h"
 #include "igt_vgem.h"
 
diff --git a/lib/tests/igt_exit_handler.c b/lib/tests/igt_exit_handler.c
index d1b5a8891739..f2997bd13633 100644
--- a/lib/tests/igt_exit_handler.c
+++ b/lib/tests/igt_exit_handler.c
@@ -21,7 +21,6 @@
  * IN THE SOFTWARE.
  */
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index 50e87fac76d6..676083d5e322 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -32,7 +32,6 @@
  * Oh dear, libva, why do you do such funny things?
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tests/core_setmaster_vs_auth.c b/tests/core_setmaster_vs_auth.c
index 783033397939..f1ae0c6338fa 100644
--- a/tests/core_setmaster_vs_auth.c
+++ b/tests/core_setmaster_vs_auth.c
@@ -33,7 +33,6 @@
  * trying to authenticate a client against the wrong master.
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tests/drm_import_export.c b/tests/drm_import_export.c
index f1234bdcc411..e3ce2480c7f1 100644
--- a/tests/drm_import_export.c
+++ b/tests/drm_import_export.c
@@ -24,7 +24,6 @@
  *    Daniel Vetter <daniel.vetter@ffwll.ch>
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/tests/drv_missed_irq.c b/tests/drv_missed_irq.c
index fb81f277f5fc..469be882d39c 100644
--- a/tests/drv_missed_irq.c
+++ b/tests/drv_missed_irq.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <sched.h>
 
 #include "igt.h"
diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index e403a49155b6..9a43c845e671 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -25,8 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
-
 #include "igt.h"
 #include <stdlib.h>
 #include <sys/ioctl.h>
diff --git a/tests/gem_flink_race.c b/tests/gem_flink_race.c
index 30e33f65a7dc..9e3d3a622297 100644
--- a/tests/gem_flink_race.c
+++ b/tests/gem_flink_race.c
@@ -24,7 +24,6 @@
  *    Daniel Vetter <daniel.vetter@ffwll.ch>
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <sys/ioctl.h>
 #include <stdlib.h>
diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c
index 4ff5e7f15f81..0f5981257a01 100644
--- a/tests/gem_mmap_gtt.c
+++ b/tests/gem_mmap_gtt.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/gem_mmap_wc.c b/tests/gem_mmap_wc.c
index fd7988073075..110883eb9a61 100644
--- a/tests/gem_mmap_wc.c
+++ b/tests/gem_mmap_wc.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tests/gem_persistent_relocs.c b/tests/gem_persistent_relocs.c
index bc831ee49920..452fe686e9a5 100644
--- a/tests/gem_persistent_relocs.c
+++ b/tests/gem_persistent_relocs.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index afc31328fdc2..d421e4340d62 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index 9ac08aabf3a5..edc407676393 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include "igt_sysfs.h"
 #include <limits.h>
diff --git a/tests/gem_streaming_writes.c b/tests/gem_streaming_writes.c
index c27e7fa75dc7..e83d69debc5e 100644
--- a/tests/gem_streaming_writes.c
+++ b/tests/gem_streaming_writes.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tests/gem_workarounds.c b/tests/gem_workarounds.c
index c7286d86b7a0..d6641bd5578f 100644
--- a/tests/gem_workarounds.c
+++ b/tests/gem_workarounds.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 
 #include <fcntl.h>
diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
index bdb66f3b51b7..2d32d3a91570 100644
--- a/tests/kms_cursor_legacy.c
+++ b/tests/kms_cursor_legacy.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <sched.h>
 #include <sys/poll.h>
 
diff --git a/tests/pm_rc6_residency.c b/tests/pm_rc6_residency.c
index bdb9747a7ad9..7c87302dcab3 100644
--- a/tests/pm_rc6_residency.c
+++ b/tests/pm_rc6_residency.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include "igt_sysfs.h"
 #include <stdio.h>
diff --git a/tests/pm_rps.c b/tests/pm_rps.c
index e79f0ea7e55c..a3a6bd07968e 100644
--- a/tests/pm_rps.c
+++ b/tests/pm_rps.c
@@ -26,7 +26,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tests/prime_mmap.c b/tests/prime_mmap.c
index 1ea61c2fda0d..0da0aa681158 100644
--- a/tests/prime_mmap.c
+++ b/tests/prime_mmap.c
@@ -29,7 +29,6 @@
 /*
  * Testcase: Check whether mmap()ing dma-buf works
  */
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tests/prime_self_import.c b/tests/prime_self_import.c
index 992334d4bf7d..8c4f53218454 100644
--- a/tests/prime_self_import.c
+++ b/tests/prime_self_import.c
@@ -31,7 +31,6 @@
  * ... but with different fds, i.e. the wayland usecase.
  */
 
-#define _GNU_SOURCE
 #include "igt.h"
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 4387ea8399a2..4392e589193b 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -21,8 +21,6 @@
  * IN THE SOFTWARE.
  */
 
-#define _GNU_SOURCE /* for RTLD_NEXT */
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/tools/intel_audio_dump.c b/tools/intel_audio_dump.c
index c8d369b548cb..90260a2fe007 100644
--- a/tools/intel_audio_dump.c
+++ b/tools/intel_audio_dump.c
@@ -26,7 +26,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/tools/intel_dump_decode.c b/tools/intel_dump_decode.c
index 0341aada4016..4bb774406f96 100644
--- a/tools/intel_dump_decode.c
+++ b/tools/intel_dump_decode.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index 2cbdd8873edd..cdef3b18ad0e 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -38,7 +38,6 @@
  * decode, but never crash in the process.
  */
 
-#define _GNU_SOURCE
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/tools/intel_framebuffer_dump.c b/tools/intel_framebuffer_dump.c
index 624a96136137..79c0688b1e70 100644
--- a/tools/intel_framebuffer_dump.c
+++ b/tools/intel_framebuffer_dump.c
@@ -26,7 +26,6 @@
  * Read back all the KMS framebuffers attached to the CRTC and record as PNG.
  */
 
-#define _GNU_SOURCE
 #include <stdint.h>
 #include <sys/types.h>
 #include <sys/mman.h>
diff --git a/tools/intel_gpu_frequency.c b/tools/intel_gpu_frequency.c
index cb758b0a6481..5c439b036a16 100644
--- a/tools/intel_gpu_frequency.c
+++ b/tools/intel_gpu_frequency.c
@@ -46,7 +46,6 @@
  * intel_gpu_frequency -d
  */
 
-#define _GNU_SOURCE
 #include <assert.h>
 #include <getopt.h>
 #include <stdio.h>
diff --git a/tools/intel_guc_logger.c b/tools/intel_guc_logger.c
index 3079878e1191..7c6115a669f6 100644
--- a/tools/intel_guc_logger.c
+++ b/tools/intel_guc_logger.c
@@ -1,5 +1,4 @@
 
-#define _GNU_SOURCE  /* For using O_DIRECT */
 #include <inttypes.h>
 #include <stdio.h>
 #include <fcntl.h>
diff --git a/tools/intel_l3_parity.c b/tools/intel_l3_parity.c
index 26b7caaa1576..9df4fc2477f2 100644
--- a/tools/intel_l3_parity.c
+++ b/tools/intel_l3_parity.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <assert.h>
diff --git a/tools/intel_l3_udev_listener.c b/tools/intel_l3_udev_listener.c
index 57a0f0bf713b..94d931e507bb 100644
--- a/tools/intel_l3_udev_listener.c
+++ b/tools/intel_l3_udev_listener.c
@@ -25,9 +25,6 @@
 
 #ifdef HAVE_UDEV
 #include <libudev.h>
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 05/22] tests/gem_spin_batch: Fix warning
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (3 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 04/22] build: remove _GNU_SOURCE from source files Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 06/22] lib: prefix frame_dump_path Daniel Vetter
                   ` (28 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/gem_spin_batch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gem_spin_batch.c b/tests/gem_spin_batch.c
index 941aa1399ae1..09bb3cb37108 100644
--- a/tests/gem_spin_batch.c
+++ b/tests/gem_spin_batch.c
@@ -48,7 +48,7 @@ static void spin(int fd, unsigned int engine, unsigned int timeout_sec)
 		igt_spin_batch_set_timeout(spin,
 					   timeout_100ms - igt_nsec_elapsed(&itv));
 		gem_sync(fd, spin->handle);
-		igt_debug("loop %d: interval=%fms (target 100ms), elapsed %fms\n",
+		igt_debug("loop %lu: interval=%fms (target 100ms), elapsed %fms\n",
 			  loops,
 			  igt_nsec_elapsed(&itv) * 1e-6,
 			  igt_nsec_elapsed(&tv) * 1e-6);
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 06/22] lib: prefix frame_dump_path
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (4 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 05/22] tests/gem_spin_batch: Fix warning Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 07/22] lib: clean up header includes Daniel Vetter
                   ` (27 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Just a bit of ocd for anything non-static.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_core.c  | 12 ++++++------
 lib/igt_core.h  |  2 +-
 lib/igt_frame.c | 10 +++++-----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index ff6d19fc9bad..9f4ee68bd8f0 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -295,7 +295,7 @@ static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
 GKeyFile *igt_key_file;
 #endif
 
-char *frame_dump_path;
+char *igt_frame_dump_path;
 
 const char *igt_test_name(void)
 {
@@ -650,10 +650,10 @@ static void common_init_config(void)
 
 	g_clear_error(&error);
 
-	if (!frame_dump_path)
-		frame_dump_path = g_key_file_get_string(igt_key_file, "Common",
-							"FrameDumpPath",
-							&error);
+	if (!igt_frame_dump_path)
+		igt_frame_dump_path =
+			g_key_file_get_string(igt_key_file, "Common",
+					      "FrameDumpPath", &error);
 
 	g_clear_error(&error);
 
@@ -694,7 +694,7 @@ static void common_init_env(void)
 			igt_log_level = IGT_LOG_NONE;
 	}
 
-	frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
+	igt_frame_dump_path = getenv("IGT_FRAME_DUMP_PATH");
 }
 
 static int common_init(int *argc, char **argv,
diff --git a/lib/igt_core.h b/lib/igt_core.h
index 22b8c2230ea4..c90ae2de35ee 100644
--- a/lib/igt_core.h
+++ b/lib/igt_core.h
@@ -50,7 +50,7 @@
 extern const char* __igt_test_description __attribute__((weak));
 extern bool __igt_plain_output;
 extern GKeyFile *igt_key_file;
-extern char *frame_dump_path;
+extern char *igt_frame_dump_path;
 
 /**
  * IGT_TEST_DESCRIPTION:
diff --git a/lib/igt_frame.c b/lib/igt_frame.c
index 222a45f801f3..0f6bca243e39 100644
--- a/lib/igt_frame.c
+++ b/lib/igt_frame.c
@@ -53,7 +53,7 @@
  */
 bool igt_frame_dump_is_enabled(void)
 {
-	return frame_dump_path != NULL;
+	return igt_frame_dump_path != NULL;
 }
 
 static void igt_write_frame_to_png(cairo_surface_t *surface, int fd,
@@ -70,11 +70,11 @@ static void igt_write_frame_to_png(cairo_surface_t *surface, int fd,
 
 	if (suffix)
 		snprintf(path, PATH_MAX, "%s/frame-%s-%s-%s-%s.png",
-			 frame_dump_path, test_name, subtest_name, qualifier,
+			 igt_frame_dump_path, test_name, subtest_name, qualifier,
 			 suffix);
 	else
 		snprintf(path, PATH_MAX, "%s/frame-%s-%s-%s.png",
-			 frame_dump_path, test_name, subtest_name, qualifier);
+			 igt_frame_dump_path, test_name, subtest_name, qualifier);
 
 	igt_debug("Dumping %s frame to %s...\n", qualifier, path);
 
@@ -122,10 +122,10 @@ void igt_write_compared_frames_to_png(cairo_surface_t *reference,
 
 	if (id)
 		snprintf(path, PATH_MAX, "%s/frame-%s-%s-%s.txt",
-			 frame_dump_path, test_name, subtest_name, id);
+			 igt_frame_dump_path, test_name, subtest_name, id);
 	else
 		snprintf(path, PATH_MAX, "%s/frame-%s-%s.txt",
-			 frame_dump_path, test_name, subtest_name);
+			 igt_frame_dump_path, test_name, subtest_name);
 
 	fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
 	igt_assert(fd >= 0);
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 07/22] lib: clean up header includes
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (5 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 06/22] lib: prefix frame_dump_path Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-06 11:44   ` Chris Wilson
  2017-09-08  9:23   ` [PATCH i-g-t] " Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests Daniel Vetter
                   ` (26 subsequent siblings)
  33 siblings, 2 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Just a bit of OCD, I like it when connections within library modules
are a bit more obvious. igt.h is ok for tests, but let's use individual
include lines for libraries consistently.

Also order standard includes before igt ones.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_alsa.c      |  3 ++-
 lib/igt_alsa.h      |  1 -
 lib/igt_audio.c     |  3 ++-
 lib/igt_audio.h     |  1 -
 lib/igt_chamelium.c |  6 +++++-
 lib/igt_chamelium.h |  6 +++++-
 lib/igt_dummyload.c | 11 +++++++++--
 lib/igt_frame.c     |  3 ++-
 lib/igt_frame.h     |  1 -
 lib/igt_gvt.c       | 10 +++++-----
 lib/igt_kmod.c      |  6 +++---
 lib/igt_sysfs.h     |  1 +
 lib/igt_vgem.c      | 10 +++++++---
 lib/igt_vgem.h      |  1 +
 14 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
index b5574c7622a1..3ad0521aa6ee 100644
--- a/lib/igt_alsa.c
+++ b/lib/igt_alsa.c
@@ -28,7 +28,8 @@
 
 #include <alsa/asoundlib.h>
 
-#include "igt.h"
+#include "igt_alsa.h"
+#include "igt_core.h"
 
 #define HANDLES_MAX	8
 
diff --git a/lib/igt_alsa.h b/lib/igt_alsa.h
index 8f7724ad9727..50795130a4f8 100644
--- a/lib/igt_alsa.h
+++ b/lib/igt_alsa.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 struct alsa;
diff --git a/lib/igt_audio.c b/lib/igt_audio.c
index 6b35529aa224..2321d1c6e3f1 100644
--- a/lib/igt_audio.c
+++ b/lib/igt_audio.c
@@ -29,7 +29,8 @@
 #include <math.h>
 #include <gsl/gsl_fft_real.h>
 
-#include "igt.h"
+#include "igt_audio.h"
+#include "igt_core.h"
 
 #define FREQS_MAX	8
 
diff --git a/lib/igt_audio.h b/lib/igt_audio.h
index 21adfee82756..b3b658a4017f 100644
--- a/lib/igt_audio.h
+++ b/lib/igt_audio.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 struct audio_signal;
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index dcd8855f3d1b..fb250366ca2c 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -35,7 +35,11 @@
 #include <pixman.h>
 #include <cairo.h>
 
-#include "igt.h"
+#include "igt_chamelium.h"
+#include "igt_core.h"
+#include "igt_aux.h"
+#include "igt_kms.h"
+#include "igt_frame.h"
 
 /**
  * SECTION:igt_chamelium
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index a2d626eca957..af9655a0b1cf 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -28,8 +28,12 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
+#include <xf86drmMode.h>
+
+#include "igt_debugfs.h"
+
+struct igt_fb;
 
 struct chamelium;
 struct chamelium_port;
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index f2a94b5572ea..a2061ff6138e 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -22,11 +22,18 @@
  *
  */
 
-#include "igt.h"
-#include "igt_dummyload.h"
 #include <time.h>
 #include <signal.h>
 #include <sys/syscall.h>
+#include <sys/mman.h>
+
+#include <i915_drm.h>
+
+#include "igt_dummyload.h"
+#include "igt_gt.h"
+#include "intel_batchbuffer.h"
+#include "intel_chipset.h"
+#include "ioctl_wrappers.h"
 
 /**
  * SECTION:igt_dummyload
diff --git a/lib/igt_frame.c b/lib/igt_frame.c
index 0f6bca243e39..6984c02e9912 100644
--- a/lib/igt_frame.c
+++ b/lib/igt_frame.c
@@ -32,7 +32,8 @@
 #include <gsl/gsl_statistics_double.h>
 #include <gsl/gsl_fit.h>
 
-#include "igt.h"
+#include "igt_frame.h"
+#include "igt_core.h"
 
 /**
  * SECTION:igt_frame
diff --git a/lib/igt_frame.h b/lib/igt_frame.h
index 680ad5bbd293..11f96cbea203 100644
--- a/lib/igt_frame.h
+++ b/lib/igt_frame.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 bool igt_frame_dump_is_enabled(void);
diff --git a/lib/igt_gvt.c b/lib/igt_gvt.c
index a78e98e9f233..acbc349145ce 100644
--- a/lib/igt_gvt.c
+++ b/lib/igt_gvt.c
@@ -21,16 +21,16 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
-#include "igt_gvt.h"
-#include "igt_sysfs.h"
-#include "igt_kmod.h"
-
 #include <signal.h>
 #include <dirent.h>
 #include <unistd.h>
 #include <fcntl.h>
 
+#include "igt_gvt.h"
+#include "igt_sysfs.h"
+#include "igt_kmod.h"
+#include "drmtest.h"
+
 /**
  * SECTION:igt_gvt
  * @short_description: Graphics virtualization technology library
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 26691e308cbd..58624cd12f32 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -21,13 +21,13 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
+#include <signal.h>
+#include <errno.h>
+
 #include "igt_core.h"
 #include "igt_sysfs.h"
 #include "igt_kmod.h"
 
-#include <signal.h>
-
 /**
  * SECTION:igt_kmod
  * @short_description: Wrappers around libkmod for module loading/unloading
diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h
index d666438a667a..07e75042307a 100644
--- a/lib/igt_sysfs.h
+++ b/lib/igt_sysfs.h
@@ -26,6 +26,7 @@
 #define __IGT_SYSFS_H__
 
 #include <stdbool.h>
+#include <stdarg.h>
 
 int igt_sysfs_open(int device, int *idx);
 int igt_sysfs_open_parameters(int device);
diff --git a/lib/igt_vgem.c b/lib/igt_vgem.c
index 3dd9621d0459..7f933b23bd4f 100644
--- a/lib/igt_vgem.c
+++ b/lib/igt_vgem.c
@@ -21,10 +21,14 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
-#include "igt_vgem.h"
-
 #include <sys/mman.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+#include <errno.h>
+
+#include "igt_vgem.h"
+#include "igt_core.h"
+#include "ioctl_wrappers.h"
 
 /**
  * SECTION:igt_vgem
diff --git a/lib/igt_vgem.h b/lib/igt_vgem.h
index 002ad7f09ceb..92045f0e7a81 100644
--- a/lib/igt_vgem.h
+++ b/lib/igt_vgem.h
@@ -25,6 +25,7 @@
 #define IGT_VGEM_H
 
 #include <stdint.h>
+#include <stdbool.h>
 
 struct vgem_bo {
 	uint32_t handle;
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (6 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 07/22] lib: clean up header includes Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 16:43   ` [PATCH i-g-t] " Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 09/22] lib/uwildmat: Use include paths Daniel Vetter
                   ` (25 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

meso will use this to run the tests for all testcases in parallel, for
great speedup!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/igt_command_line.sh | 39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc805d37..f98a584a8ea3 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -37,24 +37,16 @@ fi
 # Manually running this script is possible in the source root or the
 # tests directory.
 
-TESTLISTFILE="$tests_dir/test-list.txt"
-if [ ! -r "$TESTLISTFILE" ]; then
-	tests_dir="tests"
-	TESTLISTFILE="$tests_dir/test-list.txt"
-fi
-
-TESTLIST=`cat $TESTLISTFILE`
-if [ $? -ne 0 ]; then
-	echo "Error: Could not read test lists"
-	exit 99
-fi
-
 fail () {
 	echo "FAIL: $1"
 	exit 1
 }
 
-for test in $TESTLIST; do
+function check_test () {
+	local test
+
+	test=$1
+
 	if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then
 		continue
 	fi
@@ -105,4 +97,25 @@ for test in $TESTLIST; do
 	# check invalid subtest handling
 	echo "  Checking invalid subtest handling..."
 	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
+}
+
+TESTLISTFILE="$tests_dir/test-list.txt"
+if [ ! -r "$TESTLISTFILE" ]; then
+	tests_dir="tests"
+	TESTLISTFILE="$tests_dir/test-list.txt"
+fi
+
+TESTLIST=`cat $TESTLISTFILE`
+if [ $? -ne 0 ]; then
+	echo "Error: Could not read test lists"
+	exit 99
+fi
+
+if [[ "$1" != "" ]] ; then
+	check_test $1
+	exit 0
+fi
+
+for test in $TESTLIST; do
+	check_test $test
 done
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 09/22] lib/uwildmat: Use include paths
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (7 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 10/22] demos: remove Daniel Vetter
                   ` (24 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

meson runs gcc from where meson.build that includes those files is,
which means we need to add the directory ourselves.

For automake it doesn't matter, so let's just do it for simplicity.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/uwildmat/uwildmat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/uwildmat/uwildmat.c b/lib/uwildmat/uwildmat.c
index fac2319e1a8c..09155865de7b 100644
--- a/lib/uwildmat/uwildmat.c
+++ b/lib/uwildmat/uwildmat.c
@@ -95,7 +95,7 @@
 
 #include <string.h>
 #include <stdint.h>
-#include "uwildmat.h"
+#include "uwildmat/uwildmat.h"
 
 #define ABORT -1
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 10/22] demos: remove
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (8 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 09/22] lib/uwildmat: Use include paths Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 16:20   ` [PATCH i-g-t] " Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 11/22] assembler/test: Prep work for meson Daniel Vetter
                   ` (23 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

The igt testcase themselves contain plenty of demos, libdrm
also contains a bunch of demos, this here just bitrots.

So let's remove it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 Makefile.am             |   2 +-
 demos/.gitignore        |   1 -
 demos/Android.mk        |  32 --
 demos/Makefile.am       |  12 -
 demos/Makefile.sources  |   7 -
 demos/intel_sprite_on.c | 960 ------------------------------------------------
 6 files changed, 1 insertion(+), 1013 deletions(-)
 delete mode 100644 demos/.gitignore
 delete mode 100644 demos/Android.mk
 delete mode 100644 demos/Makefile.am
 delete mode 100644 demos/Makefile.sources
 delete mode 100644 demos/intel_sprite_on.c

diff --git a/Makefile.am b/Makefile.am
index 601686282c64..8c25402789f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ if BUILD_SHADER_DEBUGGER
 SUBDIRS += debugger
 endif
 
-SUBDIRS += overlay demos benchmarks
+SUBDIRS += overlay benchmarks
 endif
 
 SUBDIRS += docs
diff --git a/demos/.gitignore b/demos/.gitignore
deleted file mode 100644
index cd80b0b5f259..000000000000
--- a/demos/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-intel_sprite_on
diff --git a/demos/Android.mk b/demos/Android.mk
deleted file mode 100644
index 1f50fdcb7e82..000000000000
--- a/demos/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#================#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(demos_prog_lists)
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN)
-endif
-
-LOCAL_CFLAGS += -DHAVE_TERMIOS_H
-LOCAL_CFLAGS += -DANDROID -UNDEBUG
-LOCAL_CFLAGS += -std=gnu99
-# Excessive complaining for established cases. Rely on the Linux version warnings.
-LOCAL_CFLAGS += -Wno-sign-compare
-
-LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                   $(LOCAL_PATH)/../lib/stubs/drm/
-
-LOCAL_MODULE := intel_sprite_on
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-include $(BUILD_EXECUTABLE)
-
-#================#
diff --git a/demos/Makefile.am b/demos/Makefile.am
deleted file mode 100644
index 031595c1f52f..000000000000
--- a/demos/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-include Makefile.sources
-
-bin_PROGRAMS = $(demos_prog_list)
-
-if HAVE_LIBDRM_INTEL
-	bin_PROGRAMS += $(LIBDRM_INTEL_BIN)
-endif
-
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
-AM_CFLAGS = $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
-	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS)
-LDADD = $(top_builddir)/lib/libigt.la
diff --git a/demos/Makefile.sources b/demos/Makefile.sources
deleted file mode 100644
index aea363f9ba17..000000000000
--- a/demos/Makefile.sources
+++ /dev/null
@@ -1,7 +0,0 @@
-demos_prog_list =		\
-	$(NULL)
-
-LIBDRM_INTEL_BIN =		\
-	intel_sprite_on		\
-	$(NULL)
-
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
deleted file mode 100644
index a3ece09955aa..000000000000
--- a/demos/intel_sprite_on.c
+++ /dev/null
@@ -1,960 +0,0 @@
-/*
- * 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.
- *
- *
- * Author:
- *   Armin Reese <armin.c.reese@intel.com>
- */
-
-/*
- * This program is intended for testing sprite functionality.
- */
-#include <assert.h>
-#include <errno.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <termios.h>
-#include <sys/time.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-
-#include "i915_drm.h"
-#include "drmtest.h"
-#include "igt_kms.h"
-
-#include "ioctl_wrappers.h"
-
-/*
- * Mode setting with the kernel interfaces is a bit of a chore.
- * First you have to find the connector in question and make sure the
- * requested mode is available.
- * Then you need to find the encoder attached to that connector so you
- * can bind it with a free crtc.
- */
-struct connector {
-	uint32_t            id;
-	int                 mode_valid;
-	drmModeModeInfo     mode;
-	drmModeEncoder      *encoder;
-	drmModeConnector    *connector;
-	int                 crtc;
-	int                 pipe;
-};
-
-static void dump_mode(drmModeModeInfo *mode)
-{
-	printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n",
-		mode->name,
-		mode->vrefresh,
-		mode->hdisplay,
-		mode->hsync_start,
-		mode->hsync_end,
-		mode->htotal,
-		mode->vdisplay,
-		mode->vsync_start,
-		mode->vsync_end,
-		mode->vtotal,
-		mode->flags,
-		mode->type,
-		mode->clock);
-}
-
-static void dump_connectors(int gfx_fd, drmModeRes *resources)
-{
-	int i, j;
-
-	printf("Connectors:\n");
-	printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
-	for (i = 0; i < resources->count_connectors; i++) {
-		drmModeConnector *connector;
-
-		connector = drmModeGetConnector(gfx_fd, resources->connectors[i]);
-		if (!connector) {
-			printf("could not get connector %i: %s\n",
-					resources->connectors[i], strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n",
-			connector->connector_id,
-			connector->encoder_id,
-			kmstest_connector_status_str(connector->connection),
-			kmstest_connector_type_str(connector->connector_type),
-			connector->mmWidth, connector->mmHeight,
-			connector->count_modes);
-
-		if (!connector->count_modes)
-			continue;
-
-		printf("  modes:\n");
-		printf("  name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot flags type clock\n");
-		for (j = 0; j < connector->count_modes; j++)
-			dump_mode(&connector->modes[j]);
-
-		drmModeFreeConnector(connector);
-	}
-	printf("\n");
-}
-
-static void dump_crtcs(int gfx_fd, drmModeRes *resources)
-{
-	int i;
-
-	printf("CRTCs:\n");
-	printf("id\tfb\tpos\tsize\n");
-	for (i = 0; i < resources->count_crtcs; i++) {
-		drmModeCrtc *crtc;
-
-		crtc = drmModeGetCrtc(gfx_fd, resources->crtcs[i]);
-		if (!crtc) {
-			printf("could not get crtc %i: %s\n",
-				resources->crtcs[i],
-				strerror(errno));
-			continue;
-		}
-		printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
-			crtc->crtc_id,
-			crtc->buffer_id,
-			crtc->x, crtc->y,
-			crtc->width, crtc->height);
-		dump_mode(&crtc->mode);
-
-		drmModeFreeCrtc(crtc);
-	}
-	printf("\n");
-}
-
-static void dump_planes(int gfx_fd, drmModeRes *resources)
-{
-	drmModePlaneRes             *plane_resources;
-	drmModePlane                *ovr;
-	int i;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return;
-	}
-
-	printf("Planes:\n");
-	printf("id\tcrtc\tfb\tCRTC x,y\tx,y\tgamma size\n");
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%d\t%d,%d\t\t%d,%d\t%d\n",
-			ovr->plane_id, ovr->crtc_id, ovr->fb_id,
-			ovr->crtc_x, ovr->crtc_y, ovr->x, ovr->y,
-			ovr->gamma_size);
-
-		drmModeFreePlane(ovr);
-	}
-	printf("\n");
-
-	return;
-}
-
-static void connector_find_preferred_mode(int gfx_fd,
-					  drmModeRes *gfx_resources,
-					  struct connector *c)
-{
-	drmModeConnector *connector;
-	drmModeEncoder *encoder = NULL;
-	int i, j;
-
-	/* First, find the connector & mode */
-	c->mode_valid = 0;
-	connector = drmModeGetConnector(gfx_fd, c->id);
-	if (!connector) {
-		printf("could not get connector %d: %s\n",
-			c->id,
-			strerror(errno));
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connection != DRM_MODE_CONNECTED) {
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (!connector->count_modes) {
-		printf("connector %d has no modes\n",
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connector_id != c->id) {
-		printf("connector id doesn't match (%d != %d)\n",
-			connector->connector_id,
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	for (j = 0; j < connector->count_modes; j++) {
-		c->mode = connector->modes[j];
-		if (c->mode.type & DRM_MODE_TYPE_PREFERRED) {
-			c->mode_valid = 1;
-			break;
-		}
-	}
-
-	if (!c->mode_valid) {
-		if (connector->count_modes > 0) {
-			/* use the first mode as test mode */
-			c->mode = connector->modes[0];
-			c->mode_valid = 1;
-		} else {
-			printf("failed to find any modes on connector %d\n",
-				c->id);
-			return;
-		}
-	}
-
-	/* Now get the encoder */
-	for (i = 0; i < connector->count_encoders; i++) {
-		encoder = drmModeGetEncoder(gfx_fd, connector->encoders[i]);
-
-		if (!encoder) {
-			printf("could not get encoder %i: %s\n",
-				gfx_resources->encoders[i],
-				strerror(errno));
-			drmModeFreeEncoder(encoder);
-			continue;
-		}
-
-		break;
-	}
-
-	c->encoder = encoder;
-
-	if (i == gfx_resources->count_encoders) {
-		printf("failed to find encoder\n");
-		c->mode_valid = 0;
-		return;
-	}
-
-	/* Find first CRTC not in use */
-	for (i = 0; i < gfx_resources->count_crtcs; i++) {
-		if (gfx_resources->crtcs[i] && (c->encoder->possible_crtcs & (1<<i)))
-			break;
-	}
-	c->crtc = gfx_resources->crtcs[i];
-	c->pipe = i;
-
-	gfx_resources->crtcs[i] = 0;
-
-	c->connector = connector;
-}
-
-static int connector_find_plane(int gfx_fd, struct connector *c,
-				unsigned int **sprite_plane_id)
-{
-	drmModePlaneRes *plane_resources;
-	drmModePlane *ovr;
-	int i, sprite_plane_count = 0;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return 0;
-	}
-
-	/* Allocating buffer to hold sprite plane ids of the
-         * current connector.
-         */
-	*sprite_plane_id = (unsigned int *) malloc(plane_resources->count_planes *
-						   sizeof(unsigned int));
-
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-		/* Add the available sprite id to the buffer sprite_plane_id.
-                 */
-		if (ovr->possible_crtcs & (1 << c->pipe)) {
-			(*sprite_plane_id)[sprite_plane_count++] = ovr->plane_id;
-		}
-		drmModeFreePlane(ovr);
-	}
-
-	return sprite_plane_count;
-}
-
-static int prepare_primary_surface(int fd, int prim_width, int prim_height,
-				   uint32_t *prim_handle, uint32_t *prim_stride,
-				   uint32_t *prim_size, int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *prim_fb_ptr;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for primary surface: %d\n",
-			bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = prim_width * bytes_per_pixel;
-		for (*prim_stride = 512; *prim_stride < v; *prim_stride *= 2)
-			;
-
-		v = *prim_stride * prim_height;
-		for (*prim_size = 1024*1024; *prim_size < v; *prim_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*prim_stride = (prim_width * bytes_per_pixel + 63) & ~63;
-		*prim_size = *prim_stride * prim_height;
-	}
-
-	*prim_handle = gem_create(fd, *prim_size);
-
-	if (tiled)
-		gem_set_tiling(fd, *prim_handle, I915_TILING_X, *prim_stride);
-
-	prim_fb_ptr = __gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
-
-	if (prim_fb_ptr != NULL) {
-		// Write primary surface with gray background
-		memset(prim_fb_ptr, 0x3f, *prim_size);
-		munmap(prim_fb_ptr, *prim_size);
-	}
-
-	return 0;
-}
-
-static void fill_sprite(int sprite_width, int sprite_height, int sprite_stride,
-			int sprite_index, void *sprite_fb_ptr)
-{
-	__u32                           *pLinePat0,
-					*pLinePat1,
-					*pLinePtr;
-	int                             i,
-					line;
-	int                             stripe_width;
-
-	stripe_width = ((sprite_width > 64) &&
-			(sprite_height > 64)) ? (sprite_index + 1) * 8 :
-		(sprite_index + 1) * 2;
-
-	// Note:  sprite_stride is in bytes.  pLinePat0 and pLinePat1
-	//        are both __u32 pointers
-	pLinePat0 = sprite_fb_ptr;
-	pLinePat1 = pLinePat0 + (stripe_width * (sprite_stride / sizeof(*pLinePat0)));
-
-	for (i = 0; i < sprite_width; i++) {
-		*(pLinePat0 + i) = ((i / stripe_width) & 0x1) ? 0 : ~0;
-		*(pLinePat1 + i) = ~(*(pLinePat0 + i));
-	}
-
-	for (line = 1; line < sprite_height; line++) {
-		if (line == stripe_width) {
-			continue;
-		}
-
-		pLinePtr = ((line / stripe_width) & 0x1) ? pLinePat1 : pLinePat0;
-		memcpy( pLinePat0 + ((sprite_stride / sizeof(*pLinePat0)) * line),
-				pLinePtr,
-				sprite_width * sizeof(*pLinePat0));
-	}
-
-	return;
-}
-
-static int prepare_sprite_surfaces(int fd, int sprite_width, int sprite_height,
-				   uint32_t num_surfaces, uint32_t *sprite_handles,
-				   uint32_t *sprite_stride, uint32_t *sprite_size,
-				   int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *sprite_fb_ptr;
-	int                             i;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for sprite: %d\n", bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = sprite_width * bytes_per_pixel;
-		for (*sprite_stride = 512; *sprite_stride < v; *sprite_stride *= 2)
-			;
-
-		v = *sprite_stride * sprite_height;
-		for (*sprite_size = 1024*1024; *sprite_size < v; *sprite_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*sprite_stride = (sprite_width * bytes_per_pixel + 63) & ~63;
-		*sprite_size = *sprite_stride * sprite_height;
-	}
-
-	for (i = 0; i < num_surfaces;  i++) {
-		// Create the sprite surface
-		sprite_handles[i] = gem_create(fd, *sprite_size);
-
-		if (tiled)
-			gem_set_tiling(fd, sprite_handles[i], I915_TILING_X, *sprite_stride);
-
-		// Get pointer to the surface
-		sprite_fb_ptr = __gem_mmap__gtt(fd,
-				sprite_handles[i], *sprite_size,
-				PROT_READ | PROT_WRITE);
-
-		if (sprite_fb_ptr != NULL) {
-			// Fill with checkerboard pattern
-			fill_sprite(sprite_width, sprite_height, *sprite_stride, i, sprite_fb_ptr);
-
-			munmap(sprite_fb_ptr, *sprite_size);
-		} else {
-			i--;
-			while (i >= 0) {
-				gem_close(fd, sprite_handles[i]);
-				i--;
-			}
-		}
-	}
-
-	return 0;
-}
-
-static void ricochet(int tiled, int sprite_w, int sprite_h,
-		     int out_w, int out_h, int dump_info)
-{
-	int                                 ret;
-	int                                 gfx_fd;
-	int                                 keep_moving;
-	const int                           num_surfaces = 3;
-	uint32_t                            sprite_handles[num_surfaces];
-	uint32_t                            sprite_fb_id[num_surfaces];
-	int                                 *sprite_x = NULL;
-	int                                 *sprite_y = NULL;
-	uint32_t                            sprite_stride;
-	uint32_t                            sprite_size;
-	uint32_t                            handles[4],
-					    pitches[4],
-					    offsets[4]; /* we only use [0] */
-	uint32_t                            prim_width,
-					    prim_height,
-					    prim_handle,
-					    prim_stride,
-					    prim_size,
-					    prim_fb_id;
-	struct drm_intel_sprite_colorkey    set;
-	struct connector                    curr_connector;
-	drmModeRes                          *gfx_resources;
-	struct termios                      orig_term,
-					    curr_term;
-	int                                 c_index;
-	int                                 sprite_index;
-	unsigned int                        *sprite_plane_id = NULL;
-	uint32_t                            plane_flags = 0;
-	int                                 *delta_x = NULL,
-					    *delta_y = NULL;
-	struct timeval                      stTimeVal;
-	long long                           currTime,
-	     prevFlipTime,
-	     prevMoveTime,
-	     deltaFlipTime,
-	     deltaMoveTime,
-	     SleepTime;
-	char                                key;
-	int				    sprite_plane_count = 0;
-	int 				    i;
-	int 				    found_count = 0;
-
-	// Open up I915 graphics device
-	gfx_fd = drmOpen("i915", NULL);
-	if (gfx_fd < 0) {
-		printf("Failed to load i915 driver: %s\n", strerror(errno));
-		return;
-	}
-
-	// Obtain pointer to struct containing graphics resources
-	gfx_resources = drmModeGetResources(gfx_fd);
-	if (!gfx_resources) {
-		printf("drmModeGetResources failed: %s\n", strerror(errno));
-		return;
-	}
-
-	if (dump_info != 0) {
-		dump_connectors(gfx_fd, gfx_resources);
-		dump_crtcs(gfx_fd, gfx_resources);
-		dump_planes(gfx_fd, gfx_resources);
-	}
-
-	// Save previous terminal settings
-	if (tcgetattr( 0, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n",
-				strerror(errno));
-		return;
-	}
-
-	// Set up input to return characters immediately
-	curr_term = orig_term;
-	curr_term.c_lflag &= ~(ICANON | ECHO | ECHONL);
-	curr_term.c_cc[VMIN] = 0;       // No minimum number of characters
-	curr_term.c_cc[VTIME] = 0 ;     // Return immediately, even if
-	// nothing has been entered.
-	if (tcsetattr( 0, TCSANOW, &curr_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	// Cycle through all connectors and display the flying sprite
-	// where there are displays attached and the hardware will support it.
-	for (c_index = 0; c_index < gfx_resources->count_connectors; c_index++)  {
-		curr_connector.id = gfx_resources->connectors[c_index];
-
-		// Find the native (preferred) display mode
-		connector_find_preferred_mode(gfx_fd, gfx_resources, &curr_connector);
-		if (curr_connector.mode_valid == 0) {
-
-			if (((c_index + 1) == gfx_resources->count_connectors) &&
-			    (found_count == 0))
-				printf("Failed to find any valid connections.\n");
-			continue;
-		}
-
-		found_count++;
-
-		// Determine if sprite hardware is available on pipe
-		// associated with this connector.
-		sprite_plane_count = connector_find_plane(gfx_fd, &curr_connector,
-							  &sprite_plane_id);
-		if (!sprite_plane_count) {
-			printf("Failed to find sprite plane on crtc\n");
-			goto out;
-		}
-
-		// Width and height of preferred mode
-		prim_width = curr_connector.mode.hdisplay;
-		prim_height = curr_connector.mode.vdisplay;
-
-		// Allocate and fill memory for primary surface
-		ret = prepare_primary_surface(
-				gfx_fd,
-				prim_width,
-				prim_height,
-				&prim_handle,
-				&prim_stride,
-				&prim_size,
-				tiled);
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-				prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Add the primary surface framebuffer
-		ret = drmModeAddFB(gfx_fd, prim_width, prim_height, 24, 32,
-				   prim_stride, prim_handle, &prim_fb_id);
-		gem_close(gfx_fd, prim_handle);
-
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-					prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Allocate and fill sprite surfaces
-		ret = prepare_sprite_surfaces(gfx_fd, sprite_w, sprite_h, num_surfaces,
-					      &sprite_handles[0],
-					      &sprite_stride, &sprite_size,
-					      tiled);
-		if (ret != 0) {
-			printf("Preparation of sprite surfaces failed %dx%d\n",
-				sprite_w, sprite_h);
-			goto out;
-		}
-
-		// Add the sprite framebuffers
-		for (sprite_index = 0; sprite_index < num_surfaces; sprite_index++) {
-			handles[0] = sprite_handles[sprite_index];
-			handles[1] = handles[0];
-			handles[2] = handles[0];
-			handles[3] = handles[0];
-			pitches[0] = sprite_stride;
-			pitches[1] = sprite_stride;
-			pitches[2] = sprite_stride;
-			pitches[3] = sprite_stride;
-			memset(offsets, 0, sizeof(offsets));
-
-			ret = drmModeAddFB2(gfx_fd, sprite_w, sprite_h,
-					    DRM_FORMAT_XRGB8888,
-					    handles, pitches, offsets,
-					    &sprite_fb_id[sprite_index], plane_flags);
-			gem_close(gfx_fd, sprite_handles[sprite_index]);
-
-			if (ret) {
-				printf("Failed to add sprite fb (%dx%d): %s\n",
-				       sprite_w, sprite_h, strerror(errno));
-
-				sprite_index--;
-				while (sprite_index >= 0) {
-					drmModeRmFB(gfx_fd, sprite_fb_id[sprite_index]);
-					sprite_index--;
-				}
-				goto out;
-			}
-		}
-
-		if (dump_info != 0) {
-			printf("Displayed Mode Connector struct:\n"
-				"    .id = %d\n"
-				"    .mode_valid = %d\n"
-				"    .crtc = %d\n"
-				"    .pipe = %d\n"
-				"    drmModeModeInfo ...\n"
-				"        .name = %s\n"
-				"        .type = %d\n"
-				"        .flags = %08x\n"
-				"    drmModeEncoder ...\n"
-				"        .encoder_id = %d\n"
-				"        .encoder_type = %d (%s)\n"
-				"        .crtc_id = %d\n"
-				"        .possible_crtcs = %d\n"
-				"        .possible_clones = %d\n"
-				"    drmModeConnector ...\n"
-				"        .connector_id = %d\n"
-				"        .encoder_id = %d\n"
-				"        .connector_type = %d (%s)\n"
-				"        .connector_type_id = %d\n\n",
-				curr_connector.id,
-				curr_connector.mode_valid,
-				curr_connector.crtc,
-				curr_connector.pipe,
-				curr_connector.mode.name,
-				curr_connector.mode.type,
-				curr_connector.mode.flags,
-				curr_connector.encoder->encoder_id,
-				curr_connector.encoder->encoder_type,
-				kmstest_encoder_type_str(curr_connector.encoder->encoder_type),
-				curr_connector.encoder->crtc_id,
-				curr_connector.encoder->possible_crtcs,
-				curr_connector.encoder->possible_clones,
-				curr_connector.connector->connector_id,
-				curr_connector.connector->encoder_id,
-				curr_connector.connector->connector_type,
-				kmstest_connector_type_str(curr_connector.connector->connector_type),
-				curr_connector.connector->connector_type_id);
-
-			printf("Sprite surface dimensions = %dx%d\n"
-				"Sprite output dimensions = %dx%d\n"
-				"Press any key to continue >\n",
-				sprite_w, sprite_h, out_w, out_h);
-
-			// Wait for a key-press
-			while( read(0, &key, 1) == 0);
-			// Purge unread characters
-			tcflush(0, TCIFLUSH);
-		}
-
-		// Set up the primary display mode
-		ret = drmModeSetCrtc(gfx_fd, curr_connector.crtc, prim_fb_id,
-				     0, 0, &curr_connector.id, 1, &curr_connector.mode);
-		if (ret != 0) {
-			printf("Failed to set mode (%dx%d@%dHz): %s\n",
-				prim_width, prim_height, curr_connector.mode.vrefresh,
-				strerror(errno));
-			continue;
-		}
-
-		// Set the sprite colorkey state
-		for(i = 0; i < sprite_plane_count; i++) {
-			set.plane_id = sprite_plane_id[i];
-			set.min_value = 0;
-			set.max_value = 0;
-			set.flags = I915_SET_COLORKEY_NONE;
-			ret = drmCommandWrite(gfx_fd, DRM_I915_SET_SPRITE_COLORKEY, &set,
-					      sizeof(set));
-			assert(ret == 0);
-		}
-
-		// Set up sprite output dimensions, initial position, etc.
-		if (out_w > prim_width / 2)
-			out_w = prim_width / 2;
-		if (out_h > prim_height / 2)
-			out_h = prim_height / 2;
-
-		delta_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		delta_y = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_y = (int *) malloc(sprite_plane_count * sizeof(int));
-
-		/* Initializing the coordinates (x,y) of the available sprites on the
-		 * connector, equally spaced along the diagonal of the rectangle
-		 * {(0,0),(prim_width/2, prim_height/2)}.
-		 */
-		for(i = 0; i < sprite_plane_count; i++) {
-			delta_x[i] = 3;
-			delta_y[i] = 4;
-			sprite_x[i] = i * (prim_width / (2 * sprite_plane_count));
-			sprite_y[i] = i * (prim_height / (2 * sprite_plane_count));
-		}
-
-		currTime = 0;
-		prevFlipTime = 0;       // Will force immediate sprite flip
-		prevMoveTime = 0;       // Will force immediate sprite move
-		deltaFlipTime = 500000; // Flip sprite surface every 1/2 second
-		deltaMoveTime = 100000; // Move sprite every 100 ms
-		sprite_index = num_surfaces - 1;
-		keep_moving = 1;
-
-		// Bounce sprite off the walls
-		while (keep_moving) {
-			// Obtain system time in usec.
-			if (gettimeofday( &stTimeVal, NULL ) != 0)
-				printf("gettimeofday error: %s\n", strerror(errno));
-			else
-				currTime = ((long long)stTimeVal.tv_sec * 1000000) + stTimeVal.tv_usec;
-
-			// Check if it's time to flip the sprite surface
-			if (currTime - prevFlipTime > deltaFlipTime) {
-				sprite_index = (sprite_index + 1) % num_surfaces;
-
-				prevFlipTime = currTime;
-			}
-
-			// Move the sprite on the screen and flip
-			// the surface if the index has changed
-			// NB: sprite_w and sprite_h must be 16.16 fixed point, herego << 16
-			for(i = 0; i < sprite_plane_count; i++) {
-				if (drmModeSetPlane(gfx_fd, sprite_plane_id[i],
-						    curr_connector.crtc,
-						    sprite_fb_id[sprite_index],
-						    plane_flags,
-						    sprite_x[i], sprite_y[i],
-						    out_w, out_h,
-						    0, 0,
-						    sprite_w << 16, sprite_h << 16))
-					printf("Failed to enable sprite plane: %s\n",
-						strerror(errno));
-			}
-
-			// Check if it's time to move the sprite surface
-			if (currTime - prevMoveTime > deltaMoveTime)  {
-
-				// Compute the next position for sprite
-				for(i = 0; i < sprite_plane_count; i++) {
-					sprite_x[i] += delta_x[i];
-					sprite_y[i] += delta_y[i];
-					if (sprite_x[i] < 0) {
-						sprite_x[i] = 0;
-						delta_x[i] = -delta_x[i];
-					}
-					else if (sprite_x[i] > prim_width - out_w) {
-						sprite_x[i] = prim_width - out_w;
-						delta_x[i] = -delta_x[i];
-					}
-
-					if (sprite_y[i] < 0) {
-						sprite_y[i] = 0;
-						delta_y[i] = -delta_y[i];
-					}
-					else if (sprite_y[i] > prim_height - out_h) {
-						sprite_y[i] = prim_height - out_h;
-						delta_y[i] = -delta_y[i];
-					}
-				}
-				prevMoveTime = currTime;
-			}
-
-			// Fetch a key from input (non-blocking)
-			if (read(0, &key, 1) == 1) {
-				switch (key) {
-				case 'q':       // Kill the program
-				case 'Q':
-					goto out;
-					break;
-				case 's':       // Slow down sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 90;
-					if (deltaMoveTime > 800000) {
-						deltaMoveTime = 800000;
-					}
-					break;
-				case 'S':       // Speed up sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 110;
-					if (deltaMoveTime < 2000) {
-						deltaMoveTime = 2000;
-					}
-					break;
-				case 'f':       // Slow down sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 90;
-					if (deltaFlipTime > 1000000)
-						deltaFlipTime = 1000000;
-					break;
-				case 'F':       // Speed up sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 110;
-					if (deltaFlipTime < 20000)
-						deltaFlipTime = 20000;
-					break;
-				case 'n':       // Next connector
-				case 'N':
-					keep_moving = 0;
-					break;
-				default:
-					break;
-				}
-
-				// Purge unread characters
-				tcflush(0, TCIFLUSH);
-			}
-
-			// Wait for min of flip or move deltas
-			SleepTime = (deltaFlipTime < deltaMoveTime) ?
-				deltaFlipTime : deltaMoveTime;
-			usleep(SleepTime);
-		}
-
-		free(sprite_plane_id);
-		free(sprite_x);
-		free(sprite_y);
-		free(delta_x);
-		free(delta_y);
-		sprite_plane_id = NULL;
-		sprite_plane_count = 0;
-		sprite_x = sprite_y = delta_x = delta_y = NULL;
-	}
-
-out:
-	// Purge unread characters
-	tcflush(0, TCIFLUSH);
-	// Restore previous terminal settings
-	if (tcsetattr( 0, TCSANOW, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	drmModeFreeResources(gfx_resources);
-}
-
-static void usage(char *name)
-{
-	printf("usage: %s -s <plane width>x<plane height> [-dhto]\n"
-		"\t-d\t[optional] dump mode information\n"
-		"\t-h\t[optional] output help message\n"
-		"\t-t\t[optional] enable tiling\n"
-		"\t-o\t[optional] <output rect width>x<output rect height>\n\n"
-		"Keyboard control for sprite movement and flip rate ...\n"
-		"\t'q' or 'Q' - Quit the program\n"
-		"\t'n' or 'N' - Switch to next display\n"
-		"\t's'        - Slow sprite movement\n"
-		"\t'S'        - Speed up sprite movement\n"
-		"\t'f'        - Slow sprite surface flipping\n"
-		"\t'F'        - Speed up sprite surface flipping\n",
-		name);
-}
-
-int main(int argc, char **argv)
-{
-	int                 c;
-	int                 test_overlay = 0,
-			    enable_tiling = 0,
-			    dump_info = 0;
-	int                 plane_width = 0,
-			    plane_height = 0,
-			    out_width = 0,
-			    out_height = 0;
-	static char         optstr[] = "ds:o:th";
-
-	opterr = 0;
-	while ((c = getopt(argc, argv, optstr)) != -1) {
-		switch (c) {
-		case 'd':               // Dump information
-			dump_info = 1;
-			break;
-		case 't':               // Tiling enable
-			enable_tiling = 1;
-			break;
-		case 's':               // Surface dimensions
-			if (sscanf(optarg, "%dx%d", &plane_width, &plane_height) != 2)
-				usage(argv[0]);
-			test_overlay = 1;
-			break;
-		case 'o':               // Output dimensions
-			if (sscanf(optarg, "%dx%d", &out_width, &out_height) != 2)
-				usage(argv[0]);
-			break;
-		default:
-			printf("unknown option %c\n", c);
-			/* fall through */
-		case 'h':               // Help!
-			usage(argv[0]);
-			goto out;
-		}
-	}
-
-	if (test_overlay) {
-		if (out_width < (plane_width / 2))
-			out_width = plane_width;
-
-		if (out_height < (plane_height / 2))
-			out_height = plane_height;
-
-		ricochet(enable_tiling, plane_width, plane_height, out_width, out_height, dump_info);
-	} else {
-		printf("Sprite dimensions are required:\n");
-		usage(argv[0]);
-	}
-
-out:
-	exit(0);
-}
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 11/22] assembler/test: Prep work for meson
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (9 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 10/22] demos: remove Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 12/22] meson: basic build system support Daniel Vetter
                   ` (22 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Again we want to be able to run each testcase individually.

Also, we need to make sure the target directory for the temp files
exists - meson always builds with a build-dir outside of the source
tree.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 assembler/test/run-test.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/assembler/test/run-test.sh b/assembler/test/run-test.sh
index 20a408c61b2d..0a5252a89dc7 100644
--- a/assembler/test/run-test.sh
+++ b/assembler/test/run-test.sh
@@ -3,9 +3,17 @@
 SRCDIR=${srcdir-`pwd`}
 BUILDDIR=${top_builddir-`pwd`}
 
-${BUILDDIR}/intel-gen4asm -o TEST.out $SRCDIR/TEST.g4a
-if cmp TEST.out ${SRCDIR}/TEST.expected 2> /dev/null; then : ; else
-  echo "Output comparison for TEST"
-  diff -u ${SRCDIR}/TEST.expected TEST.out
+test="TEST"
+
+if [[ "$1" != "" ]] ; then
+	test="$1"
+fi
+
+test -d ${BUILDDIR}/test || mkdir ${BUILDDIR}/test/
+
+${BUILDDIR}/intel-gen4asm -o ${BUILDDIR}/${test}.out $SRCDIR/${test}.g4a
+if cmp ${BUILDDIR}/${test}.out ${SRCDIR}/${test}.expected 2> /dev/null; then : ; else
+  echo "Output comparison for ${test}"
+  diff -u ${SRCDIR}/${test}.expected ${test}.out
   exit 1;
 fi
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 12/22] meson: basic build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (10 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 11/22] assembler/test: Prep work for meson Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-06 14:01   ` Jani Nikula
  2017-09-05 12:36 ` [PATCH i-g-t 13/22] lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:w Daniel Vetter
                   ` (21 subsequent siblings)
  33 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Why?

Because it's fast.

Like really, really fast.

Some data (from a snb laptop, so rather lower-powered):

- Incremental build after $ touch lib/igt_core.c with meson: 0.6s
  It notices that the symbol list of the libigt.so hasn't changed and
  doesn't bother re-linking the almost 300 binaries we have. make -j 6
  for the same scenario takes 44s.

- Incremental build with nothing changed: make: 0.7s, meson: 0.2s This
  means stuff like --disable-git-hash is entirely pointless with
  meson, it's faster than a make ever can be (with 0.6s).

- Reconfigure stage: ninja reconfigure 0.8s vs. ./configure 8.6s)

- Running tests, after a full build: ninja test 6s vs. make check 24s

- Full build (i.e. including ./autogen.sh respectively meson build),
  including tests, from a pristine git checkout. automake 2m49s vs.
  meson 44s.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 .gitignore                       |   1 +
 assembler/meson.build            |  73 ++++++++++
 benchmarks/meson.build           |  36 +++++
 lib/meson.build                  | 166 ++++++++++++++++++++++
 lib/prepend_log_domain.sh        |   8 ++
 lib/tests/meson.build            |  34 +++++
 lib/version.h.in                 |   1 +
 meson.build                      | 105 ++++++++++++++
 overlay/meson.build              |  59 ++++++++
 tests/generate_testlist.sh       |  10 ++
 tests/meson.build                | 290 +++++++++++++++++++++++++++++++++++++++
 tools/meson.build                |  59 ++++++++
 tools/null_state_gen/meson.build |  15 ++
 13 files changed, 857 insertions(+)
 create mode 100644 assembler/meson.build
 create mode 100644 benchmarks/meson.build
 create mode 100644 lib/meson.build
 create mode 100755 lib/prepend_log_domain.sh
 create mode 100644 lib/tests/meson.build
 create mode 100644 lib/version.h.in
 create mode 100644 meson.build
 create mode 100644 overlay/meson.build
 create mode 100755 tests/generate_testlist.sh
 create mode 100644 tests/meson.build
 create mode 100644 tools/meson.build
 create mode 100644 tools/null_state_gen/meson.build

diff --git a/.gitignore b/.gitignore
index 6204965a0e32..e6919272d8b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -93,3 +93,4 @@ intel-gpu-tools-*/
 
 piglit
 results
+build
diff --git a/assembler/meson.build b/assembler/meson.build
new file mode 100644
index 000000000000..bdddd0e2db25
--- /dev/null
+++ b/assembler/meson.build
@@ -0,0 +1,73 @@
+lib_brw_src = [
+	'brw_context.c',
+	'brw_disasm.c',
+	'brw_eu.c',
+	'brw_eu_compact.c',
+	'brw_eu_debug.c',
+	'brw_eu_emit.c',
+	'brw_eu_util.c',
+	'gen8_disasm.c',
+	'gen8_instruction.c',
+	'ralloc.c',
+]
+
+lib_brw = shared_library('brw', lib_brw_src,
+		dependencies : igt_deps)
+
+flex = find_program('flex')
+bison = find_program('bison')
+
+lgen = generator(flex,
+		output : '@BASENAME@.c',
+		arguments : ['-o', '@OUTPUT@', '@INPUT@'])
+
+lfiles = lgen.process('lex.l')
+
+pgen = generator(bison,
+		output : ['@BASENAME@.c', '@BASENAME@.h'],
+		arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
+
+pfiles = pgen.process('gram.y')
+
+executable('intel-gen4asm', 'main.c', lfiles, pfiles, link_with : lib_brw)
+
+executable('intel-gen4disasm', 'disasm-main.c', link_with : lib_brw)
+
+gen4asm_testcases = [
+	'test/mov',
+	'test/frc',
+	'test/rndd',
+	'test/rndu',
+	'test/rnde',
+	'test/rnde-intsrc',
+	'test/rndz',
+	'test/lzd',
+	'test/not',
+	'test/immediate',
+]
+
+# Those tests were already failing when the assembler was imported from
+# the intel-gen4asm git repository:
+#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
+# We disable them "for now" as a workaround to be able to release i-g-t
+gen4asm_testcases_broken = [
+	'test/declare',
+	'test/jmpi',
+	'test/if',
+	'test/iff',
+	'test/while',
+	'test/else',
+	'test/break',
+	'test/cont',
+	'test/halt',
+	'test/wait',
+	'test/endif',
+]
+
+test_runner = find_program('test/run-test.sh')
+foreach testcase : gen4asm_testcases
+	test('assembler: ' + testcase, test_runner,
+			args : testcase,
+			env : [ 'srcdir=' + meson.current_source_dir(),
+				'top_builddir=' + meson.current_build_dir()])
+endforeach
diff --git a/benchmarks/meson.build b/benchmarks/meson.build
new file mode 100644
index 000000000000..9ab738f76588
--- /dev/null
+++ b/benchmarks/meson.build
@@ -0,0 +1,36 @@
+benchmark_progs = [
+	'gem_blt',
+	'gem_busy',
+	'gem_create',
+	'gem_exec_ctx',
+	'gem_exec_fault',
+	'gem_exec_nop',
+	'gem_exec_reloc',
+	'gem_exec_trace',
+	'gem_latency',
+	'gem_mmap',
+	'gem_prw',
+	'gem_set_domain',
+	'gem_syslatency',
+	'gem_wsim',
+	'kms_vblank',
+	'prime_lookup',
+	'vgem_mmap',
+]
+
+if libdrm_intel.found()
+	benchmark_progs += [
+		'intel_upload_blit_large',
+		'intel_upload_blit_large_gtt',
+		'intel_upload_blit_large_map',
+		'intel_upload_blit_small',
+		'gem_userptr_benchmark',
+	]
+endif
+
+foreach prog : benchmark_progs
+	# FIXME meson doesn't like binaries with the same name
+	# meanwhile just suffix with _bench
+	executable(prog + '_bench', prog + '.c',
+			dependencies : test_deps)
+endforeach
diff --git a/lib/meson.build b/lib/meson.build
new file mode 100644
index 000000000000..51d3f9e278da
--- /dev/null
+++ b/lib/meson.build
@@ -0,0 +1,166 @@
+lib_headers = [
+	'debug.h',
+	'drmtest.h',
+	'i830_reg.h',
+	'i915_3d.h',
+	'i915_reg.h',
+	'i915_pciids.h',
+	'igt.h',
+	'igt_debugfs.h',
+	'igt_aux.h',
+	'igt_edid_template.h',
+	'igt_gt.h',
+	'igt_gvt.h',
+	'igt_primes.h',
+	'igt_rand.h',
+	'igt_stats.h',
+	'igt_sysfs.h',
+	'igt_x86.h',
+	'igt_vgem.h',
+	'instdone.h',
+	'intel_batchbuffer.h',
+	'intel_chipset.h',
+	'intel_io.h',
+	'intel_reg.h',
+	'ioctl_wrappers.h',
+	'media_fill.h',
+	'media_spin.h',
+	'gpgpu_fill.h',
+	'gen7_media.h',
+	'gen8_media.h',
+	'gen6_render.h',
+	'gen7_render.h',
+	'gen8_render.h',
+	'gen9_render.h',
+	'rendercopy.h',
+	'sw_sync.h',
+	'igt_kms.h',
+	'igt_fb.h',
+	'igt_core.h',
+	'igt_draw.h',
+	'igt_pm.h',
+	'igt_dummyload.h',
+	'uwildmat/uwildmat.h',
+	'igt_kmod.h',
+]
+
+lib_sources = [
+	'drmtest.c',
+	'igt_debugfs.c',
+	'igt_aux.c',
+	'igt_gt.c',
+	'igt_gvt.c',
+	'igt_primes.c',
+	'igt_rand.c',
+	'igt_stats.c',
+	'igt_sysfs.c',
+	'igt_x86.c',
+	'igt_vgem.c',
+	'instdone.c',
+	'intel_batchbuffer.c',
+	'intel_chipset.c',
+	'intel_device_info.c',
+	'intel_os.c',
+	'intel_mmio.c',
+	'ioctl_wrappers.c',
+	'media_fill_gen7.c',
+	'media_fill_gen8.c',
+	'media_fill_gen8lp.c',
+	'media_fill_gen9.c',
+	'media_spin.c',
+	'gpgpu_fill.c',
+	'rendercopy_i915.c',
+	'rendercopy_i830.c',
+	'rendercopy_gen6.c',
+	'rendercopy_gen7.c',
+	'rendercopy_gen8.c',
+	'rendercopy_gen9.c',
+	'sw_sync.c',
+	'intel_reg_map.c',
+	'intel_iosf.c',
+	'igt_kms.c',
+	'igt_fb.c',
+	'igt_core.c',
+	'igt_draw.c',
+	'igt_pm.c',
+	'igt_dummyload.c',
+	'uwildmat/uwildmat.c',
+	'igt_kmod.c',
+]
+
+lib_deps = [
+	cairo,
+	glib,
+	libdrm,
+	libkmod,
+	libprocps,
+	libudev,
+	libunwind,
+	pciaccess,
+	pthreads,
+	math,
+	realtime,
+]
+
+if libdrm_intel.found()
+	lib_deps += libdrm_intel
+else
+	lib_headers += 'stubs/drm/intel_bufmgr.h'
+	lib_sources += 'stubs/drm/intel_bufmgr.c'
+endif
+
+if libdrm_vc4.found()
+	lib_headers += 'igt_vc4.h'
+	lib_sources += 'igt_vc4.c'
+endif
+if valgrind.found()
+	lib_deps += valgrind
+endif
+
+if gsl.found()
+	lib_deps += gsl
+	lib_headers += [ 'igt_frame.h', 'igt_audio.h' ]
+	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
+endif
+
+if alsa.found()
+	lib_deps += alsa
+	lib_headers += 'igt_alsa.h'
+	lib_sources += 'igt_alsa.c'
+endif
+
+if chamelium.found()
+	lib_deps += chamelium
+	lib_headers += 'igt_chamelium.h'
+	lib_sources += 'igt_chamelium.c'
+endif
+
+install_headers(lib_headers)
+
+pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
+srcdir = join_paths(meson.source_root(), 'tests')
+
+vcs_tag(input : 'version.h.in', output : 'version.h',
+	fallback : 'NO-GIT',
+	command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] )
+
+# FIXME we don't regenerate when the script changes
+prepend_log_domain = generator(find_program('prepend_log_domain.sh'),
+		arguments : [ '@INPUT@', '@OUTPUT@' ],
+		output : '@PLAINNAME@' + '.pre.c')
+
+processed_src_dep = prepend_log_domain.process(lib_sources)
+
+lib_igt_build = shared_library('igt',
+			 processed_src_dep,
+			 include_directories : inc,
+			 dependencies : lib_deps,
+			 c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
+				'-DIGT_SRCDIR="@0@"'.format(srcdir), ])
+
+lib_igt = declare_dependency(link_with : lib_igt_build,
+			    include_directories : inc)
+
+igt_deps = [ lib_igt ] + lib_deps
+
+subdir('tests')
diff --git a/lib/prepend_log_domain.sh b/lib/prepend_log_domain.sh
new file mode 100755
index 000000000000..93a911508b7f
--- /dev/null
+++ b/lib/prepend_log_domain.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+input=$1
+output=$2
+basename=$(basename $1 .c)
+
+echo "#define IGT_LOG_DOMAIN \"$basename\"" > $output
+cat $input >> $output
diff --git a/lib/tests/meson.build b/lib/tests/meson.build
new file mode 100644
index 000000000000..29bdb2c4222c
--- /dev/null
+++ b/lib/tests/meson.build
@@ -0,0 +1,34 @@
+lib_tests = [
+	'igt_fork_helper',
+	'igt_list_only',
+	'igt_simulation',
+	'igt_stats',
+	'igt_segfault',
+	'igt_subtest_group',
+	'igt_assert',
+	'igt_exit_handler',
+	'igt_hdmi_inject',
+	'igt_can_fail',
+	'igt_can_fail_simple',
+]
+
+lib_fail_tests = [
+	'igt_no_exit',
+	'igt_no_exit_list_only',
+	'igt_no_subtest',
+	'igt_simple_test_subtests',
+	'igt_timeout',
+	'igt_invalid_subtest_name',
+]
+
+foreach lib_test : lib_tests
+	exec = executable(lib_test, lib_test + '.c', install : true,
+			dependencies : igt_deps)
+	test('lib: ' + lib_test, exec)
+endforeach
+
+foreach lib_test : lib_fail_tests
+	exec = executable(lib_test, lib_test + '.c', install : true,
+			dependencies : igt_deps)
+	test('lib: ' + lib_test, exec, should_fail : true)
+endforeach
diff --git a/lib/version.h.in b/lib/version.h.in
new file mode 100644
index 000000000000..72fc6978cf32
--- /dev/null
+++ b/lib/version.h.in
@@ -0,0 +1 @@
+#define IGT_GIT_SHA1 "@VCS_TAG@"
diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000000..fee64fcdf36e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,105 @@
+project('IGT gpu tests', 'c',
+	version : '1.19',
+        default_options: [
+          'warning_level=2',
+          'c_std=gnu99',
+        ],
+	license : 'MIT')
+
+cc = meson.get_compiler('c')
+
+inc = include_directories('lib', '.')
+
+config_h = configuration_data()
+
+libdrm = dependency('libdrm', version : '>=2.4.82')
+libdrm_intel = dependency('libdrm_intel', required : false)
+libdrm_vc4 = dependency('libdrm_vc4', required : false)
+libdrm_nouveau = dependency('libdrm_nouveau', required : false)
+libdrm_amdgpu = dependency('libdrm_amdgpu', required : false)
+
+pciaccess = dependency('pciaccess', version : '>=0.10')
+libkmod = dependency('libkmod')
+libprocps = dependency('libprocps', required : false)
+if libprocps.found()
+	config_h.set('HAVE_PROCPS', 1)
+endif
+
+valgrind = dependency('valgrind', required : false)
+if valgrind.found()
+	config_h.set('HAVE_VALGRIND', 1)
+endif
+
+cairo = dependency('cairo', version : '>1.12.0', required : false)
+
+libudev = dependency('libudev', required : false)
+if libudev.found()
+	config_h.set('HAVE_UDEV', 1)
+endif
+
+glib = dependency('glib-2.0', required : false)
+if glib.found()
+	config_h.set('HAVE_GLIB', 1)
+endif
+
+libunwind = dependency('libunwind')
+gsl = dependency('gsl', required : false)
+alsa = dependency('alsa', required : false)
+
+pixman = dependency('pixman-1', required : false)
+xmlrpc = dependency('xmlrpc', required : false)
+xmlrpc_util = dependency('xmlrpc_util', required : false)
+xmlrpc_client = dependency('xmlrpc_client', required : false)
+
+if pixman.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
+	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
+	  xmlrpc_util, xmlrpc_client])
+else
+	chamelium = dependency('', required: false)
+endif
+
+pthreads = dependency('threads')
+math = cc.find_library('m')
+realtime = cc.find_library('rt')
+dlsym = cc.find_library('dl')
+zlib = cc.find_library('z')
+
+if cc.has_header('linux/kd.h')
+	config_h.set('HAVE_LINUX_KD_H', 1)
+endif
+if cc.has_header('sys/kd.h')
+	config_h.set('HAVE_SYS_KD_H', 1)
+endif
+if cc.has_header('libgen.h')
+	config_h.set('HAVE_LIBGEN_H', 1)
+endif
+if cc.has_header('sys/io.h')
+	config_h.set('HAVE_SYS_IO_H', 1)
+endif
+if cc.has_header('cpuid.h')
+	# FIXME: Do we need the example link test from configure.ac?
+	config_h.set('HAVE_CPUID_H', 1)
+endif
+
+if cc.has_member('struct sysinfo', 'totalram',
+		prefix : '#include <sys/sysinfo.h>')
+	config_h.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1)
+endif
+
+add_project_arguments('-D_GNU_SOURCE', language : 'c')
+add_project_arguments('-include', 'config.h', language : 'c')
+
+config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
+config_h.set_quoted('PACKAGE', meson.project_name())
+config_h.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family())
+
+configure_file(output: 'config.h', install: false, configuration: config_h)
+
+subdir('lib')
+subdir('tests')
+subdir('benchmarks')
+subdir('tools')
+if libdrm_intel.found()
+	subdir('assembler')
+	subdir('overlay')
+endif
diff --git a/overlay/meson.build b/overlay/meson.build
new file mode 100644
index 000000000000..a4b778ca5a86
--- /dev/null
+++ b/overlay/meson.build
@@ -0,0 +1,59 @@
+gpu_overlay_src = [
+	'chart.c',
+	'config.c',
+	'cpu-top.c',
+	'debugfs.c',
+	'gem-interrupts.c',
+	'gem-objects.c',
+	'gpu-top.c',
+	'gpu-perf.c',
+	'gpu-freq.c',
+	'igfx.c',
+	'overlay.c',
+	'perf.c',
+	'power.c',
+	'rc6.c',
+]
+
+xv = dependency('xv', required : false)
+x11 = dependency('x11', required : false)
+xext = dependency('xext', required : false)
+dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
+cairo_xlib = dependency('cairo-xlib', required : false)
+xrandr = dependency('xrandr', version : '>=1.3', required : false)
+
+gpu_overlay_deps = [ realtime, cairo, pciaccess, libdrm, libdrm_intel ]
+
+both_x11_src = ''
+
+gpu_overlay_cflags = []
+if xv.found() and x11.found() and xext.found() and dri2proto.found()
+	both_x11_src = 'x11/position.c'
+	gpu_overlay_src += [
+		'x11/dri2.c',
+		'x11/dri2.h',
+		'x11/rgb2yuv.c',
+		'x11/rgb2yuv.h',
+		'x11/x11-overlay.c',
+	]
+	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
+	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
+endif
+
+if cairo_xlib.found() and xrandr.found() and dri2proto.found()
+	both_x11_src = 'x11/position.c'
+	gpu_overlay_src += 'x11/x11-window.c'
+	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
+	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
+endif
+
+gpu_overlay_src += both_x11_src
+
+gpu_overlay_src += 'kms/kms-overlay.c'
+
+if xrandr.found() and cairo.found()
+	executable('intel_gpu_overlay', gpu_overlay_src,
+			include_directories : inc,
+			c_args : gpu_overlay_cflags,
+			dependencies : gpu_overlay_deps)
+endif
diff --git a/tests/generate_testlist.sh b/tests/generate_testlist.sh
new file mode 100755
index 000000000000..6ea78655daca
--- /dev/null
+++ b/tests/generate_testlist.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo TESTLIST > $MESON_BUILD_ROOT/tests/test-list.txt
+
+while [[ $# -gt 0 ]] ; do
+	echo $1 >> $MESON_BUILD_ROOT/tests/test-list.txt
+	shift
+done
+
+echo END TESTLIST >> $MESON_BUILD_ROOT/tests/test-list.txt
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 000000000000..73833758be0e
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,290 @@
+test_progs = [
+	'core_auth',
+	'core_get_client_auth',
+	'core_getclient',
+	'core_getstats',
+	'core_getversion',
+	'core_prop_blob',
+	'core_setmaster_vs_auth',
+	'debugfs_test',
+	'drm_import_export',
+	'drm_mm',
+	'drm_read',
+	'drm_vma_limiter',
+	'drm_vma_limiter_cached',
+	'drm_vma_limiter_cpu',
+	'drm_vma_limiter_gtt',
+	'drv_getparams_basic',
+	'drv_hangman',
+	'drv_missed_irq',
+	'drv_module_reload',
+	'drv_selftest',
+	'drv_suspend',
+	'gem_bad_length',
+	'gem_bad_reloc',
+	'gem_basic',
+	'gem_busy',
+	'gem_caching',
+	'gem_close',
+	'gem_close_race',
+	'gem_concurrent_blit',
+	'gem_cpu_reloc',
+	'gem_create',
+	'gem_cs_prefetch',
+	'gem_cs_tlb',
+	'gem_ctx_bad_destroy',
+	'gem_ctx_bad_exec',
+	'gem_ctx_basic',
+	'gem_ctx_create',
+	'gem_ctx_exec',
+	'gem_ctx_param',
+	'gem_ctx_switch',
+	'gem_ctx_thrash',
+	'gem_double_irq_loop',
+	'gem_eio',
+	'gem_evict_alignment',
+	'gem_evict_everything',
+	'gem_exec_alignment',
+	'gem_exec_async',
+	'gem_exec_await',
+	'gem_exec_bad_domains',
+	'gem_exec_basic',
+	'gem_exec_big',
+	'gem_exec_blt',
+	'gem_exec_capture',
+	'gem_exec_create',
+	'gem_exec_faulting_reloc',
+	'gem_exec_fence',
+	'gem_exec_flush',
+	'gem_exec_gttfill',
+	'gem_exec_latency',
+	'gem_exec_lut_handle',
+	'gem_exec_nop',
+	'gem_exec_parallel',
+	'gem_exec_params',
+	'gem_exec_parse',
+	'gem_exec_reloc',
+	'gem_exec_reuse',
+	'gem_exec_schedule',
+	'gem_exec_store',
+	'gem_exec_suspend',
+	'gem_exec_whisper',
+	'gem_fd_exhaustion',
+	'gem_fence_thrash',
+	'gem_fence_upload',
+	'gem_fenced_exec_thrash',
+	'gem_flink_basic',
+	'gem_flink_race',
+	'gem_gpgpu_fill',
+	'gem_gtt_cpu_tlb',
+	'gem_gtt_hog',
+	'gem_gtt_speed',
+	'gem_hangcheck_forcewake',
+	'gem_largeobject',
+	'gem_linear_blits',
+	'gem_lut_handle',
+	'gem_madvise',
+	'gem_media_fill',
+	'gem_mmap',
+	'gem_mmap_gtt',
+	'gem_mmap_offset_exhaustion',
+	'gem_mmap_wc',
+	'gem_mocs_settings',
+	'gem_partial_pwrite_pread',
+	'gem_persistent_relocs',
+	'gem_pin',
+	'gem_pipe_control_store_loop',
+	'gem_ppgtt',
+	'gem_pread',
+	'gem_pread_after_blit',
+	'gem_pwrite',
+	'gem_pwrite_pread',
+	'gem_pwrite_snooped',
+	'gem_read_read_speed',
+	'gem_readwrite',
+	'gem_reg_read',
+	'gem_reloc_overflow',
+	'gem_reloc_vs_gpu',
+	'gem_render_copy',
+	'gem_render_copy_redux',
+	'gem_render_linear_blits',
+	'gem_render_tiled_blits',
+	'gem_request_retire',
+	'gem_reset_stats',
+	'gem_ring_sync_copy',
+	'gem_ring_sync_loop',
+	'gem_ringfill',
+	'gem_seqno_wrap',
+	'gem_set_tiling_vs_blt',
+	'gem_set_tiling_vs_gtt',
+	'gem_set_tiling_vs_pwrite',
+	'gem_shrink',
+	'gem_softpin',
+	'gem_spin_batch',
+	'gem_stolen',
+	'gem_storedw_batches_loop',
+	'gem_storedw_loop',
+	'gem_streaming_writes',
+	'gem_sync',
+	'gem_threaded_access_tiled',
+	'gem_tiled_blits',
+	'gem_tiled_fence_blits',
+	'gem_tiled_partial_pwrite_pread',
+	'gem_tiled_pread_basic',
+	'gem_tiled_pread_pwrite',
+	'gem_tiled_swapping',
+	'gem_tiled_wb',
+	'gem_tiled_wc',
+	'gem_tiling_max_stride',
+	'gem_unfence_active_buffers',
+	'gem_unref_active_buffers',
+	'gem_userptr_blits',
+	'gem_wait',
+	'gem_workarounds',
+	'gem_write_read_ring_switch',
+	'gen3_mixed_blits',
+	'gen3_render_linear_blits',
+	'gen3_render_mixed_blits',
+	'gen3_render_tiledx_blits',
+	'gen3_render_tiledy_blits',
+	'gen7_forcewake_mt',
+	'gvt_basic',
+	'kms_3d',
+	'kms_addfb_basic',
+	'kms_atomic',
+	'kms_atomic_transition',
+	'kms_busy',
+	'kms_ccs',
+	'kms_chv_cursor_fail',
+	'kms_concurrent',
+	'kms_crtc_background_color',
+	'kms_cursor_crc',
+	'kms_cursor_legacy',
+	'kms_draw_crc',
+	'kms_fbc_crc',
+	'kms_fbcon_fbt',
+	'kms_fence_pin_leak',
+	'kms_flip',
+	'kms_flip_event_leak',
+	'kms_flip_tiling',
+	'kms_force_connector_basic',
+	'kms_frontbuffer_tracking',
+	'kms_hdmi_inject',
+	'kms_invalid_dotclock',
+	'kms_legacy_colorkey',
+	'kms_mmap_write_crc',
+	'kms_mmio_vs_cs_flip',
+	'kms_panel_fitting',
+	'kms_pipe_b_c_ivb',
+	'kms_pipe_color',
+	'kms_pipe_crc_basic',
+	'kms_plane',
+	'kms_plane_lowres',
+	'kms_plane_multiple',
+	'kms_plane_scaling',
+	'kms_properties',
+	'kms_psr_sink_crc',
+	'kms_pwrite_crc',
+	'kms_render',
+	'kms_rmfb',
+	'kms_rotation_crc',
+	'kms_setmode',
+	'kms_sink_crc_basic',
+	'kms_sysfs_edid_timing',
+	'kms_tv_load_detect',
+	'kms_universal_plane',
+	'kms_vblank',
+	'meta_test',
+	'perf',
+	'pm_backlight',
+	'pm_lpsp',
+	'pm_rc6_residency',
+	'pm_rpm',
+	'pm_rps',
+	'pm_sseu',
+	'prime_busy',
+	'prime_mmap',
+	'prime_mmap_coherency',
+	'prime_mmap_kms',
+	'prime_self_import',
+	'prime_udl',
+	'prime_vgem',
+	'sw_sync',
+	'syncobj_basic',
+	'template',
+	'tools_test',
+	'vgem_basic',
+	'vgem_slow',
+]
+
+test_deps = [ igt_deps ]
+if libdrm_nouveau.found()
+	test_progs += [
+		'prime_nv_api',
+		'prime_nv_pcopy',
+		'prime_nv_test',
+	]
+	test_deps += libdrm_nouveau
+endif
+
+if libdrm_vc4.found()
+	test_progs += [
+		'vc4_create_bo',
+		'vc4_dmabuf_poll',
+		'vc4_lookup_fail',
+		'vc4_wait_bo',
+		'vc4_wait_seqno',
+	]
+	test_deps += libdrm_vc4
+endif
+
+if libdrm_amdgpu.found()
+	# FIXME meson/ninja really doesn't like build targets with paths in them
+	test_progs += [
+		'amdgpu/amd_basic',
+		'amdgpu/amd_cs_nop',
+		'amdgpu/amd_prime',
+	]
+	test_deps += libdrm_amdgpu
+endif
+
+if alsa.found()
+	test_progs += [
+		'audio',
+	]
+	test_deps += alsa
+endif
+
+foreach prog : test_progs
+	executable(prog, prog + '.c',
+			dependencies : test_deps)
+endforeach
+
+executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
+		dependencies : test_deps)
+test_progs += 'testdisplay'
+
+run_command('generate_testlist.sh', test_progs)
+
+test_script = find_program('igt_command_line.sh')
+foreach prog : test_progs
+	test('testcase check: ' + prog, test_script,
+			args : prog)
+endforeach
+
+executable('gem_stress', 'gem_stress.c', dependencies : igt_deps)
+
+# IMPORTANT: These tests here are all disabled because the result in sometime
+# unrecoverable gpu hangs. Don't put real testcases here.
+hang_progs = [
+	'gem_bad_batch',
+	'gem_hang',
+	'gem_bad_blit',
+	'gem_bad_address',
+	'gem_non_secure_batch',
+]
+foreach prog : hang_progs
+	executable(prog, prog + '.c',
+			dependencies : igt_deps,
+			install : false)
+endforeach
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 000000000000..d2d4410e2130
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1,59 @@
+tools_progs_noisnt = [
+	'hsw_compute_wrpll',
+	'skl_compute_wrpll',
+	'skl_ddb_allocation',
+]
+
+foreach prog : tools_progs_noisnt
+	executable(prog, prog + '.c',
+			dependencies : igt_deps,
+			install : false)
+endforeach
+
+tools_progs = [
+	# FIXME we already have a libtestcase with this name as target
+	#'igt_stats',
+	'intel_audio_dump',
+	'intel_backlight',
+	'intel_bios_dumper',
+	'intel_display_crc',
+	'intel_display_poller',
+	'intel_forcewaked',
+	'intel_gpu_frequency',
+	'intel_firmware_decode',
+	'intel_gpu_time',
+	'intel_gpu_top',
+	'intel_gtt',
+	'intel_guc_logger',
+	'intel_infoframes',
+	'intel_lid',
+	'intel_opregion_decode',
+	'intel_panel_fitter',
+	'intel_reg_checker',
+	'intel_residency',
+	'intel_stepping',
+	'intel_vbt_decode',
+	'intel_watermark',
+	'intel_gem_info',
+	'intel_gvtg_test',
+]
+tool_deps = igt_deps
+
+if libdrm_intel.found()
+	tools_progs += [
+		'intel_dump_decode',
+		'intel_error_decode',
+		'intel_framebuffer_dump',
+		'intel_perf_counters',
+	]
+	tool_deps += zlib
+endif
+
+foreach prog : tools_progs
+	executable(prog, prog + '.c',
+			dependencies : tool_deps)
+endforeach
+
+shared_library('intel_aubdump', 'aubdump.c', dependencies : [ igt_deps, dlsym ])
+
+subdir('null_state_gen')
diff --git a/tools/null_state_gen/meson.build b/tools/null_state_gen/meson.build
new file mode 100644
index 000000000000..96697dbf64f1
--- /dev/null
+++ b/tools/null_state_gen/meson.build
@@ -0,0 +1,15 @@
+intel_null_state_gen_src = [
+	'intel_batchbuffer.c',
+	'intel_renderstate_gen6.c',
+	'intel_renderstate_gen7.c',
+	'intel_renderstate_gen8.c',
+	'intel_renderstate_gen9.c',
+	'intel_null_state_gen.c',
+]
+
+intel_null_state_gen = executable('intel_null_state_gen',
+		intel_null_state_gen_src, dependencies : igt_deps,
+		install : false)
+
+# FIXME actual null_state generation. We probably want to push the the copyright
+# header generation into intel_null_state_gen for simplicity
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 13/22] lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:w
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (11 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 12/22] meson: basic build system support Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 14/22] tests/kms_plane: Appease gcc -Wempty-body Daniel Vetter
                   ` (20 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

gcc complains otherwise about empty ; statements ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/ioctl_wrappers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index b4d6210d5942..48750427a0c1 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -60,7 +60,7 @@
 
 #define VG(x) x
 #else
-#define VG(x)
+#define VG(x) do {} while (0)
 #endif
 
 #include "ioctl_wrappers.h"
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 14/22] tests/kms_plane: Appease gcc -Wempty-body
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (12 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 13/22] lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:w Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 15/22] meson: Add some compiler flags to reduce warnings Daniel Vetter
                   ` (19 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Not exactly sure what's the point, but oh well.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/kms_plane.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 927d5d37fece..812497500d2d 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -207,8 +207,9 @@ test_plane_position_with_output(data_t *data,
 
 	if (flags & TEST_POSITION_FULLY_COVERED)
 		igt_assert_crc_equal(&test.reference_crc, &crc);
-	else
+	else {
 		;/* FIXME: missing reference CRCs */
+	}
 
 	igt_assert_crc_equal(&crc, &crc2);
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 15/22] meson: Add some compiler flags to reduce warnings.
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (13 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 14/22] tests/kms_plane: Appease gcc -Wempty-body Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 16/22] meson: Don't build the igt audio test without gsl available Daniel Vetter
                   ` (18 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

From: Eric Anholt <eric@anholt.net>

These warnings are apparently new compared to the autotools build.  We
can fix the things they complain about later, if we want.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 meson.build | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meson.build b/meson.build
index fee64fcdf36e..4d6985d191f9 100644
--- a/meson.build
+++ b/meson.build
@@ -8,6 +8,17 @@ project('IGT gpu tests', 'c',
 
 cc = meson.get_compiler('c')
 
+add_global_arguments('-Wno-unused-parameter', language: 'c')
+add_global_arguments('-Wno-sign-compare', language: 'c')
+add_global_arguments('-Wno-missing-field-initializers', language: 'c')
+add_global_arguments('-Wno-clobbered', language: 'c')
+
+# Macros asserting on the range of their arguments triggers this.
+add_global_arguments('-Wno-type-limits', language: 'c')
+
+# igt_assert(0) in switch statements triggers a bunch of this.
+add_global_arguments('-Wimplicit-fallthrough=0', language: 'c')
+
 inc = include_directories('lib', '.')
 
 config_h = configuration_data()
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 16/22] meson: Don't build the igt audio test without gsl available.
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (14 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 15/22] meson: Add some compiler flags to reduce warnings Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 17/22] meson: Use static libs to handle IGT_LOG_DOMAIN Daniel Vetter
                   ` (17 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

From: Eric Anholt <eric@anholt.net>

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/meson.build b/tests/meson.build
index 73833758be0e..4dd5a9c9d4c7 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -248,7 +248,7 @@ if libdrm_amdgpu.found()
 	test_deps += libdrm_amdgpu
 endif
 
-if alsa.found()
+if alsa.found() and gsl.found()
 	test_progs += [
 		'audio',
 	]
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 17/22] meson: Use static libs to handle IGT_LOG_DOMAIN.
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (15 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 16/22] meson: Don't build the igt audio test without gsl available Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 18/22] meson: detect cc flags Daniel Vetter
                   ` (16 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

From: Eric Anholt <eric@anholt.net>

It means that compiler errors in the .c files take you to the source
place in your editor, not a preprocessed temporary.

v2: Add the library deps, fails linking otherwise.

Signed-off-by: Eric Anholt <eric@anholt.net> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/dummy.c               |  0
 lib/meson.build           | 36 +++++++++++++++++++++++++-----------
 lib/prepend_log_domain.sh |  8 --------
 3 files changed, 25 insertions(+), 19 deletions(-)
 create mode 100644 lib/dummy.c
 delete mode 100755 lib/prepend_log_domain.sh

diff --git a/lib/dummy.c b/lib/dummy.c
new file mode 100644
index 000000000000..e69de29bb2d1
diff --git a/lib/meson.build b/lib/meson.build
index 51d3f9e278da..f0672edf1830 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -144,19 +144,33 @@ vcs_tag(input : 'version.h.in', output : 'version.h',
 	fallback : 'NO-GIT',
 	command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] )
 
-# FIXME we don't regenerate when the script changes
-prepend_log_domain = generator(find_program('prepend_log_domain.sh'),
-		arguments : [ '@INPUT@', '@OUTPUT@' ],
-		output : '@PLAINNAME@' + '.pre.c')
-
-processed_src_dep = prepend_log_domain.process(lib_sources)
+lib_intermediates = []
+foreach f: lib_sources
+    # No / in the target name
+    if f.contains('uwildmat')
+        name = 'uwildmat'
+    else
+        name = f
+    endif
+
+    lib = static_library('igt-' + name,
+        f,
+	include_directories: inc,
+	dependencies : lib_deps,
+	c_args : [
+	    '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
+	    '-DIGT_SRCDIR="@0@"'.format(srcdir),
+	    '-DIGT_LOG_DOMAIN="@0@"'.format(f.split('.')[0]),
+	])
+
+    lib_intermediates += lib
+endforeach
 
 lib_igt_build = shared_library('igt',
-			 processed_src_dep,
-			 include_directories : inc,
-			 dependencies : lib_deps,
-			 c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
-				'-DIGT_SRCDIR="@0@"'.format(srcdir), ])
+    ['dummy.c'],
+    link_whole: lib_intermediates,
+    dependencies: lib_deps,
+)
 
 lib_igt = declare_dependency(link_with : lib_igt_build,
 			    include_directories : inc)
diff --git a/lib/prepend_log_domain.sh b/lib/prepend_log_domain.sh
deleted file mode 100755
index 93a911508b7f..000000000000
--- a/lib/prepend_log_domain.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-input=$1
-output=$2
-basename=$(basename $1 .c)
-
-echo "#define IGT_LOG_DOMAIN \"$basename\"" > $output
-cat $input >> $output
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 18/22] meson: detect cc flags
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (16 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 17/22] meson: Use static libs to handle IGT_LOG_DOMAIN Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 19/22] meson: add manpage support Daniel Vetter
                   ` (15 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Somehow my gcc has a different idea of what no-implicit-fallthrough
should look like than the one Eric used.

fixup compiler flags

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 meson.build | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/meson.build b/meson.build
index 4d6985d191f9..39749a0e1103 100644
--- a/meson.build
+++ b/meson.build
@@ -8,16 +8,22 @@ project('IGT gpu tests', 'c',
 
 cc = meson.get_compiler('c')
 
-add_global_arguments('-Wno-unused-parameter', language: 'c')
-add_global_arguments('-Wno-sign-compare', language: 'c')
-add_global_arguments('-Wno-missing-field-initializers', language: 'c')
-add_global_arguments('-Wno-clobbered', language: 'c')
-
+cc_args = [
+	'-Wno-unused-parameter',
+	'-Wno-sign-compare',
+	'-Wno-missing-field-initializers',
+	'-Wno-clobbered',
 # Macros asserting on the range of their arguments triggers this.
-add_global_arguments('-Wno-type-limits', language: 'c')
-
+	'-Wno-type-limits',
 # igt_assert(0) in switch statements triggers a bunch of this.
-add_global_arguments('-Wimplicit-fallthrough=0', language: 'c')
+	'-Wimplicit-fallthrough=0',
+]
+
+foreach cc_arg : cc_args
+  if cc.has_argument(cc_arg)
+    add_global_arguments(cc_arg, language : 'c')
+  endif
+endforeach
 
 inc = include_directories('lib', '.')
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 19/22] meson: add manpage support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (17 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 18/22] meson: detect cc flags Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 20/22] meson: igt_frame also needs pixman Daniel Vetter
                   ` (14 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

It seems like meson doesn't want you to string together targets
like make does, but wants it all in one step. So another little
shell script it is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 man/defs.rst.in |  5 +++++
 man/meson.build | 45 +++++++++++++++++++++++++++++++++++++++++++++
 man/rst2man.sh  | 16 ++++++++++++++++
 meson.build     |  1 +
 4 files changed, 67 insertions(+)
 create mode 100644 man/defs.rst.in
 create mode 100644 man/meson.build
 create mode 100755 man/rst2man.sh

diff --git a/man/defs.rst.in b/man/defs.rst.in
new file mode 100644
index 000000000000..54b7eec08903
--- /dev/null
+++ b/man/defs.rst.in
@@ -0,0 +1,5 @@
+.. |PACKAGE_NAME| replace:: @PACKAGE_NAME@
+.. |PACKAGE_VERSION| replace:: @PACKAGE_VERSION@
+.. |PACKAGE_STRING| replace:: @PACKAGE_STRING@
+.. |MANUAL_SECTION| replace:: 1
+.. |MANUAL_GROUP| replace:: General Commands Manual
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 000000000000..4f9f88e87540
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,45 @@
+manpages = [
+	'intel_aubdump',
+	'intel_audio_dump',
+	'intel_bios_dumper',
+	'intel_error_decode',
+	'intel_gpu_frequency',
+	'intel_gpu_top',
+	'intel_gtt',
+	'intel_infoframes',
+	'intel_lid',
+	'intel_panel_fitter',
+	'intel_reg',
+	'intel_stepping',
+	'intel_upload_blit_large',
+	'intel_upload_blit_large_gtt',
+	'intel_upload_blit_large_map',
+	'intel_upload_blit_small',
+	'intel_vbt_decode',
+]
+
+man_config = configuration_data()
+
+man_config.set('PACKAGE_NAME', meson.project_name())
+man_config.set('PACKAGE_VERSION', meson.project_version())
+man_config.set('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version())
+
+defs_rst = configure_file(input : 'defs.rst.in',
+		output : 'defs.rst',
+		configuration : man_config)
+
+rst2man = find_program('rst2man', required : false)
+rst2man_script = find_program('rst2man.sh')
+
+if rst2man.found()
+	foreach manpage : manpages
+		custom_target(manpage + '.1',
+				build_by_default : true,
+				command : [ rst2man_script, '@INPUT@', '@OUTPUT@' ],
+				depend_files : [ defs_rst ],
+				input: manpage + '.rst',
+				output : manpage + '.1.gz',
+				install : true,
+				install_dir : join_paths(get_option('mandir'), 'man1'))
+	endforeach
+endif
diff --git a/man/rst2man.sh b/man/rst2man.sh
new file mode 100755
index 000000000000..fc2b5ed863b1
--- /dev/null
+++ b/man/rst2man.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+input=$1
+output=$2
+
+out_dir=$(dirname ${output})
+in_file=$(basename ${input})
+
+# rst2man doesn't handle multiple source directories well, and since defs.rst is
+# generated we first need to move it all into the build dir
+cp $input $out_dir
+
+rst2man $out_dir/$in_file ${output%.gz}
+
+rm -f ${output}
+gzip ${output%.gz}
diff --git a/meson.build b/meson.build
index 39749a0e1103..2b49a0db6500 100644
--- a/meson.build
+++ b/meson.build
@@ -120,3 +120,4 @@ if libdrm_intel.found()
 	subdir('assembler')
 	subdir('overlay')
 endif
+subdir('man')
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 20/22] meson: igt_frame also needs pixman
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (18 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 19/22] meson: add manpage support Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 21/22] meson: Minimal README update Daniel Vetter
                   ` (13 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Oversight I noticed because I have the deps for chamelium on the other
machine already.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/meson.build b/lib/meson.build
index f0672edf1830..b78e42dc78cb 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -117,8 +117,8 @@ if valgrind.found()
 	lib_deps += valgrind
 endif
 
-if gsl.found()
-	lib_deps += gsl
+if gsl.found() and pixman.found()
+	lib_deps += [ gsl, pixman ]
 	lib_headers += [ 'igt_frame.h', 'igt_audio.h' ]
 	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
 endif
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 21/22] meson: Minimal README update
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (19 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 20/22] meson: igt_frame also needs pixman Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 12:36 ` [PATCH i-g-t 22/22] meson: Bump required version to 0.40 Daniel Vetter
                   ` (12 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 README | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/README b/README
index c3ddf7685fb4..2c2cd3637a43 100644
--- a/README
+++ b/README
@@ -159,6 +159,22 @@ The following dependencies are requires for building audio support
 	libasound2-dev
 	libgsl-dev
 
+Experimental meson build system support
+---------------------------------------
+
+Right now this is just a preview for developers, automake is still used by CI
+and needs to keep working. One-liner howto:
+
+$ mkdir build && meson build && cd build && ninja
+
+Note that meson insist on separate build directories from the source tree.
+
+Running testcases is done with
+
+$ cd build && ninja test
+
+gtkdocs is currently not yet supported.
+
 Releases for maintainers
 ------------------------
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t 22/22] meson: Bump required version to 0.40
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (20 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 21/22] meson: Minimal README update Daniel Vetter
@ 2017-09-05 12:36 ` Daniel Vetter
  2017-09-05 16:21 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev3) Patchwork
                   ` (11 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 12:36 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

link_whole needs that, and we need that. Reported by Chris Wilson.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 2b49a0db6500..0858354f1b0d 100644
--- a/meson.build
+++ b/meson.build
@@ -4,7 +4,8 @@ project('IGT gpu tests', 'c',
           'warning_level=2',
           'c_std=gnu99',
         ],
-	license : 'MIT')
+	license : 'MIT',
+	meson_version : '>0.40.0')
 
 cc = meson.get_compiler('c')
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] build: Define _GNU_SOURCE in Makefile.am
  2017-09-05 12:36 ` [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
@ 2017-09-05 16:19   ` Daniel Vetter
  2017-09-05 21:08     ` Chris Wilson
  0 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 16:19 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

In meson I want to just set this everywhere (no reason not to), and
doing so will allow us to clean up a few things.

But that means autofoo needs to follow suit.

v2: Rebase.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 benchmarks/Makefile.am | 2 +-
 lib/Makefile.am        | 1 +
 lib/tests/Makefile.am  | 1 +
 tests/Makefile.am      | 1 +
 tools/Makefile.am      | 2 +-
 5 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am
index 767731f7d18f..5c2cd19d6b20 100644
--- a/benchmarks/Makefile.am
+++ b/benchmarks/Makefile.am
@@ -8,7 +8,7 @@ endif
 
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
 AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) \
-	    $(WERROR_CFLAGS)
+	    $(WERROR_CFLAGS) -D_GNU_SOURCE
 LDADD = $(top_builddir)/lib/libintel_tools.la
 
 benchmarks_LTLIBRARIES = gem_exec_tracer.la
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 3ff14f66cdea..6509593db1c7 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -62,6 +62,7 @@ AM_CFLAGS = \
 	    $(VALGRIND_CFLAGS) \
 	    -DIGT_SRCDIR=\""$(abs_top_srcdir)/tests"\" \
 	    -DIGT_DATADIR=\""$(pkgdatadir)"\" \
+	    -D_GNU_SOURCE \
 	    -DIGT_LOG_DOMAIN=\""$(subst _,-,$*)"\" \
 	    -pthread
 
diff --git a/lib/tests/Makefile.am b/lib/tests/Makefile.am
index 5d14194ada12..63bbbe5907b4 100644
--- a/lib/tests/Makefile.am
+++ b/lib/tests/Makefile.am
@@ -12,6 +12,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) $(DEBUG_CFLAGS) \
 	-I$(srcdir)/.. \
 	-include "$(srcdir)/../../lib/check-ndebug.h" \
 	-DIGT_DATADIR=\""$(abs_srcdir)"\" \
+	-D_GNU_SOURCE
 	$(NULL)
 
 LDADD = ../libintel_tools.la $(PCIACCESS_LIBS) $(DRM_LIBS) $(LIBUNWIND_LIBS) $(TIMER_LIBS)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 726e2b277411..8c70f6f1aa35 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -76,6 +76,7 @@ AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) -Wno-unused-result $(DEBUG_CFLAGS)\
 	-include "$(srcdir)/../lib/check-ndebug.h" \
 	-DIGT_SRCDIR=\""$(abs_srcdir)"\" \
 	-DIGT_DATADIR=\""$(pkgdatadir)"\" \
+	-D_GNU_SOURCE \
 	$(LIBUNWIND_CFLAGS) $(WERROR_CFLAGS) \
 	$(NULL)
 
diff --git a/tools/Makefile.am b/tools/Makefile.am
index c40e75c73bef..2c7b57997447 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -18,7 +18,7 @@ SUBDIRS = null_state_gen registers
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib
 AM_CFLAGS = $(DEBUG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS) \
 	    $(CAIRO_CFLAGS) $(LIBUNWIND_CFLAGS) -DPKGDATADIR=\"$(pkgdatadir)\" \
-	    $(WERROR_CFLAGS)
+	    $(WERROR_CFLAGS) -D_GNU_SOURCE
 LDADD = $(top_builddir)/lib/libintel_tools.la
 AM_LDFLAGS = -Wl,--as-needed
 
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] demos: remove
  2017-09-05 12:36 ` [PATCH i-g-t 10/22] demos: remove Daniel Vetter
@ 2017-09-05 16:20   ` Daniel Vetter
  2017-09-05 16:45     ` Daniel Vetter
  0 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 16:20 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

The igt testcase themselves contain plenty of demos, libdrm
also contains a bunch of demos, this here just bitrots.

So let's remove it.

v2: Rebase.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 Makefile.am             |   2 +-
 demos/.gitignore        |   1 -
 demos/Android.mk        |  32 --
 demos/Makefile.sources  |   7 -
 demos/intel_sprite_on.c | 960 ------------------------------------------------
 5 files changed, 1 insertion(+), 1001 deletions(-)
 delete mode 100644 demos/.gitignore
 delete mode 100644 demos/Android.mk
 delete mode 100644 demos/Makefile.sources
 delete mode 100644 demos/intel_sprite_on.c

diff --git a/Makefile.am b/Makefile.am
index 601686282c64..8c25402789f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ if BUILD_SHADER_DEBUGGER
 SUBDIRS += debugger
 endif
 
-SUBDIRS += overlay demos benchmarks
+SUBDIRS += overlay benchmarks
 endif
 
 SUBDIRS += docs
diff --git a/demos/.gitignore b/demos/.gitignore
deleted file mode 100644
index cd80b0b5f259..000000000000
--- a/demos/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-intel_sprite_on
diff --git a/demos/Android.mk b/demos/Android.mk
deleted file mode 100644
index 1f50fdcb7e82..000000000000
--- a/demos/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#================#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(demos_prog_lists)
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN)
-endif
-
-LOCAL_CFLAGS += -DHAVE_TERMIOS_H
-LOCAL_CFLAGS += -DANDROID -UNDEBUG
-LOCAL_CFLAGS += -std=gnu99
-# Excessive complaining for established cases. Rely on the Linux version warnings.
-LOCAL_CFLAGS += -Wno-sign-compare
-
-LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                   $(LOCAL_PATH)/../lib/stubs/drm/
-
-LOCAL_MODULE := intel_sprite_on
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-include $(BUILD_EXECUTABLE)
-
-#================#
diff --git a/demos/Makefile.sources b/demos/Makefile.sources
deleted file mode 100644
index aea363f9ba17..000000000000
--- a/demos/Makefile.sources
+++ /dev/null
@@ -1,7 +0,0 @@
-demos_prog_list =		\
-	$(NULL)
-
-LIBDRM_INTEL_BIN =		\
-	intel_sprite_on		\
-	$(NULL)
-
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
deleted file mode 100644
index a3ece09955aa..000000000000
--- a/demos/intel_sprite_on.c
+++ /dev/null
@@ -1,960 +0,0 @@
-/*
- * 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.
- *
- *
- * Author:
- *   Armin Reese <armin.c.reese@intel.com>
- */
-
-/*
- * This program is intended for testing sprite functionality.
- */
-#include <assert.h>
-#include <errno.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <termios.h>
-#include <sys/time.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-
-#include "i915_drm.h"
-#include "drmtest.h"
-#include "igt_kms.h"
-
-#include "ioctl_wrappers.h"
-
-/*
- * Mode setting with the kernel interfaces is a bit of a chore.
- * First you have to find the connector in question and make sure the
- * requested mode is available.
- * Then you need to find the encoder attached to that connector so you
- * can bind it with a free crtc.
- */
-struct connector {
-	uint32_t            id;
-	int                 mode_valid;
-	drmModeModeInfo     mode;
-	drmModeEncoder      *encoder;
-	drmModeConnector    *connector;
-	int                 crtc;
-	int                 pipe;
-};
-
-static void dump_mode(drmModeModeInfo *mode)
-{
-	printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n",
-		mode->name,
-		mode->vrefresh,
-		mode->hdisplay,
-		mode->hsync_start,
-		mode->hsync_end,
-		mode->htotal,
-		mode->vdisplay,
-		mode->vsync_start,
-		mode->vsync_end,
-		mode->vtotal,
-		mode->flags,
-		mode->type,
-		mode->clock);
-}
-
-static void dump_connectors(int gfx_fd, drmModeRes *resources)
-{
-	int i, j;
-
-	printf("Connectors:\n");
-	printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
-	for (i = 0; i < resources->count_connectors; i++) {
-		drmModeConnector *connector;
-
-		connector = drmModeGetConnector(gfx_fd, resources->connectors[i]);
-		if (!connector) {
-			printf("could not get connector %i: %s\n",
-					resources->connectors[i], strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n",
-			connector->connector_id,
-			connector->encoder_id,
-			kmstest_connector_status_str(connector->connection),
-			kmstest_connector_type_str(connector->connector_type),
-			connector->mmWidth, connector->mmHeight,
-			connector->count_modes);
-
-		if (!connector->count_modes)
-			continue;
-
-		printf("  modes:\n");
-		printf("  name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot flags type clock\n");
-		for (j = 0; j < connector->count_modes; j++)
-			dump_mode(&connector->modes[j]);
-
-		drmModeFreeConnector(connector);
-	}
-	printf("\n");
-}
-
-static void dump_crtcs(int gfx_fd, drmModeRes *resources)
-{
-	int i;
-
-	printf("CRTCs:\n");
-	printf("id\tfb\tpos\tsize\n");
-	for (i = 0; i < resources->count_crtcs; i++) {
-		drmModeCrtc *crtc;
-
-		crtc = drmModeGetCrtc(gfx_fd, resources->crtcs[i]);
-		if (!crtc) {
-			printf("could not get crtc %i: %s\n",
-				resources->crtcs[i],
-				strerror(errno));
-			continue;
-		}
-		printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
-			crtc->crtc_id,
-			crtc->buffer_id,
-			crtc->x, crtc->y,
-			crtc->width, crtc->height);
-		dump_mode(&crtc->mode);
-
-		drmModeFreeCrtc(crtc);
-	}
-	printf("\n");
-}
-
-static void dump_planes(int gfx_fd, drmModeRes *resources)
-{
-	drmModePlaneRes             *plane_resources;
-	drmModePlane                *ovr;
-	int i;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return;
-	}
-
-	printf("Planes:\n");
-	printf("id\tcrtc\tfb\tCRTC x,y\tx,y\tgamma size\n");
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%d\t%d,%d\t\t%d,%d\t%d\n",
-			ovr->plane_id, ovr->crtc_id, ovr->fb_id,
-			ovr->crtc_x, ovr->crtc_y, ovr->x, ovr->y,
-			ovr->gamma_size);
-
-		drmModeFreePlane(ovr);
-	}
-	printf("\n");
-
-	return;
-}
-
-static void connector_find_preferred_mode(int gfx_fd,
-					  drmModeRes *gfx_resources,
-					  struct connector *c)
-{
-	drmModeConnector *connector;
-	drmModeEncoder *encoder = NULL;
-	int i, j;
-
-	/* First, find the connector & mode */
-	c->mode_valid = 0;
-	connector = drmModeGetConnector(gfx_fd, c->id);
-	if (!connector) {
-		printf("could not get connector %d: %s\n",
-			c->id,
-			strerror(errno));
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connection != DRM_MODE_CONNECTED) {
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (!connector->count_modes) {
-		printf("connector %d has no modes\n",
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connector_id != c->id) {
-		printf("connector id doesn't match (%d != %d)\n",
-			connector->connector_id,
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	for (j = 0; j < connector->count_modes; j++) {
-		c->mode = connector->modes[j];
-		if (c->mode.type & DRM_MODE_TYPE_PREFERRED) {
-			c->mode_valid = 1;
-			break;
-		}
-	}
-
-	if (!c->mode_valid) {
-		if (connector->count_modes > 0) {
-			/* use the first mode as test mode */
-			c->mode = connector->modes[0];
-			c->mode_valid = 1;
-		} else {
-			printf("failed to find any modes on connector %d\n",
-				c->id);
-			return;
-		}
-	}
-
-	/* Now get the encoder */
-	for (i = 0; i < connector->count_encoders; i++) {
-		encoder = drmModeGetEncoder(gfx_fd, connector->encoders[i]);
-
-		if (!encoder) {
-			printf("could not get encoder %i: %s\n",
-				gfx_resources->encoders[i],
-				strerror(errno));
-			drmModeFreeEncoder(encoder);
-			continue;
-		}
-
-		break;
-	}
-
-	c->encoder = encoder;
-
-	if (i == gfx_resources->count_encoders) {
-		printf("failed to find encoder\n");
-		c->mode_valid = 0;
-		return;
-	}
-
-	/* Find first CRTC not in use */
-	for (i = 0; i < gfx_resources->count_crtcs; i++) {
-		if (gfx_resources->crtcs[i] && (c->encoder->possible_crtcs & (1<<i)))
-			break;
-	}
-	c->crtc = gfx_resources->crtcs[i];
-	c->pipe = i;
-
-	gfx_resources->crtcs[i] = 0;
-
-	c->connector = connector;
-}
-
-static int connector_find_plane(int gfx_fd, struct connector *c,
-				unsigned int **sprite_plane_id)
-{
-	drmModePlaneRes *plane_resources;
-	drmModePlane *ovr;
-	int i, sprite_plane_count = 0;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return 0;
-	}
-
-	/* Allocating buffer to hold sprite plane ids of the
-         * current connector.
-         */
-	*sprite_plane_id = (unsigned int *) malloc(plane_resources->count_planes *
-						   sizeof(unsigned int));
-
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-		/* Add the available sprite id to the buffer sprite_plane_id.
-                 */
-		if (ovr->possible_crtcs & (1 << c->pipe)) {
-			(*sprite_plane_id)[sprite_plane_count++] = ovr->plane_id;
-		}
-		drmModeFreePlane(ovr);
-	}
-
-	return sprite_plane_count;
-}
-
-static int prepare_primary_surface(int fd, int prim_width, int prim_height,
-				   uint32_t *prim_handle, uint32_t *prim_stride,
-				   uint32_t *prim_size, int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *prim_fb_ptr;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for primary surface: %d\n",
-			bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = prim_width * bytes_per_pixel;
-		for (*prim_stride = 512; *prim_stride < v; *prim_stride *= 2)
-			;
-
-		v = *prim_stride * prim_height;
-		for (*prim_size = 1024*1024; *prim_size < v; *prim_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*prim_stride = (prim_width * bytes_per_pixel + 63) & ~63;
-		*prim_size = *prim_stride * prim_height;
-	}
-
-	*prim_handle = gem_create(fd, *prim_size);
-
-	if (tiled)
-		gem_set_tiling(fd, *prim_handle, I915_TILING_X, *prim_stride);
-
-	prim_fb_ptr = __gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
-
-	if (prim_fb_ptr != NULL) {
-		// Write primary surface with gray background
-		memset(prim_fb_ptr, 0x3f, *prim_size);
-		munmap(prim_fb_ptr, *prim_size);
-	}
-
-	return 0;
-}
-
-static void fill_sprite(int sprite_width, int sprite_height, int sprite_stride,
-			int sprite_index, void *sprite_fb_ptr)
-{
-	__u32                           *pLinePat0,
-					*pLinePat1,
-					*pLinePtr;
-	int                             i,
-					line;
-	int                             stripe_width;
-
-	stripe_width = ((sprite_width > 64) &&
-			(sprite_height > 64)) ? (sprite_index + 1) * 8 :
-		(sprite_index + 1) * 2;
-
-	// Note:  sprite_stride is in bytes.  pLinePat0 and pLinePat1
-	//        are both __u32 pointers
-	pLinePat0 = sprite_fb_ptr;
-	pLinePat1 = pLinePat0 + (stripe_width * (sprite_stride / sizeof(*pLinePat0)));
-
-	for (i = 0; i < sprite_width; i++) {
-		*(pLinePat0 + i) = ((i / stripe_width) & 0x1) ? 0 : ~0;
-		*(pLinePat1 + i) = ~(*(pLinePat0 + i));
-	}
-
-	for (line = 1; line < sprite_height; line++) {
-		if (line == stripe_width) {
-			continue;
-		}
-
-		pLinePtr = ((line / stripe_width) & 0x1) ? pLinePat1 : pLinePat0;
-		memcpy( pLinePat0 + ((sprite_stride / sizeof(*pLinePat0)) * line),
-				pLinePtr,
-				sprite_width * sizeof(*pLinePat0));
-	}
-
-	return;
-}
-
-static int prepare_sprite_surfaces(int fd, int sprite_width, int sprite_height,
-				   uint32_t num_surfaces, uint32_t *sprite_handles,
-				   uint32_t *sprite_stride, uint32_t *sprite_size,
-				   int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *sprite_fb_ptr;
-	int                             i;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for sprite: %d\n", bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = sprite_width * bytes_per_pixel;
-		for (*sprite_stride = 512; *sprite_stride < v; *sprite_stride *= 2)
-			;
-
-		v = *sprite_stride * sprite_height;
-		for (*sprite_size = 1024*1024; *sprite_size < v; *sprite_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*sprite_stride = (sprite_width * bytes_per_pixel + 63) & ~63;
-		*sprite_size = *sprite_stride * sprite_height;
-	}
-
-	for (i = 0; i < num_surfaces;  i++) {
-		// Create the sprite surface
-		sprite_handles[i] = gem_create(fd, *sprite_size);
-
-		if (tiled)
-			gem_set_tiling(fd, sprite_handles[i], I915_TILING_X, *sprite_stride);
-
-		// Get pointer to the surface
-		sprite_fb_ptr = __gem_mmap__gtt(fd,
-				sprite_handles[i], *sprite_size,
-				PROT_READ | PROT_WRITE);
-
-		if (sprite_fb_ptr != NULL) {
-			// Fill with checkerboard pattern
-			fill_sprite(sprite_width, sprite_height, *sprite_stride, i, sprite_fb_ptr);
-
-			munmap(sprite_fb_ptr, *sprite_size);
-		} else {
-			i--;
-			while (i >= 0) {
-				gem_close(fd, sprite_handles[i]);
-				i--;
-			}
-		}
-	}
-
-	return 0;
-}
-
-static void ricochet(int tiled, int sprite_w, int sprite_h,
-		     int out_w, int out_h, int dump_info)
-{
-	int                                 ret;
-	int                                 gfx_fd;
-	int                                 keep_moving;
-	const int                           num_surfaces = 3;
-	uint32_t                            sprite_handles[num_surfaces];
-	uint32_t                            sprite_fb_id[num_surfaces];
-	int                                 *sprite_x = NULL;
-	int                                 *sprite_y = NULL;
-	uint32_t                            sprite_stride;
-	uint32_t                            sprite_size;
-	uint32_t                            handles[4],
-					    pitches[4],
-					    offsets[4]; /* we only use [0] */
-	uint32_t                            prim_width,
-					    prim_height,
-					    prim_handle,
-					    prim_stride,
-					    prim_size,
-					    prim_fb_id;
-	struct drm_intel_sprite_colorkey    set;
-	struct connector                    curr_connector;
-	drmModeRes                          *gfx_resources;
-	struct termios                      orig_term,
-					    curr_term;
-	int                                 c_index;
-	int                                 sprite_index;
-	unsigned int                        *sprite_plane_id = NULL;
-	uint32_t                            plane_flags = 0;
-	int                                 *delta_x = NULL,
-					    *delta_y = NULL;
-	struct timeval                      stTimeVal;
-	long long                           currTime,
-	     prevFlipTime,
-	     prevMoveTime,
-	     deltaFlipTime,
-	     deltaMoveTime,
-	     SleepTime;
-	char                                key;
-	int				    sprite_plane_count = 0;
-	int 				    i;
-	int 				    found_count = 0;
-
-	// Open up I915 graphics device
-	gfx_fd = drmOpen("i915", NULL);
-	if (gfx_fd < 0) {
-		printf("Failed to load i915 driver: %s\n", strerror(errno));
-		return;
-	}
-
-	// Obtain pointer to struct containing graphics resources
-	gfx_resources = drmModeGetResources(gfx_fd);
-	if (!gfx_resources) {
-		printf("drmModeGetResources failed: %s\n", strerror(errno));
-		return;
-	}
-
-	if (dump_info != 0) {
-		dump_connectors(gfx_fd, gfx_resources);
-		dump_crtcs(gfx_fd, gfx_resources);
-		dump_planes(gfx_fd, gfx_resources);
-	}
-
-	// Save previous terminal settings
-	if (tcgetattr( 0, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n",
-				strerror(errno));
-		return;
-	}
-
-	// Set up input to return characters immediately
-	curr_term = orig_term;
-	curr_term.c_lflag &= ~(ICANON | ECHO | ECHONL);
-	curr_term.c_cc[VMIN] = 0;       // No minimum number of characters
-	curr_term.c_cc[VTIME] = 0 ;     // Return immediately, even if
-	// nothing has been entered.
-	if (tcsetattr( 0, TCSANOW, &curr_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	// Cycle through all connectors and display the flying sprite
-	// where there are displays attached and the hardware will support it.
-	for (c_index = 0; c_index < gfx_resources->count_connectors; c_index++)  {
-		curr_connector.id = gfx_resources->connectors[c_index];
-
-		// Find the native (preferred) display mode
-		connector_find_preferred_mode(gfx_fd, gfx_resources, &curr_connector);
-		if (curr_connector.mode_valid == 0) {
-
-			if (((c_index + 1) == gfx_resources->count_connectors) &&
-			    (found_count == 0))
-				printf("Failed to find any valid connections.\n");
-			continue;
-		}
-
-		found_count++;
-
-		// Determine if sprite hardware is available on pipe
-		// associated with this connector.
-		sprite_plane_count = connector_find_plane(gfx_fd, &curr_connector,
-							  &sprite_plane_id);
-		if (!sprite_plane_count) {
-			printf("Failed to find sprite plane on crtc\n");
-			goto out;
-		}
-
-		// Width and height of preferred mode
-		prim_width = curr_connector.mode.hdisplay;
-		prim_height = curr_connector.mode.vdisplay;
-
-		// Allocate and fill memory for primary surface
-		ret = prepare_primary_surface(
-				gfx_fd,
-				prim_width,
-				prim_height,
-				&prim_handle,
-				&prim_stride,
-				&prim_size,
-				tiled);
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-				prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Add the primary surface framebuffer
-		ret = drmModeAddFB(gfx_fd, prim_width, prim_height, 24, 32,
-				   prim_stride, prim_handle, &prim_fb_id);
-		gem_close(gfx_fd, prim_handle);
-
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-					prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Allocate and fill sprite surfaces
-		ret = prepare_sprite_surfaces(gfx_fd, sprite_w, sprite_h, num_surfaces,
-					      &sprite_handles[0],
-					      &sprite_stride, &sprite_size,
-					      tiled);
-		if (ret != 0) {
-			printf("Preparation of sprite surfaces failed %dx%d\n",
-				sprite_w, sprite_h);
-			goto out;
-		}
-
-		// Add the sprite framebuffers
-		for (sprite_index = 0; sprite_index < num_surfaces; sprite_index++) {
-			handles[0] = sprite_handles[sprite_index];
-			handles[1] = handles[0];
-			handles[2] = handles[0];
-			handles[3] = handles[0];
-			pitches[0] = sprite_stride;
-			pitches[1] = sprite_stride;
-			pitches[2] = sprite_stride;
-			pitches[3] = sprite_stride;
-			memset(offsets, 0, sizeof(offsets));
-
-			ret = drmModeAddFB2(gfx_fd, sprite_w, sprite_h,
-					    DRM_FORMAT_XRGB8888,
-					    handles, pitches, offsets,
-					    &sprite_fb_id[sprite_index], plane_flags);
-			gem_close(gfx_fd, sprite_handles[sprite_index]);
-
-			if (ret) {
-				printf("Failed to add sprite fb (%dx%d): %s\n",
-				       sprite_w, sprite_h, strerror(errno));
-
-				sprite_index--;
-				while (sprite_index >= 0) {
-					drmModeRmFB(gfx_fd, sprite_fb_id[sprite_index]);
-					sprite_index--;
-				}
-				goto out;
-			}
-		}
-
-		if (dump_info != 0) {
-			printf("Displayed Mode Connector struct:\n"
-				"    .id = %d\n"
-				"    .mode_valid = %d\n"
-				"    .crtc = %d\n"
-				"    .pipe = %d\n"
-				"    drmModeModeInfo ...\n"
-				"        .name = %s\n"
-				"        .type = %d\n"
-				"        .flags = %08x\n"
-				"    drmModeEncoder ...\n"
-				"        .encoder_id = %d\n"
-				"        .encoder_type = %d (%s)\n"
-				"        .crtc_id = %d\n"
-				"        .possible_crtcs = %d\n"
-				"        .possible_clones = %d\n"
-				"    drmModeConnector ...\n"
-				"        .connector_id = %d\n"
-				"        .encoder_id = %d\n"
-				"        .connector_type = %d (%s)\n"
-				"        .connector_type_id = %d\n\n",
-				curr_connector.id,
-				curr_connector.mode_valid,
-				curr_connector.crtc,
-				curr_connector.pipe,
-				curr_connector.mode.name,
-				curr_connector.mode.type,
-				curr_connector.mode.flags,
-				curr_connector.encoder->encoder_id,
-				curr_connector.encoder->encoder_type,
-				kmstest_encoder_type_str(curr_connector.encoder->encoder_type),
-				curr_connector.encoder->crtc_id,
-				curr_connector.encoder->possible_crtcs,
-				curr_connector.encoder->possible_clones,
-				curr_connector.connector->connector_id,
-				curr_connector.connector->encoder_id,
-				curr_connector.connector->connector_type,
-				kmstest_connector_type_str(curr_connector.connector->connector_type),
-				curr_connector.connector->connector_type_id);
-
-			printf("Sprite surface dimensions = %dx%d\n"
-				"Sprite output dimensions = %dx%d\n"
-				"Press any key to continue >\n",
-				sprite_w, sprite_h, out_w, out_h);
-
-			// Wait for a key-press
-			while( read(0, &key, 1) == 0);
-			// Purge unread characters
-			tcflush(0, TCIFLUSH);
-		}
-
-		// Set up the primary display mode
-		ret = drmModeSetCrtc(gfx_fd, curr_connector.crtc, prim_fb_id,
-				     0, 0, &curr_connector.id, 1, &curr_connector.mode);
-		if (ret != 0) {
-			printf("Failed to set mode (%dx%d@%dHz): %s\n",
-				prim_width, prim_height, curr_connector.mode.vrefresh,
-				strerror(errno));
-			continue;
-		}
-
-		// Set the sprite colorkey state
-		for(i = 0; i < sprite_plane_count; i++) {
-			set.plane_id = sprite_plane_id[i];
-			set.min_value = 0;
-			set.max_value = 0;
-			set.flags = I915_SET_COLORKEY_NONE;
-			ret = drmCommandWrite(gfx_fd, DRM_I915_SET_SPRITE_COLORKEY, &set,
-					      sizeof(set));
-			assert(ret == 0);
-		}
-
-		// Set up sprite output dimensions, initial position, etc.
-		if (out_w > prim_width / 2)
-			out_w = prim_width / 2;
-		if (out_h > prim_height / 2)
-			out_h = prim_height / 2;
-
-		delta_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		delta_y = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_y = (int *) malloc(sprite_plane_count * sizeof(int));
-
-		/* Initializing the coordinates (x,y) of the available sprites on the
-		 * connector, equally spaced along the diagonal of the rectangle
-		 * {(0,0),(prim_width/2, prim_height/2)}.
-		 */
-		for(i = 0; i < sprite_plane_count; i++) {
-			delta_x[i] = 3;
-			delta_y[i] = 4;
-			sprite_x[i] = i * (prim_width / (2 * sprite_plane_count));
-			sprite_y[i] = i * (prim_height / (2 * sprite_plane_count));
-		}
-
-		currTime = 0;
-		prevFlipTime = 0;       // Will force immediate sprite flip
-		prevMoveTime = 0;       // Will force immediate sprite move
-		deltaFlipTime = 500000; // Flip sprite surface every 1/2 second
-		deltaMoveTime = 100000; // Move sprite every 100 ms
-		sprite_index = num_surfaces - 1;
-		keep_moving = 1;
-
-		// Bounce sprite off the walls
-		while (keep_moving) {
-			// Obtain system time in usec.
-			if (gettimeofday( &stTimeVal, NULL ) != 0)
-				printf("gettimeofday error: %s\n", strerror(errno));
-			else
-				currTime = ((long long)stTimeVal.tv_sec * 1000000) + stTimeVal.tv_usec;
-
-			// Check if it's time to flip the sprite surface
-			if (currTime - prevFlipTime > deltaFlipTime) {
-				sprite_index = (sprite_index + 1) % num_surfaces;
-
-				prevFlipTime = currTime;
-			}
-
-			// Move the sprite on the screen and flip
-			// the surface if the index has changed
-			// NB: sprite_w and sprite_h must be 16.16 fixed point, herego << 16
-			for(i = 0; i < sprite_plane_count; i++) {
-				if (drmModeSetPlane(gfx_fd, sprite_plane_id[i],
-						    curr_connector.crtc,
-						    sprite_fb_id[sprite_index],
-						    plane_flags,
-						    sprite_x[i], sprite_y[i],
-						    out_w, out_h,
-						    0, 0,
-						    sprite_w << 16, sprite_h << 16))
-					printf("Failed to enable sprite plane: %s\n",
-						strerror(errno));
-			}
-
-			// Check if it's time to move the sprite surface
-			if (currTime - prevMoveTime > deltaMoveTime)  {
-
-				// Compute the next position for sprite
-				for(i = 0; i < sprite_plane_count; i++) {
-					sprite_x[i] += delta_x[i];
-					sprite_y[i] += delta_y[i];
-					if (sprite_x[i] < 0) {
-						sprite_x[i] = 0;
-						delta_x[i] = -delta_x[i];
-					}
-					else if (sprite_x[i] > prim_width - out_w) {
-						sprite_x[i] = prim_width - out_w;
-						delta_x[i] = -delta_x[i];
-					}
-
-					if (sprite_y[i] < 0) {
-						sprite_y[i] = 0;
-						delta_y[i] = -delta_y[i];
-					}
-					else if (sprite_y[i] > prim_height - out_h) {
-						sprite_y[i] = prim_height - out_h;
-						delta_y[i] = -delta_y[i];
-					}
-				}
-				prevMoveTime = currTime;
-			}
-
-			// Fetch a key from input (non-blocking)
-			if (read(0, &key, 1) == 1) {
-				switch (key) {
-				case 'q':       // Kill the program
-				case 'Q':
-					goto out;
-					break;
-				case 's':       // Slow down sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 90;
-					if (deltaMoveTime > 800000) {
-						deltaMoveTime = 800000;
-					}
-					break;
-				case 'S':       // Speed up sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 110;
-					if (deltaMoveTime < 2000) {
-						deltaMoveTime = 2000;
-					}
-					break;
-				case 'f':       // Slow down sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 90;
-					if (deltaFlipTime > 1000000)
-						deltaFlipTime = 1000000;
-					break;
-				case 'F':       // Speed up sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 110;
-					if (deltaFlipTime < 20000)
-						deltaFlipTime = 20000;
-					break;
-				case 'n':       // Next connector
-				case 'N':
-					keep_moving = 0;
-					break;
-				default:
-					break;
-				}
-
-				// Purge unread characters
-				tcflush(0, TCIFLUSH);
-			}
-
-			// Wait for min of flip or move deltas
-			SleepTime = (deltaFlipTime < deltaMoveTime) ?
-				deltaFlipTime : deltaMoveTime;
-			usleep(SleepTime);
-		}
-
-		free(sprite_plane_id);
-		free(sprite_x);
-		free(sprite_y);
-		free(delta_x);
-		free(delta_y);
-		sprite_plane_id = NULL;
-		sprite_plane_count = 0;
-		sprite_x = sprite_y = delta_x = delta_y = NULL;
-	}
-
-out:
-	// Purge unread characters
-	tcflush(0, TCIFLUSH);
-	// Restore previous terminal settings
-	if (tcsetattr( 0, TCSANOW, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	drmModeFreeResources(gfx_resources);
-}
-
-static void usage(char *name)
-{
-	printf("usage: %s -s <plane width>x<plane height> [-dhto]\n"
-		"\t-d\t[optional] dump mode information\n"
-		"\t-h\t[optional] output help message\n"
-		"\t-t\t[optional] enable tiling\n"
-		"\t-o\t[optional] <output rect width>x<output rect height>\n\n"
-		"Keyboard control for sprite movement and flip rate ...\n"
-		"\t'q' or 'Q' - Quit the program\n"
-		"\t'n' or 'N' - Switch to next display\n"
-		"\t's'        - Slow sprite movement\n"
-		"\t'S'        - Speed up sprite movement\n"
-		"\t'f'        - Slow sprite surface flipping\n"
-		"\t'F'        - Speed up sprite surface flipping\n",
-		name);
-}
-
-int main(int argc, char **argv)
-{
-	int                 c;
-	int                 test_overlay = 0,
-			    enable_tiling = 0,
-			    dump_info = 0;
-	int                 plane_width = 0,
-			    plane_height = 0,
-			    out_width = 0,
-			    out_height = 0;
-	static char         optstr[] = "ds:o:th";
-
-	opterr = 0;
-	while ((c = getopt(argc, argv, optstr)) != -1) {
-		switch (c) {
-		case 'd':               // Dump information
-			dump_info = 1;
-			break;
-		case 't':               // Tiling enable
-			enable_tiling = 1;
-			break;
-		case 's':               // Surface dimensions
-			if (sscanf(optarg, "%dx%d", &plane_width, &plane_height) != 2)
-				usage(argv[0]);
-			test_overlay = 1;
-			break;
-		case 'o':               // Output dimensions
-			if (sscanf(optarg, "%dx%d", &out_width, &out_height) != 2)
-				usage(argv[0]);
-			break;
-		default:
-			printf("unknown option %c\n", c);
-			/* fall through */
-		case 'h':               // Help!
-			usage(argv[0]);
-			goto out;
-		}
-	}
-
-	if (test_overlay) {
-		if (out_width < (plane_width / 2))
-			out_width = plane_width;
-
-		if (out_height < (plane_height / 2))
-			out_height = plane_height;
-
-		ricochet(enable_tiling, plane_width, plane_height, out_width, out_height, dump_info);
-	} else {
-		printf("Sprite dimensions are required:\n");
-		usage(argv[0]);
-	}
-
-out:
-	exit(0);
-}
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev3)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (21 preceding siblings ...)
  2017-09-05 12:36 ` [PATCH i-g-t 22/22] meson: Bump required version to 0.40 Daniel Vetter
@ 2017-09-05 16:21 ` Patchwork
  2017-09-06  7:52 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev5) Patchwork
                   ` (10 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-05 16:21 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev3)
URL   : https://patchwork.freedesktop.org/series/29823/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
918863f8e3e8f49235fd2e4a36e11f386c06c11c intel_display_poller: Fix truncation of a test name.

Making check in lib
make  check-recursive
Making check in .
Making check in tests
make  igt_no_exit igt_no_exit_list_only igt_fork_helper igt_list_only igt_no_subtest igt_simulation igt_simple_test_subtests igt_stats igt_timeout igt_invalid_subtest_name igt_segfault igt_subtest_group igt_assert igt_exit_handler igt_hdmi_inject igt_can_fail igt_can_fail_simple 
  CC       igt_no_exit.o
  CC       igt_no_exit_list_only.o
  CC       igt_fork_helper.o
  CC       igt_list_only.o
  CC       igt_no_subtest.o
  CC       igt_simulation.o
  CC       igt_simple_test_subtests.o
  CC       igt_stats.o
  CC       igt_invalid_subtest_name.o
  CC       igt_timeout.o
  CC       igt_segfault.o
  CC       igt_subtest_group.o
  CC       igt_assert.o
  CC       igt_exit_handler.o
  CC       igt_hdmi_inject.o
  CC       igt_can_fail.o
  CC       igt_can_fail_simple.o
  CCLD     igt_simple_test_subtests
  CCLD     igt_invalid_subtest_name
  CCLD     igt_can_fail
  CCLD     igt_can_fail_simple
  CCLD     igt_no_subtest
  CCLD     igt_fork_helper
  CCLD     igt_no_exit_list_only
  CCLD     igt_no_exit
  CCLD     igt_list_only
  CCLD     igt_timeout
  CCLD     igt_exit_handler
  CCLD     igt_subtest_group
  CCLD     igt_segfault
  CCLD     igt_simulation
  CCLD     igt_assert
  CCLD     igt_stats
  CCLD     igt_hdmi_inject
make  check-TESTS
PASS: igt_list_only
../../build-aux/test-driver: line 107:  9434 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit_list_only
PASS: igt_fork_helper
PASS: igt_can_fail
PASS: igt_hdmi_inject
PASS: igt_can_fail_simple
PASS: igt_subtest_group
PASS: igt_stats
PASS: igt_exit_handler
PASS: igt_assert
PASS: igt_simulation
../../build-aux/test-driver: line 107:  9428 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit
../../build-aux/test-driver: line 107:  9442 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_subtest
../../build-aux/test-driver: line 107:  9453 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_invalid_subtest_name
../../build-aux/test-driver: line 107:  9439 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_simple_test_subtests
PASS: igt_segfault
XFAIL: igt_timeout
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
Making check in man
make[1]: Nothing to be done for 'check'.
Making check in tools
Making check in null_state_gen
make[2]: Nothing to be done for 'check'.
Making check in registers
make[2]: Nothing to be done for 'check'.
make[2]: Nothing to be done for 'check-am'.
Making check in scripts
make[1]: Nothing to be done for 'check'.
Making check in benchmarks
make[1]: Nothing to be done for 'check'.
Making check in tests
Making check in intel-ci
make[2]: Nothing to be done for 'check'.
make  igt_command_line.sh 
make[3]: Nothing to be done for 'igt_command_line.sh'.
make  check-TESTS
FAIL: igt_command_line.sh
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT
============================================================================
Makefile:4525: recipe for target 'test-suite.log' failed
make[4]: *** [test-suite.log] Error 1
Makefile:4631: recipe for target 'check-TESTS' failed
make[3]: *** [check-TESTS] Error 2
Makefile:4729: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
Makefile:4418: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
Makefile:530: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
====================================================
   intel-gpu-tools 1.19: lib/tests/test-suite.log
====================================================

# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

XFAIL: igt_no_exit
==================

IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
Subtest A: SUCCESS (0.000s)
igt_no_exit: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
XFAIL igt_no_exit (exit status: 134)

XFAIL: igt_no_exit_list_only
============================

igt_no_exit_list_only: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
A
XFAIL igt_no_exit_list_only (exit status: 134)

XFAIL: igt_no_subtest
=====================

igt_no_subtest: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_no_subtest (exit status: 134)

XFAIL: igt_simple_test_subtests
===============================

igt_simple_test_subtests: igt_core.c:948: __igt_run_subtest: Assertion `test_with_subtests' failed.
IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_simple_test_subtests (exit status: 134)

XFAIL: igt_timeout
==================

Test igt_timeout failed.
**** DEBUG ****
(igt_timeout:9470) igt-core-INFO: IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_timeout:9470) igt-core-INFO: Timed out: Testcase
****  END  ****
IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
Timed out: Testcase
FAIL (1.000s)
XFAIL igt_timeout (exit status: 99)

XFAIL: igt_invalid_subtest_name
===============================

IGT-Version: 1.19-ga2938f9a (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_invalid_subtest_name:9453) igt-core-CRITICAL: Invalid subtest name "# invalid name !".
igt_invalid_subtest_name: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
Received signal SIGABRT.
XFAIL igt_invalid_subtest_name (exit status: 134)

====================================================
   intel-gpu-tools 1.19: assembler/test-suite.log
====================================================

# TOTAL: 10
# PASS:  10
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

================================================
   intel-gpu-tools 1.19: tests/test-suite.log
================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: igt_command_line.sh
=========================

./igt_command_line.sh: 45: ./igt_command_line.sh: Syntax error: "(" unexpected
FAIL igt_command_line.sh (exit status: 2)


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] tests/igt_command_line.sh: Allow testing individual tests
  2017-09-05 12:36 ` [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests Daniel Vetter
@ 2017-09-05 16:43   ` Daniel Vetter
  2017-09-06  8:02     ` Daniel Vetter
  0 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 16:43 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

meso will use this to run the tests for all testcases in parallel, for
great speedup!

v2: Fix bugs in the conversion. Oops, I broke the automake build.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/igt_command_line.sh | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc805d37..536cf16be692 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -37,26 +37,19 @@ fi
 # Manually running this script is possible in the source root or the
 # tests directory.
 
-TESTLISTFILE="$tests_dir/test-list.txt"
-if [ ! -r "$TESTLISTFILE" ]; then
-	tests_dir="tests"
-	TESTLISTFILE="$tests_dir/test-list.txt"
-fi
-
-TESTLIST=`cat $TESTLISTFILE`
-if [ $? -ne 0 ]; then
-	echo "Error: Could not read test lists"
-	exit 99
-fi
-
 fail () {
 	echo "FAIL: $1"
 	exit 1
 }
 
-for test in $TESTLIST; do
+function check_test ()
+{
+	local test
+
+	test=$1
+
 	if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then
-		continue
+		return
 	fi
 
 	testname="$test"
@@ -105,4 +98,25 @@ for test in $TESTLIST; do
 	# check invalid subtest handling
 	echo "  Checking invalid subtest handling..."
 	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
+}
+
+TESTLISTFILE="$tests_dir/test-list.txt"
+if [ ! -r "$TESTLISTFILE" ]; then
+	tests_dir="tests"
+	TESTLISTFILE="$tests_dir/test-list.txt"
+fi
+
+TESTLIST=`cat $TESTLISTFILE`
+if [ $? -ne 0 ]; then
+	echo "Error: Could not read test lists"
+	exit 99
+fi
+
+if [[ "$1" != "" ]] ; then
+	check_test $1
+	exit 0
+fi
+
+for test in $TESTLIST; do
+	check_test $test
 done
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] demos: remove
  2017-09-05 16:20   ` [PATCH i-g-t] " Daniel Vetter
@ 2017-09-05 16:45     ` Daniel Vetter
  0 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-05 16:45 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

The igt testcase themselves contain plenty of demos, libdrm
also contains a bunch of demos, this here just bitrots.

So let's remove it.

v2: Rebase.

v3: Also delete demos/Makefile from configure.ac. This broke clean
builds starting with autogen.sh.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 Makefile.am             |   2 +-
 configure.ac            |   1 -
 demos/.gitignore        |   1 -
 demos/Android.mk        |  32 --
 demos/Makefile.sources  |   7 -
 demos/intel_sprite_on.c | 960 ------------------------------------------------
 6 files changed, 1 insertion(+), 1002 deletions(-)
 delete mode 100644 demos/.gitignore
 delete mode 100644 demos/Android.mk
 delete mode 100644 demos/Makefile.sources
 delete mode 100644 demos/intel_sprite_on.c

diff --git a/Makefile.am b/Makefile.am
index 601686282c64..8c25402789f3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ if BUILD_SHADER_DEBUGGER
 SUBDIRS += debugger
 endif
 
-SUBDIRS += overlay demos benchmarks
+SUBDIRS += overlay benchmarks
 endif
 
 SUBDIRS += docs
diff --git a/configure.ac b/configure.ac
index 41ec4d26391a..c78f51949745 100644
--- a/configure.ac
+++ b/configure.ac
@@ -402,7 +402,6 @@ AC_SUBST(REGISTER_FILES)
 AC_CONFIG_FILES([
 		 Makefile
 		 benchmarks/Makefile
-		 demos/Makefile
 		 docs/Makefile
 		 docs/reference/Makefile
 		 docs/reference/intel-gpu-tools/Makefile
diff --git a/demos/.gitignore b/demos/.gitignore
deleted file mode 100644
index cd80b0b5f259..000000000000
--- a/demos/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-intel_sprite_on
diff --git a/demos/Android.mk b/demos/Android.mk
deleted file mode 100644
index 1f50fdcb7e82..000000000000
--- a/demos/Android.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-#================#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(demos_prog_lists)
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    LOCAL_SRC_FILES += $(LIBDRM_INTEL_BIN)
-endif
-
-LOCAL_CFLAGS += -DHAVE_TERMIOS_H
-LOCAL_CFLAGS += -DANDROID -UNDEBUG
-LOCAL_CFLAGS += -std=gnu99
-# Excessive complaining for established cases. Rely on the Linux version warnings.
-LOCAL_CFLAGS += -Wno-sign-compare
-
-LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                   $(LOCAL_PATH)/../lib/stubs/drm/
-
-LOCAL_MODULE := intel_sprite_on
-
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-LOCAL_SHARED_LIBRARIES := libdrm
-
-include $(BUILD_EXECUTABLE)
-
-#================#
diff --git a/demos/Makefile.sources b/demos/Makefile.sources
deleted file mode 100644
index aea363f9ba17..000000000000
--- a/demos/Makefile.sources
+++ /dev/null
@@ -1,7 +0,0 @@
-demos_prog_list =		\
-	$(NULL)
-
-LIBDRM_INTEL_BIN =		\
-	intel_sprite_on		\
-	$(NULL)
-
diff --git a/demos/intel_sprite_on.c b/demos/intel_sprite_on.c
deleted file mode 100644
index a3ece09955aa..000000000000
--- a/demos/intel_sprite_on.c
+++ /dev/null
@@ -1,960 +0,0 @@
-/*
- * 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.
- *
- *
- * Author:
- *   Armin Reese <armin.c.reese@intel.com>
- */
-
-/*
- * This program is intended for testing sprite functionality.
- */
-#include <assert.h>
-#include <errno.h>
-#include <math.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <termios.h>
-#include <sys/time.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-
-#include "i915_drm.h"
-#include "drmtest.h"
-#include "igt_kms.h"
-
-#include "ioctl_wrappers.h"
-
-/*
- * Mode setting with the kernel interfaces is a bit of a chore.
- * First you have to find the connector in question and make sure the
- * requested mode is available.
- * Then you need to find the encoder attached to that connector so you
- * can bind it with a free crtc.
- */
-struct connector {
-	uint32_t            id;
-	int                 mode_valid;
-	drmModeModeInfo     mode;
-	drmModeEncoder      *encoder;
-	drmModeConnector    *connector;
-	int                 crtc;
-	int                 pipe;
-};
-
-static void dump_mode(drmModeModeInfo *mode)
-{
-	printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n",
-		mode->name,
-		mode->vrefresh,
-		mode->hdisplay,
-		mode->hsync_start,
-		mode->hsync_end,
-		mode->htotal,
-		mode->vdisplay,
-		mode->vsync_start,
-		mode->vsync_end,
-		mode->vtotal,
-		mode->flags,
-		mode->type,
-		mode->clock);
-}
-
-static void dump_connectors(int gfx_fd, drmModeRes *resources)
-{
-	int i, j;
-
-	printf("Connectors:\n");
-	printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\n");
-	for (i = 0; i < resources->count_connectors; i++) {
-		drmModeConnector *connector;
-
-		connector = drmModeGetConnector(gfx_fd, resources->connectors[i]);
-		if (!connector) {
-			printf("could not get connector %i: %s\n",
-					resources->connectors[i], strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\n",
-			connector->connector_id,
-			connector->encoder_id,
-			kmstest_connector_status_str(connector->connection),
-			kmstest_connector_type_str(connector->connector_type),
-			connector->mmWidth, connector->mmHeight,
-			connector->count_modes);
-
-		if (!connector->count_modes)
-			continue;
-
-		printf("  modes:\n");
-		printf("  name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot flags type clock\n");
-		for (j = 0; j < connector->count_modes; j++)
-			dump_mode(&connector->modes[j]);
-
-		drmModeFreeConnector(connector);
-	}
-	printf("\n");
-}
-
-static void dump_crtcs(int gfx_fd, drmModeRes *resources)
-{
-	int i;
-
-	printf("CRTCs:\n");
-	printf("id\tfb\tpos\tsize\n");
-	for (i = 0; i < resources->count_crtcs; i++) {
-		drmModeCrtc *crtc;
-
-		crtc = drmModeGetCrtc(gfx_fd, resources->crtcs[i]);
-		if (!crtc) {
-			printf("could not get crtc %i: %s\n",
-				resources->crtcs[i],
-				strerror(errno));
-			continue;
-		}
-		printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
-			crtc->crtc_id,
-			crtc->buffer_id,
-			crtc->x, crtc->y,
-			crtc->width, crtc->height);
-		dump_mode(&crtc->mode);
-
-		drmModeFreeCrtc(crtc);
-	}
-	printf("\n");
-}
-
-static void dump_planes(int gfx_fd, drmModeRes *resources)
-{
-	drmModePlaneRes             *plane_resources;
-	drmModePlane                *ovr;
-	int i;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return;
-	}
-
-	printf("Planes:\n");
-	printf("id\tcrtc\tfb\tCRTC x,y\tx,y\tgamma size\n");
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-
-		printf("%d\t%d\t%d\t%d,%d\t\t%d,%d\t%d\n",
-			ovr->plane_id, ovr->crtc_id, ovr->fb_id,
-			ovr->crtc_x, ovr->crtc_y, ovr->x, ovr->y,
-			ovr->gamma_size);
-
-		drmModeFreePlane(ovr);
-	}
-	printf("\n");
-
-	return;
-}
-
-static void connector_find_preferred_mode(int gfx_fd,
-					  drmModeRes *gfx_resources,
-					  struct connector *c)
-{
-	drmModeConnector *connector;
-	drmModeEncoder *encoder = NULL;
-	int i, j;
-
-	/* First, find the connector & mode */
-	c->mode_valid = 0;
-	connector = drmModeGetConnector(gfx_fd, c->id);
-	if (!connector) {
-		printf("could not get connector %d: %s\n",
-			c->id,
-			strerror(errno));
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connection != DRM_MODE_CONNECTED) {
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (!connector->count_modes) {
-		printf("connector %d has no modes\n",
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	if (connector->connector_id != c->id) {
-		printf("connector id doesn't match (%d != %d)\n",
-			connector->connector_id,
-			c->id);
-		drmModeFreeConnector(connector);
-		return;
-	}
-
-	for (j = 0; j < connector->count_modes; j++) {
-		c->mode = connector->modes[j];
-		if (c->mode.type & DRM_MODE_TYPE_PREFERRED) {
-			c->mode_valid = 1;
-			break;
-		}
-	}
-
-	if (!c->mode_valid) {
-		if (connector->count_modes > 0) {
-			/* use the first mode as test mode */
-			c->mode = connector->modes[0];
-			c->mode_valid = 1;
-		} else {
-			printf("failed to find any modes on connector %d\n",
-				c->id);
-			return;
-		}
-	}
-
-	/* Now get the encoder */
-	for (i = 0; i < connector->count_encoders; i++) {
-		encoder = drmModeGetEncoder(gfx_fd, connector->encoders[i]);
-
-		if (!encoder) {
-			printf("could not get encoder %i: %s\n",
-				gfx_resources->encoders[i],
-				strerror(errno));
-			drmModeFreeEncoder(encoder);
-			continue;
-		}
-
-		break;
-	}
-
-	c->encoder = encoder;
-
-	if (i == gfx_resources->count_encoders) {
-		printf("failed to find encoder\n");
-		c->mode_valid = 0;
-		return;
-	}
-
-	/* Find first CRTC not in use */
-	for (i = 0; i < gfx_resources->count_crtcs; i++) {
-		if (gfx_resources->crtcs[i] && (c->encoder->possible_crtcs & (1<<i)))
-			break;
-	}
-	c->crtc = gfx_resources->crtcs[i];
-	c->pipe = i;
-
-	gfx_resources->crtcs[i] = 0;
-
-	c->connector = connector;
-}
-
-static int connector_find_plane(int gfx_fd, struct connector *c,
-				unsigned int **sprite_plane_id)
-{
-	drmModePlaneRes *plane_resources;
-	drmModePlane *ovr;
-	int i, sprite_plane_count = 0;
-
-	plane_resources = drmModeGetPlaneResources(gfx_fd);
-	if (!plane_resources) {
-		printf("drmModeGetPlaneResources failed: %s\n",
-			strerror(errno));
-		return 0;
-	}
-
-	/* Allocating buffer to hold sprite plane ids of the
-         * current connector.
-         */
-	*sprite_plane_id = (unsigned int *) malloc(plane_resources->count_planes *
-						   sizeof(unsigned int));
-
-	for (i = 0; i < plane_resources->count_planes; i++) {
-		ovr = drmModeGetPlane(gfx_fd, plane_resources->planes[i]);
-		if (!ovr) {
-			printf("drmModeGetPlane failed: %s\n",
-				strerror(errno));
-			continue;
-		}
-		/* Add the available sprite id to the buffer sprite_plane_id.
-                 */
-		if (ovr->possible_crtcs & (1 << c->pipe)) {
-			(*sprite_plane_id)[sprite_plane_count++] = ovr->plane_id;
-		}
-		drmModeFreePlane(ovr);
-	}
-
-	return sprite_plane_count;
-}
-
-static int prepare_primary_surface(int fd, int prim_width, int prim_height,
-				   uint32_t *prim_handle, uint32_t *prim_stride,
-				   uint32_t *prim_size, int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *prim_fb_ptr;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for primary surface: %d\n",
-			bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = prim_width * bytes_per_pixel;
-		for (*prim_stride = 512; *prim_stride < v; *prim_stride *= 2)
-			;
-
-		v = *prim_stride * prim_height;
-		for (*prim_size = 1024*1024; *prim_size < v; *prim_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*prim_stride = (prim_width * bytes_per_pixel + 63) & ~63;
-		*prim_size = *prim_stride * prim_height;
-	}
-
-	*prim_handle = gem_create(fd, *prim_size);
-
-	if (tiled)
-		gem_set_tiling(fd, *prim_handle, I915_TILING_X, *prim_stride);
-
-	prim_fb_ptr = __gem_mmap__gtt(fd, *prim_handle, *prim_size, PROT_READ | PROT_WRITE);
-
-	if (prim_fb_ptr != NULL) {
-		// Write primary surface with gray background
-		memset(prim_fb_ptr, 0x3f, *prim_size);
-		munmap(prim_fb_ptr, *prim_size);
-	}
-
-	return 0;
-}
-
-static void fill_sprite(int sprite_width, int sprite_height, int sprite_stride,
-			int sprite_index, void *sprite_fb_ptr)
-{
-	__u32                           *pLinePat0,
-					*pLinePat1,
-					*pLinePtr;
-	int                             i,
-					line;
-	int                             stripe_width;
-
-	stripe_width = ((sprite_width > 64) &&
-			(sprite_height > 64)) ? (sprite_index + 1) * 8 :
-		(sprite_index + 1) * 2;
-
-	// Note:  sprite_stride is in bytes.  pLinePat0 and pLinePat1
-	//        are both __u32 pointers
-	pLinePat0 = sprite_fb_ptr;
-	pLinePat1 = pLinePat0 + (stripe_width * (sprite_stride / sizeof(*pLinePat0)));
-
-	for (i = 0; i < sprite_width; i++) {
-		*(pLinePat0 + i) = ((i / stripe_width) & 0x1) ? 0 : ~0;
-		*(pLinePat1 + i) = ~(*(pLinePat0 + i));
-	}
-
-	for (line = 1; line < sprite_height; line++) {
-		if (line == stripe_width) {
-			continue;
-		}
-
-		pLinePtr = ((line / stripe_width) & 0x1) ? pLinePat1 : pLinePat0;
-		memcpy( pLinePat0 + ((sprite_stride / sizeof(*pLinePat0)) * line),
-				pLinePtr,
-				sprite_width * sizeof(*pLinePat0));
-	}
-
-	return;
-}
-
-static int prepare_sprite_surfaces(int fd, int sprite_width, int sprite_height,
-				   uint32_t num_surfaces, uint32_t *sprite_handles,
-				   uint32_t *sprite_stride, uint32_t *sprite_size,
-				   int tiled)
-{
-	uint32_t                        bytes_per_pixel = sizeof(uint32_t);
-	uint32_t                        *sprite_fb_ptr;
-	int                             i;
-
-	if (bytes_per_pixel != sizeof(uint32_t)) {
-		printf("Bad bytes_per_pixel for sprite: %d\n", bytes_per_pixel);
-		return -EINVAL;
-	}
-
-	if (tiled) {
-		int                         v;
-
-		/* Round the tiling up to the next power-of-two and the
-		 * region up to the next pot fence size so that this works
-		 * on all generations.
-		 *
-		 * This can still fail if the framebuffer is too large to
-		 * be tiled. But then that failure is expected.
-		 */
-
-		v = sprite_width * bytes_per_pixel;
-		for (*sprite_stride = 512; *sprite_stride < v; *sprite_stride *= 2)
-			;
-
-		v = *sprite_stride * sprite_height;
-		for (*sprite_size = 1024*1024; *sprite_size < v; *sprite_size *= 2)
-			;
-	} else {
-		/* Scan-out has a 64 byte alignment restriction */
-		*sprite_stride = (sprite_width * bytes_per_pixel + 63) & ~63;
-		*sprite_size = *sprite_stride * sprite_height;
-	}
-
-	for (i = 0; i < num_surfaces;  i++) {
-		// Create the sprite surface
-		sprite_handles[i] = gem_create(fd, *sprite_size);
-
-		if (tiled)
-			gem_set_tiling(fd, sprite_handles[i], I915_TILING_X, *sprite_stride);
-
-		// Get pointer to the surface
-		sprite_fb_ptr = __gem_mmap__gtt(fd,
-				sprite_handles[i], *sprite_size,
-				PROT_READ | PROT_WRITE);
-
-		if (sprite_fb_ptr != NULL) {
-			// Fill with checkerboard pattern
-			fill_sprite(sprite_width, sprite_height, *sprite_stride, i, sprite_fb_ptr);
-
-			munmap(sprite_fb_ptr, *sprite_size);
-		} else {
-			i--;
-			while (i >= 0) {
-				gem_close(fd, sprite_handles[i]);
-				i--;
-			}
-		}
-	}
-
-	return 0;
-}
-
-static void ricochet(int tiled, int sprite_w, int sprite_h,
-		     int out_w, int out_h, int dump_info)
-{
-	int                                 ret;
-	int                                 gfx_fd;
-	int                                 keep_moving;
-	const int                           num_surfaces = 3;
-	uint32_t                            sprite_handles[num_surfaces];
-	uint32_t                            sprite_fb_id[num_surfaces];
-	int                                 *sprite_x = NULL;
-	int                                 *sprite_y = NULL;
-	uint32_t                            sprite_stride;
-	uint32_t                            sprite_size;
-	uint32_t                            handles[4],
-					    pitches[4],
-					    offsets[4]; /* we only use [0] */
-	uint32_t                            prim_width,
-					    prim_height,
-					    prim_handle,
-					    prim_stride,
-					    prim_size,
-					    prim_fb_id;
-	struct drm_intel_sprite_colorkey    set;
-	struct connector                    curr_connector;
-	drmModeRes                          *gfx_resources;
-	struct termios                      orig_term,
-					    curr_term;
-	int                                 c_index;
-	int                                 sprite_index;
-	unsigned int                        *sprite_plane_id = NULL;
-	uint32_t                            plane_flags = 0;
-	int                                 *delta_x = NULL,
-					    *delta_y = NULL;
-	struct timeval                      stTimeVal;
-	long long                           currTime,
-	     prevFlipTime,
-	     prevMoveTime,
-	     deltaFlipTime,
-	     deltaMoveTime,
-	     SleepTime;
-	char                                key;
-	int				    sprite_plane_count = 0;
-	int 				    i;
-	int 				    found_count = 0;
-
-	// Open up I915 graphics device
-	gfx_fd = drmOpen("i915", NULL);
-	if (gfx_fd < 0) {
-		printf("Failed to load i915 driver: %s\n", strerror(errno));
-		return;
-	}
-
-	// Obtain pointer to struct containing graphics resources
-	gfx_resources = drmModeGetResources(gfx_fd);
-	if (!gfx_resources) {
-		printf("drmModeGetResources failed: %s\n", strerror(errno));
-		return;
-	}
-
-	if (dump_info != 0) {
-		dump_connectors(gfx_fd, gfx_resources);
-		dump_crtcs(gfx_fd, gfx_resources);
-		dump_planes(gfx_fd, gfx_resources);
-	}
-
-	// Save previous terminal settings
-	if (tcgetattr( 0, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n",
-				strerror(errno));
-		return;
-	}
-
-	// Set up input to return characters immediately
-	curr_term = orig_term;
-	curr_term.c_lflag &= ~(ICANON | ECHO | ECHONL);
-	curr_term.c_cc[VMIN] = 0;       // No minimum number of characters
-	curr_term.c_cc[VTIME] = 0 ;     // Return immediately, even if
-	// nothing has been entered.
-	if (tcsetattr( 0, TCSANOW, &curr_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	// Cycle through all connectors and display the flying sprite
-	// where there are displays attached and the hardware will support it.
-	for (c_index = 0; c_index < gfx_resources->count_connectors; c_index++)  {
-		curr_connector.id = gfx_resources->connectors[c_index];
-
-		// Find the native (preferred) display mode
-		connector_find_preferred_mode(gfx_fd, gfx_resources, &curr_connector);
-		if (curr_connector.mode_valid == 0) {
-
-			if (((c_index + 1) == gfx_resources->count_connectors) &&
-			    (found_count == 0))
-				printf("Failed to find any valid connections.\n");
-			continue;
-		}
-
-		found_count++;
-
-		// Determine if sprite hardware is available on pipe
-		// associated with this connector.
-		sprite_plane_count = connector_find_plane(gfx_fd, &curr_connector,
-							  &sprite_plane_id);
-		if (!sprite_plane_count) {
-			printf("Failed to find sprite plane on crtc\n");
-			goto out;
-		}
-
-		// Width and height of preferred mode
-		prim_width = curr_connector.mode.hdisplay;
-		prim_height = curr_connector.mode.vdisplay;
-
-		// Allocate and fill memory for primary surface
-		ret = prepare_primary_surface(
-				gfx_fd,
-				prim_width,
-				prim_height,
-				&prim_handle,
-				&prim_stride,
-				&prim_size,
-				tiled);
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-				prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Add the primary surface framebuffer
-		ret = drmModeAddFB(gfx_fd, prim_width, prim_height, 24, 32,
-				   prim_stride, prim_handle, &prim_fb_id);
-		gem_close(gfx_fd, prim_handle);
-
-		if (ret != 0) {
-			printf("Failed to add primary fb (%dx%d): %s\n",
-					prim_width, prim_height, strerror(errno));
-			goto out;
-		}
-
-		// Allocate and fill sprite surfaces
-		ret = prepare_sprite_surfaces(gfx_fd, sprite_w, sprite_h, num_surfaces,
-					      &sprite_handles[0],
-					      &sprite_stride, &sprite_size,
-					      tiled);
-		if (ret != 0) {
-			printf("Preparation of sprite surfaces failed %dx%d\n",
-				sprite_w, sprite_h);
-			goto out;
-		}
-
-		// Add the sprite framebuffers
-		for (sprite_index = 0; sprite_index < num_surfaces; sprite_index++) {
-			handles[0] = sprite_handles[sprite_index];
-			handles[1] = handles[0];
-			handles[2] = handles[0];
-			handles[3] = handles[0];
-			pitches[0] = sprite_stride;
-			pitches[1] = sprite_stride;
-			pitches[2] = sprite_stride;
-			pitches[3] = sprite_stride;
-			memset(offsets, 0, sizeof(offsets));
-
-			ret = drmModeAddFB2(gfx_fd, sprite_w, sprite_h,
-					    DRM_FORMAT_XRGB8888,
-					    handles, pitches, offsets,
-					    &sprite_fb_id[sprite_index], plane_flags);
-			gem_close(gfx_fd, sprite_handles[sprite_index]);
-
-			if (ret) {
-				printf("Failed to add sprite fb (%dx%d): %s\n",
-				       sprite_w, sprite_h, strerror(errno));
-
-				sprite_index--;
-				while (sprite_index >= 0) {
-					drmModeRmFB(gfx_fd, sprite_fb_id[sprite_index]);
-					sprite_index--;
-				}
-				goto out;
-			}
-		}
-
-		if (dump_info != 0) {
-			printf("Displayed Mode Connector struct:\n"
-				"    .id = %d\n"
-				"    .mode_valid = %d\n"
-				"    .crtc = %d\n"
-				"    .pipe = %d\n"
-				"    drmModeModeInfo ...\n"
-				"        .name = %s\n"
-				"        .type = %d\n"
-				"        .flags = %08x\n"
-				"    drmModeEncoder ...\n"
-				"        .encoder_id = %d\n"
-				"        .encoder_type = %d (%s)\n"
-				"        .crtc_id = %d\n"
-				"        .possible_crtcs = %d\n"
-				"        .possible_clones = %d\n"
-				"    drmModeConnector ...\n"
-				"        .connector_id = %d\n"
-				"        .encoder_id = %d\n"
-				"        .connector_type = %d (%s)\n"
-				"        .connector_type_id = %d\n\n",
-				curr_connector.id,
-				curr_connector.mode_valid,
-				curr_connector.crtc,
-				curr_connector.pipe,
-				curr_connector.mode.name,
-				curr_connector.mode.type,
-				curr_connector.mode.flags,
-				curr_connector.encoder->encoder_id,
-				curr_connector.encoder->encoder_type,
-				kmstest_encoder_type_str(curr_connector.encoder->encoder_type),
-				curr_connector.encoder->crtc_id,
-				curr_connector.encoder->possible_crtcs,
-				curr_connector.encoder->possible_clones,
-				curr_connector.connector->connector_id,
-				curr_connector.connector->encoder_id,
-				curr_connector.connector->connector_type,
-				kmstest_connector_type_str(curr_connector.connector->connector_type),
-				curr_connector.connector->connector_type_id);
-
-			printf("Sprite surface dimensions = %dx%d\n"
-				"Sprite output dimensions = %dx%d\n"
-				"Press any key to continue >\n",
-				sprite_w, sprite_h, out_w, out_h);
-
-			// Wait for a key-press
-			while( read(0, &key, 1) == 0);
-			// Purge unread characters
-			tcflush(0, TCIFLUSH);
-		}
-
-		// Set up the primary display mode
-		ret = drmModeSetCrtc(gfx_fd, curr_connector.crtc, prim_fb_id,
-				     0, 0, &curr_connector.id, 1, &curr_connector.mode);
-		if (ret != 0) {
-			printf("Failed to set mode (%dx%d@%dHz): %s\n",
-				prim_width, prim_height, curr_connector.mode.vrefresh,
-				strerror(errno));
-			continue;
-		}
-
-		// Set the sprite colorkey state
-		for(i = 0; i < sprite_plane_count; i++) {
-			set.plane_id = sprite_plane_id[i];
-			set.min_value = 0;
-			set.max_value = 0;
-			set.flags = I915_SET_COLORKEY_NONE;
-			ret = drmCommandWrite(gfx_fd, DRM_I915_SET_SPRITE_COLORKEY, &set,
-					      sizeof(set));
-			assert(ret == 0);
-		}
-
-		// Set up sprite output dimensions, initial position, etc.
-		if (out_w > prim_width / 2)
-			out_w = prim_width / 2;
-		if (out_h > prim_height / 2)
-			out_h = prim_height / 2;
-
-		delta_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		delta_y = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_x = (int *) malloc(sprite_plane_count * sizeof(int));
-		sprite_y = (int *) malloc(sprite_plane_count * sizeof(int));
-
-		/* Initializing the coordinates (x,y) of the available sprites on the
-		 * connector, equally spaced along the diagonal of the rectangle
-		 * {(0,0),(prim_width/2, prim_height/2)}.
-		 */
-		for(i = 0; i < sprite_plane_count; i++) {
-			delta_x[i] = 3;
-			delta_y[i] = 4;
-			sprite_x[i] = i * (prim_width / (2 * sprite_plane_count));
-			sprite_y[i] = i * (prim_height / (2 * sprite_plane_count));
-		}
-
-		currTime = 0;
-		prevFlipTime = 0;       // Will force immediate sprite flip
-		prevMoveTime = 0;       // Will force immediate sprite move
-		deltaFlipTime = 500000; // Flip sprite surface every 1/2 second
-		deltaMoveTime = 100000; // Move sprite every 100 ms
-		sprite_index = num_surfaces - 1;
-		keep_moving = 1;
-
-		// Bounce sprite off the walls
-		while (keep_moving) {
-			// Obtain system time in usec.
-			if (gettimeofday( &stTimeVal, NULL ) != 0)
-				printf("gettimeofday error: %s\n", strerror(errno));
-			else
-				currTime = ((long long)stTimeVal.tv_sec * 1000000) + stTimeVal.tv_usec;
-
-			// Check if it's time to flip the sprite surface
-			if (currTime - prevFlipTime > deltaFlipTime) {
-				sprite_index = (sprite_index + 1) % num_surfaces;
-
-				prevFlipTime = currTime;
-			}
-
-			// Move the sprite on the screen and flip
-			// the surface if the index has changed
-			// NB: sprite_w and sprite_h must be 16.16 fixed point, herego << 16
-			for(i = 0; i < sprite_plane_count; i++) {
-				if (drmModeSetPlane(gfx_fd, sprite_plane_id[i],
-						    curr_connector.crtc,
-						    sprite_fb_id[sprite_index],
-						    plane_flags,
-						    sprite_x[i], sprite_y[i],
-						    out_w, out_h,
-						    0, 0,
-						    sprite_w << 16, sprite_h << 16))
-					printf("Failed to enable sprite plane: %s\n",
-						strerror(errno));
-			}
-
-			// Check if it's time to move the sprite surface
-			if (currTime - prevMoveTime > deltaMoveTime)  {
-
-				// Compute the next position for sprite
-				for(i = 0; i < sprite_plane_count; i++) {
-					sprite_x[i] += delta_x[i];
-					sprite_y[i] += delta_y[i];
-					if (sprite_x[i] < 0) {
-						sprite_x[i] = 0;
-						delta_x[i] = -delta_x[i];
-					}
-					else if (sprite_x[i] > prim_width - out_w) {
-						sprite_x[i] = prim_width - out_w;
-						delta_x[i] = -delta_x[i];
-					}
-
-					if (sprite_y[i] < 0) {
-						sprite_y[i] = 0;
-						delta_y[i] = -delta_y[i];
-					}
-					else if (sprite_y[i] > prim_height - out_h) {
-						sprite_y[i] = prim_height - out_h;
-						delta_y[i] = -delta_y[i];
-					}
-				}
-				prevMoveTime = currTime;
-			}
-
-			// Fetch a key from input (non-blocking)
-			if (read(0, &key, 1) == 1) {
-				switch (key) {
-				case 'q':       // Kill the program
-				case 'Q':
-					goto out;
-					break;
-				case 's':       // Slow down sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 90;
-					if (deltaMoveTime > 800000) {
-						deltaMoveTime = 800000;
-					}
-					break;
-				case 'S':       // Speed up sprite movement;
-					deltaMoveTime = (deltaMoveTime * 100) / 110;
-					if (deltaMoveTime < 2000) {
-						deltaMoveTime = 2000;
-					}
-					break;
-				case 'f':       // Slow down sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 90;
-					if (deltaFlipTime > 1000000)
-						deltaFlipTime = 1000000;
-					break;
-				case 'F':       // Speed up sprite flipping;
-					deltaFlipTime = (deltaFlipTime * 100) / 110;
-					if (deltaFlipTime < 20000)
-						deltaFlipTime = 20000;
-					break;
-				case 'n':       // Next connector
-				case 'N':
-					keep_moving = 0;
-					break;
-				default:
-					break;
-				}
-
-				// Purge unread characters
-				tcflush(0, TCIFLUSH);
-			}
-
-			// Wait for min of flip or move deltas
-			SleepTime = (deltaFlipTime < deltaMoveTime) ?
-				deltaFlipTime : deltaMoveTime;
-			usleep(SleepTime);
-		}
-
-		free(sprite_plane_id);
-		free(sprite_x);
-		free(sprite_y);
-		free(delta_x);
-		free(delta_y);
-		sprite_plane_id = NULL;
-		sprite_plane_count = 0;
-		sprite_x = sprite_y = delta_x = delta_y = NULL;
-	}
-
-out:
-	// Purge unread characters
-	tcflush(0, TCIFLUSH);
-	// Restore previous terminal settings
-	if (tcsetattr( 0, TCSANOW, &orig_term) != 0) {
-		printf("tcgetattr failure: %s\n", strerror(errno));
-		return;
-	}
-
-	drmModeFreeResources(gfx_resources);
-}
-
-static void usage(char *name)
-{
-	printf("usage: %s -s <plane width>x<plane height> [-dhto]\n"
-		"\t-d\t[optional] dump mode information\n"
-		"\t-h\t[optional] output help message\n"
-		"\t-t\t[optional] enable tiling\n"
-		"\t-o\t[optional] <output rect width>x<output rect height>\n\n"
-		"Keyboard control for sprite movement and flip rate ...\n"
-		"\t'q' or 'Q' - Quit the program\n"
-		"\t'n' or 'N' - Switch to next display\n"
-		"\t's'        - Slow sprite movement\n"
-		"\t'S'        - Speed up sprite movement\n"
-		"\t'f'        - Slow sprite surface flipping\n"
-		"\t'F'        - Speed up sprite surface flipping\n",
-		name);
-}
-
-int main(int argc, char **argv)
-{
-	int                 c;
-	int                 test_overlay = 0,
-			    enable_tiling = 0,
-			    dump_info = 0;
-	int                 plane_width = 0,
-			    plane_height = 0,
-			    out_width = 0,
-			    out_height = 0;
-	static char         optstr[] = "ds:o:th";
-
-	opterr = 0;
-	while ((c = getopt(argc, argv, optstr)) != -1) {
-		switch (c) {
-		case 'd':               // Dump information
-			dump_info = 1;
-			break;
-		case 't':               // Tiling enable
-			enable_tiling = 1;
-			break;
-		case 's':               // Surface dimensions
-			if (sscanf(optarg, "%dx%d", &plane_width, &plane_height) != 2)
-				usage(argv[0]);
-			test_overlay = 1;
-			break;
-		case 'o':               // Output dimensions
-			if (sscanf(optarg, "%dx%d", &out_width, &out_height) != 2)
-				usage(argv[0]);
-			break;
-		default:
-			printf("unknown option %c\n", c);
-			/* fall through */
-		case 'h':               // Help!
-			usage(argv[0]);
-			goto out;
-		}
-	}
-
-	if (test_overlay) {
-		if (out_width < (plane_width / 2))
-			out_width = plane_width;
-
-		if (out_height < (plane_height / 2))
-			out_height = plane_height;
-
-		ricochet(enable_tiling, plane_width, plane_height, out_width, out_height, dump_info);
-	} else {
-		printf("Sprite dimensions are required:\n");
-		usage(argv[0]);
-	}
-
-out:
-	exit(0);
-}
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t] build: Define _GNU_SOURCE in Makefile.am
  2017-09-05 16:19   ` [PATCH i-g-t] " Daniel Vetter
@ 2017-09-05 21:08     ` Chris Wilson
  2017-09-06  9:02       ` Daniel Vetter
  0 siblings, 1 reply; 48+ messages in thread
From: Chris Wilson @ 2017-09-05 21:08 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

Quoting Daniel Vetter (2017-09-05 17:19:45)
> In meson I want to just set this everywhere (no reason not to), and
> doing so will allow us to clean up a few things.

If we are keeping config.h in meson, why move -D_GNU_SOURCE to the
commandline, surely the fix is that those files not including config.h
should? Today it's a missing _GNU_SOURCE, tomorrow it could be any of the
little config details.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev5)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (22 preceding siblings ...)
  2017-09-05 16:21 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev3) Patchwork
@ 2017-09-06  7:52 ` Patchwork
  2017-09-06  7:53 ` Patchwork
                   ` (9 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-06  7:52 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev5)
URL   : https://patchwork.freedesktop.org/series/29823/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
918863f8e3e8f49235fd2e4a36e11f386c06c11c intel_display_poller: Fix truncation of a test name.

Making check in lib
make  check-recursive
Making check in .
Making check in tests
make  igt_no_exit igt_no_exit_list_only igt_fork_helper igt_list_only igt_no_subtest igt_simulation igt_simple_test_subtests igt_stats igt_timeout igt_invalid_subtest_name igt_segfault igt_subtest_group igt_assert igt_exit_handler igt_hdmi_inject igt_can_fail igt_can_fail_simple 
  CC       igt_no_exit_list_only.o
  CC       igt_no_exit.o
  CC       igt_list_only.o
  CC       igt_fork_helper.o
  CC       igt_simulation.o
  CC       igt_simple_test_subtests.o
  CC       igt_no_subtest.o
  CC       igt_stats.o
  CC       igt_timeout.o
  CC       igt_invalid_subtest_name.o
  CC       igt_segfault.o
  CC       igt_subtest_group.o
  CC       igt_exit_handler.o
  CC       igt_assert.o
  CC       igt_hdmi_inject.o
  CC       igt_can_fail.o
  CC       igt_can_fail_simple.o
  CCLD     igt_simple_test_subtests
  CCLD     igt_can_fail
  CCLD     igt_timeout
  CCLD     igt_list_only
  CCLD     igt_no_exit
  CCLD     igt_exit_handler
  CCLD     igt_invalid_subtest_name
  CCLD     igt_fork_helper
  CCLD     igt_can_fail_simple
  CCLD     igt_segfault
  CCLD     igt_simulation
  CCLD     igt_assert
  CCLD     igt_stats
  CCLD     igt_no_exit_list_only
  CCLD     igt_no_subtest
  CCLD     igt_subtest_group
  CCLD     igt_hdmi_inject
make  check-TESTS
PASS: igt_list_only
../../build-aux/test-driver: line 107: 34578 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit_list_only
PASS: igt_fork_helper
PASS: igt_hdmi_inject
PASS: igt_can_fail
PASS: igt_subtest_group
PASS: igt_can_fail_simple
PASS: igt_stats
PASS: igt_exit_handler
PASS: igt_assert
PASS: igt_simulation
../../build-aux/test-driver: line 107: 34615 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_subtest
../../build-aux/test-driver: line 107: 34566 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit
../../build-aux/test-driver: line 107: 34626 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_simple_test_subtests
../../build-aux/test-driver: line 107: 34647 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_invalid_subtest_name
PASS: igt_segfault
XFAIL: igt_timeout
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
Making check in man
make[1]: Nothing to be done for 'check'.
Making check in tools
Making check in null_state_gen
make[2]: Nothing to be done for 'check'.
Making check in registers
make[2]: Nothing to be done for 'check'.
make[2]: Nothing to be done for 'check-am'.
Making check in scripts
make[1]: Nothing to be done for 'check'.
Making check in benchmarks
make[1]: Nothing to be done for 'check'.
Making check in tests
Making check in intel-ci
make[2]: Nothing to be done for 'check'.
make  igt_command_line.sh 
make[3]: Nothing to be done for 'igt_command_line.sh'.
make  check-TESTS
FAIL: igt_command_line.sh
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT
============================================================================
Makefile:4524: recipe for target 'test-suite.log' failed
make[4]: *** [test-suite.log] Error 1
Makefile:4630: recipe for target 'check-TESTS' failed
make[3]: *** [check-TESTS] Error 2
Makefile:4728: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
Makefile:4417: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
Makefile:528: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
====================================================
   intel-gpu-tools 1.19: lib/tests/test-suite.log
====================================================

# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

XFAIL: igt_no_exit
==================

IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Subtest A: SUCCESS (0.000s)
igt_no_exit: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
XFAIL igt_no_exit (exit status: 134)

XFAIL: igt_no_exit_list_only
============================

igt_no_exit_list_only: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
A
XFAIL igt_no_exit_list_only (exit status: 134)

XFAIL: igt_no_subtest
=====================

igt_no_subtest: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_no_subtest (exit status: 134)

XFAIL: igt_simple_test_subtests
===============================

igt_simple_test_subtests: igt_core.c:948: __igt_run_subtest: Assertion `test_with_subtests' failed.
IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_simple_test_subtests (exit status: 134)

XFAIL: igt_timeout
==================

Test igt_timeout failed.
**** DEBUG ****
(igt_timeout:34649) igt-core-INFO: IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_timeout:34649) igt-core-INFO: Timed out: Testcase
****  END  ****
IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Timed out: Testcase
FAIL (1.000s)
XFAIL igt_timeout (exit status: 99)

XFAIL: igt_invalid_subtest_name
===============================

IGT-Version: 1.19-g9436f1f3 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_invalid_subtest_name:34647) igt-core-CRITICAL: Invalid subtest name "# invalid name !".
igt_invalid_subtest_name: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
Received signal SIGABRT.
XFAIL igt_invalid_subtest_name (exit status: 134)

================================================
   intel-gpu-tools 1.19: tests/test-suite.log
================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: igt_command_line.sh
=========================

./igt_command_line.sh: 45: ./igt_command_line.sh: Syntax error: "(" unexpected
FAIL igt_command_line.sh (exit status: 2)


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev5)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (23 preceding siblings ...)
  2017-09-06  7:52 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev5) Patchwork
@ 2017-09-06  7:53 ` Patchwork
  2017-09-06  8:19 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev6) Patchwork
                   ` (8 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-06  7:53 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev5)
URL   : https://patchwork.freedesktop.org/series/29823/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
918863f8e3e8f49235fd2e4a36e11f386c06c11c intel_display_poller: Fix truncation of a test name.

Making check in lib
make  check-recursive
Making check in .
Making check in tests
make  igt_no_exit igt_no_exit_list_only igt_fork_helper igt_list_only igt_no_subtest igt_simulation igt_simple_test_subtests igt_stats igt_timeout igt_invalid_subtest_name igt_segfault igt_subtest_group igt_assert igt_exit_handler igt_hdmi_inject igt_can_fail igt_can_fail_simple 
  CC       igt_no_exit.o
  CC       igt_no_exit_list_only.o
  CC       igt_fork_helper.o
  CC       igt_list_only.o
  CC       igt_no_subtest.o
  CC       igt_simulation.o
  CC       igt_simple_test_subtests.o
  CC       igt_stats.o
  CC       igt_invalid_subtest_name.o
  CC       igt_timeout.o
  CC       igt_segfault.o
  CC       igt_subtest_group.o
  CC       igt_exit_handler.o
  CC       igt_assert.o
  CC       igt_hdmi_inject.o
  CC       igt_can_fail_simple.o
  CC       igt_can_fail.o
  CCLD     igt_timeout
  CCLD     igt_can_fail_simple
  CCLD     igt_can_fail
  CCLD     igt_invalid_subtest_name
  CCLD     igt_fork_helper
  CCLD     igt_exit_handler
  CCLD     igt_list_only
  CCLD     igt_subtest_group
  CCLD     igt_segfault
  CCLD     igt_simple_test_subtests
  CCLD     igt_simulation
  CCLD     igt_assert
  CCLD     igt_stats
  CCLD     igt_no_exit
  CCLD     igt_no_exit_list_only
  CCLD     igt_no_subtest
  CCLD     igt_hdmi_inject
make  check-TESTS
PASS: igt_list_only
../../build-aux/test-driver: line 107:  3396 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit_list_only
PASS: igt_fork_helper
PASS: igt_can_fail_simple
PASS: igt_can_fail
PASS: igt_hdmi_inject
PASS: igt_stats
PASS: igt_subtest_group
PASS: igt_exit_handler
PASS: igt_assert
PASS: igt_simulation
../../build-aux/test-driver: line 107:  3463 Aborted                 (core dumped) "$@" > $log_file 2>&1
../../build-aux/test-driver: line 107:  3501 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_subtest
XFAIL: igt_invalid_subtest_name
../../build-aux/test-driver: line 107:  3480 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_simple_test_subtests
../../build-aux/test-driver: line 107:  3388 Aborted                 (core dumped) "$@" > $log_file 2>&1
XFAIL: igt_no_exit
PASS: igt_segfault
XFAIL: igt_timeout
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
Making check in man
make[1]: Nothing to be done for 'check'.
Making check in tools
Making check in null_state_gen
make[2]: Nothing to be done for 'check'.
Making check in registers
make[2]: Nothing to be done for 'check'.
make[2]: Nothing to be done for 'check-am'.
Making check in scripts
make[1]: Nothing to be done for 'check'.
Making check in benchmarks
make[1]: Nothing to be done for 'check'.
Making check in tests
Making check in intel-ci
make[2]: Nothing to be done for 'check'.
make  igt_command_line.sh 
make[3]: Nothing to be done for 'igt_command_line.sh'.
make  check-TESTS
FAIL: igt_command_line.sh
============================================================================
Testsuite summary for intel-gpu-tools 1.19
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT
============================================================================
Makefile:4524: recipe for target 'test-suite.log' failed
make[4]: *** [test-suite.log] Error 1
Makefile:4630: recipe for target 'check-TESTS' failed
make[3]: *** [check-TESTS] Error 2
Makefile:4728: recipe for target 'check-am' failed
make[2]: *** [check-am] Error 2
Makefile:4417: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
Makefile:528: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
====================================================
   intel-gpu-tools 1.19: lib/tests/test-suite.log
====================================================

# TOTAL: 17
# PASS:  11
# SKIP:  0
# XFAIL: 6
# FAIL:  0
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

XFAIL: igt_no_exit
==================

IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Subtest A: SUCCESS (0.000s)
igt_no_exit: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
XFAIL igt_no_exit (exit status: 134)

XFAIL: igt_no_exit_list_only
============================

igt_no_exit_list_only: igt_core.c:571: common_exit_handler: Assertion `sig != 0 || igt_exit_called' failed.
A
XFAIL igt_no_exit_list_only (exit status: 134)

XFAIL: igt_no_subtest
=====================

igt_no_subtest: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_no_subtest (exit status: 134)

XFAIL: igt_simple_test_subtests
===============================

igt_simple_test_subtests: igt_core.c:948: __igt_run_subtest: Assertion `test_with_subtests' failed.
IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Received signal SIGABRT.
XFAIL igt_simple_test_subtests (exit status: 134)

XFAIL: igt_timeout
==================

Test igt_timeout failed.
**** DEBUG ****
(igt_timeout:3502) igt-core-INFO: IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_timeout:3502) igt-core-INFO: Timed out: Testcase
****  END  ****
IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
Timed out: Testcase
FAIL (1.000s)
XFAIL igt_timeout (exit status: 99)

XFAIL: igt_invalid_subtest_name
===============================

IGT-Version: 1.19-g74849945 (x86_64) (Linux: 4.10.0-28-generic x86_64)
(igt_invalid_subtest_name:3501) igt-core-CRITICAL: Invalid subtest name "# invalid name !".
igt_invalid_subtest_name: igt_core.c:1473: igt_exit: Assertion `!test_with_subtests || skipped_one || succeeded_one || failed_one' failed.
Received signal SIGABRT.
XFAIL igt_invalid_subtest_name (exit status: 134)

================================================
   intel-gpu-tools 1.19: tests/test-suite.log
================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: igt_command_line.sh
=========================

./igt_command_line.sh: 45: ./igt_command_line.sh: Syntax error: "(" unexpected
FAIL igt_command_line.sh (exit status: 2)


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] tests/igt_command_line.sh: Allow testing individual tests
  2017-09-05 16:43   ` [PATCH i-g-t] " Daniel Vetter
@ 2017-09-06  8:02     ` Daniel Vetter
  0 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-06  8:02 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

meso will use this to run the tests for all testcases in parallel, for
great speedup!

v2: Fix bugs in the conversion. Oops, I broke the automake build.

v3: Try harder at being posix shell compliant.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 tests/igt_command_line.sh | 42 ++++++++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/tests/igt_command_line.sh b/tests/igt_command_line.sh
index 7f80fc805d37..57d105e958ae 100755
--- a/tests/igt_command_line.sh
+++ b/tests/igt_command_line.sh
@@ -37,26 +37,19 @@ fi
 # Manually running this script is possible in the source root or the
 # tests directory.
 
-TESTLISTFILE="$tests_dir/test-list.txt"
-if [ ! -r "$TESTLISTFILE" ]; then
-	tests_dir="tests"
-	TESTLISTFILE="$tests_dir/test-list.txt"
-fi
-
-TESTLIST=`cat $TESTLISTFILE`
-if [ $? -ne 0 ]; then
-	echo "Error: Could not read test lists"
-	exit 99
-fi
-
 fail () {
 	echo "FAIL: $1"
 	exit 1
 }
 
-for test in $TESTLIST; do
+check_test ()
+{
+	local test
+
+	test=$1
+
 	if [ "$test" = "TESTLIST" -o "$test" = "END" ]; then
-		continue
+		return
 	fi
 
 	testname="$test"
@@ -105,4 +98,25 @@ for test in $TESTLIST; do
 	# check invalid subtest handling
 	echo "  Checking invalid subtest handling..."
 	./$test --run-subtest invalid-subtest > /dev/null 2>&1 && fail $test
+}
+
+TESTLISTFILE="$tests_dir/test-list.txt"
+if [ ! -r "$TESTLISTFILE" ]; then
+	tests_dir="tests"
+	TESTLISTFILE="$tests_dir/test-list.txt"
+fi
+
+TESTLIST=`cat $TESTLISTFILE`
+if [ $? -ne 0 ]; then
+	echo "Error: Could not read test lists"
+	exit 99
+fi
+
+if [[ "$1" != "" ]] ; then
+	check_test $1
+	exit 0
+fi
+
+for test in $TESTLIST; do
+	check_test $test
 done
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* ✓ Fi.CI.BAT: success for RFC: meson build system support (rev6)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (24 preceding siblings ...)
  2017-09-06  7:53 ` Patchwork
@ 2017-09-06  8:19 ` Patchwork
  2017-09-06  9:44 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (7 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-06  8:19 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev6)
URL   : https://patchwork.freedesktop.org/series/29823/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
918863f8e3e8f49235fd2e4a36e11f386c06c11c intel_display_poller: Fix truncation of a test name.

with latest DRM-Tip kernel build CI_DRM_3044
0640ea73be26 drm-tip: 2017y-09m-06d-06h-41m-15s UTC integration manifest

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                skip       -> PASS       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:459s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:445s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:360s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:554s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:254s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:523s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:529s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:520s
fi-cfl-s         total:289  pass:250  dwarn:4   dfail:0   fail:0   skip:35  time:475s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:441s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:619s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:450s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:426s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:431s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:502s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:486s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:513s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:602s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:612s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:532s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:475s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:528s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:521s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:456s
fi-skl-x1585l    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:527s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:562s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:1   skip:39  time:409s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_150/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t] build: Define _GNU_SOURCE in Makefile.am
  2017-09-05 21:08     ` Chris Wilson
@ 2017-09-06  9:02       ` Daniel Vetter
  0 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-06  9:02 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development

On Tue, Sep 5, 2017 at 11:08 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Daniel Vetter (2017-09-05 17:19:45)
>> In meson I want to just set this everywhere (no reason not to), and
>> doing so will allow us to clean up a few things.
>
> If we are keeping config.h in meson, why move -D_GNU_SOURCE to the
> commandline, surely the fix is that those files not including config.h
> should? Today it's a missing _GNU_SOURCE, tomorrow it could be any of the
> little config details.

Ime _GNU_SOURCE tends to fail somewhat silent, but if you forget to
include config.h for a HAVE_FOO_LIB, you'll noticed pretty fast.
That's more or less my thinking, but I guess we could force-include
config.h everywhere by default too. Not sure that's good, since we imo
overuse all those little optional deps way too much. And there's a
_lot_ of places which don't include config.h. Pretty much all the test
for example.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* ✓ Fi.CI.IGT: success for RFC: meson build system support (rev6)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (25 preceding siblings ...)
  2017-09-06  8:19 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev6) Patchwork
@ 2017-09-06  9:44 ` Patchwork
  2017-09-08  9:07 ` [PATCH i-g-t 00/22] RFC: meson build system support Jani Nikula
                   ` (6 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-06  9:44 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev6)
URL   : https://patchwork.freedesktop.org/series/29823/
State : success

== Summary ==

Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-C:
                pass       -> DMESG-WARN (shard-hsw) fdo#102249
Test perf:
        Subgroup polling:
                pass       -> FAIL       (shard-hsw) fdo#102252 +1
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912

fdo#102249 https://bugs.freedesktop.org/show_bug.cgi?id=102249
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2265 pass:1231 dwarn:1   dfail:0   fail:17  skip:1016 time:9641s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_150/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 07/22] lib: clean up header includes
  2017-09-05 12:36 ` [PATCH i-g-t 07/22] lib: clean up header includes Daniel Vetter
@ 2017-09-06 11:44   ` Chris Wilson
  2017-09-08  6:55     ` Daniel Vetter
  2017-09-08  9:23   ` [PATCH i-g-t] " Daniel Vetter
  1 sibling, 1 reply; 48+ messages in thread
From: Chris Wilson @ 2017-09-06 11:44 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Quoting Daniel Vetter (2017-09-05 13:36:09)
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index f2a94b5572ea..a2061ff6138e 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -22,11 +22,18 @@
>   *
>   */
>  
> -#include "igt.h"
> -#include "igt_dummyload.h"
>  #include <time.h>
>  #include <signal.h>
>  #include <sys/syscall.h>
> +#include <sys/mman.h>

For PROT_*? It's using the gem_mmap/gem_munmap interfaces, should we not
then be defining PROT_* as part of that interface.

We don't need the raw syscall interface here.

> +
> +#include <i915_drm.h>
> +
> +#include "igt_dummyload.h"
> +#include "igt_gt.h"
> +#include "intel_batchbuffer.h"

What are we pulling in from batchbuffer.h? I think you mean intel_reg.h.
Both are inappropriate places for MI commands.

igt_core.h for igt_require

-#include "igt.h"
-#include "igt_dummyload.h"
 #include <time.h>
 #include <signal.h>
-#include <sys/syscall.h>
+
+#include <i915_drm.h>
+
+#include "igt_core.h"
+#include "igt_dummyload.h"
+#include "igt_gt.h"
+#include "intel_chipset.h"
+#include "intel_reg.h"
+#include "ioctl_wrappers.h"

plus the indirect sys/mman.h via ioctl_wrappers.h
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 12/22] meson: basic build system support
  2017-09-05 12:36 ` [PATCH i-g-t 12/22] meson: basic build system support Daniel Vetter
@ 2017-09-06 14:01   ` Jani Nikula
  2017-09-08  6:50     ` Daniel Vetter
  0 siblings, 1 reply; 48+ messages in thread
From: Jani Nikula @ 2017-09-06 14:01 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter, Daniel Vetter

On Tue, 05 Sep 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Why?
>
> Because it's fast.

And that's not even the main reason from my perspective! ;)

Please find some comments inline. None of them are blockers.

BR,
Jani.

>
> Like really, really fast.
>
> Some data (from a snb laptop, so rather lower-powered):
>
> - Incremental build after $ touch lib/igt_core.c with meson: 0.6s
>   It notices that the symbol list of the libigt.so hasn't changed and
>   doesn't bother re-linking the almost 300 binaries we have. make -j 6
>   for the same scenario takes 44s.
>
> - Incremental build with nothing changed: make: 0.7s, meson: 0.2s This
>   means stuff like --disable-git-hash is entirely pointless with
>   meson, it's faster than a make ever can be (with 0.6s).
>
> - Reconfigure stage: ninja reconfigure 0.8s vs. ./configure 8.6s)
>
> - Running tests, after a full build: ninja test 6s vs. make check 24s
>
> - Full build (i.e. including ./autogen.sh respectively meson build),
>   including tests, from a pristine git checkout. automake 2m49s vs.
>   meson 44s.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Eric Anholt <eric@anholt.net>
> Cc: Daniel Stone <daniel@fooishbar.org>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  .gitignore                       |   1 +
>  assembler/meson.build            |  73 ++++++++++
>  benchmarks/meson.build           |  36 +++++
>  lib/meson.build                  | 166 ++++++++++++++++++++++
>  lib/prepend_log_domain.sh        |   8 ++
>  lib/tests/meson.build            |  34 +++++
>  lib/version.h.in                 |   1 +
>  meson.build                      | 105 ++++++++++++++
>  overlay/meson.build              |  59 ++++++++
>  tests/generate_testlist.sh       |  10 ++
>  tests/meson.build                | 290 +++++++++++++++++++++++++++++++++++++++
>  tools/meson.build                |  59 ++++++++
>  tools/null_state_gen/meson.build |  15 ++
>  13 files changed, 857 insertions(+)
>  create mode 100644 assembler/meson.build
>  create mode 100644 benchmarks/meson.build
>  create mode 100644 lib/meson.build
>  create mode 100755 lib/prepend_log_domain.sh
>  create mode 100644 lib/tests/meson.build
>  create mode 100644 lib/version.h.in
>  create mode 100644 meson.build
>  create mode 100644 overlay/meson.build
>  create mode 100755 tests/generate_testlist.sh
>  create mode 100644 tests/meson.build
>  create mode 100644 tools/meson.build
>  create mode 100644 tools/null_state_gen/meson.build
>
> diff --git a/.gitignore b/.gitignore
> index 6204965a0e32..e6919272d8b6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -93,3 +93,4 @@ intel-gpu-tools-*/
>  
>  piglit
>  results
> +build
> diff --git a/assembler/meson.build b/assembler/meson.build
> new file mode 100644
> index 000000000000..bdddd0e2db25
> --- /dev/null
> +++ b/assembler/meson.build
> @@ -0,0 +1,73 @@
> +lib_brw_src = [
> +	'brw_context.c',
> +	'brw_disasm.c',
> +	'brw_eu.c',
> +	'brw_eu_compact.c',
> +	'brw_eu_debug.c',
> +	'brw_eu_emit.c',
> +	'brw_eu_util.c',
> +	'gen8_disasm.c',
> +	'gen8_instruction.c',
> +	'ralloc.c',
> +]

FWIW I like this style of assigning lists.

> +
> +lib_brw = shared_library('brw', lib_brw_src,
> +		dependencies : igt_deps)

The Emacs meson mode nicely indents the continuation lines after the
opening (. These seem off... all over the place.

> +
> +flex = find_program('flex')
> +bison = find_program('bison')
> +
> +lgen = generator(flex,
> +		output : '@BASENAME@.c',
> +		arguments : ['-o', '@OUTPUT@', '@INPUT@'])
> +
> +lfiles = lgen.process('lex.l')
> +
> +pgen = generator(bison,
> +		output : ['@BASENAME@.c', '@BASENAME@.h'],
> +		arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
> +
> +pfiles = pgen.process('gram.y')
> +
> +executable('intel-gen4asm', 'main.c', lfiles, pfiles, link_with : lib_brw)
> +
> +executable('intel-gen4disasm', 'disasm-main.c', link_with : lib_brw)
> +
> +gen4asm_testcases = [
> +	'test/mov',
> +	'test/frc',
> +	'test/rndd',
> +	'test/rndu',
> +	'test/rnde',
> +	'test/rnde-intsrc',
> +	'test/rndz',
> +	'test/lzd',
> +	'test/not',
> +	'test/immediate',
> +]
> +
> +# Those tests were already failing when the assembler was imported from
> +# the intel-gen4asm git repository:
> +#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
> +# We disable them "for now" as a workaround to be able to release i-g-t
> +gen4asm_testcases_broken = [
> +	'test/declare',
> +	'test/jmpi',
> +	'test/if',
> +	'test/iff',
> +	'test/while',
> +	'test/else',
> +	'test/break',
> +	'test/cont',
> +	'test/halt',
> +	'test/wait',
> +	'test/endif',
> +]
> +
> +test_runner = find_program('test/run-test.sh')
> +foreach testcase : gen4asm_testcases
> +	test('assembler: ' + testcase, test_runner,
> +			args : testcase,
> +			env : [ 'srcdir=' + meson.current_source_dir(),
> +				'top_builddir=' + meson.current_build_dir()])
> +endforeach
> diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> new file mode 100644
> index 000000000000..9ab738f76588
> --- /dev/null
> +++ b/benchmarks/meson.build
> @@ -0,0 +1,36 @@
> +benchmark_progs = [
> +	'gem_blt',
> +	'gem_busy',
> +	'gem_create',
> +	'gem_exec_ctx',
> +	'gem_exec_fault',
> +	'gem_exec_nop',
> +	'gem_exec_reloc',
> +	'gem_exec_trace',
> +	'gem_latency',
> +	'gem_mmap',
> +	'gem_prw',
> +	'gem_set_domain',
> +	'gem_syslatency',
> +	'gem_wsim',
> +	'kms_vblank',
> +	'prime_lookup',
> +	'vgem_mmap',
> +]
> +
> +if libdrm_intel.found()
> +	benchmark_progs += [
> +		'intel_upload_blit_large',
> +		'intel_upload_blit_large_gtt',
> +		'intel_upload_blit_large_map',
> +		'intel_upload_blit_small',
> +		'gem_userptr_benchmark',
> +	]
> +endif
> +
> +foreach prog : benchmark_progs
> +	# FIXME meson doesn't like binaries with the same name
> +	# meanwhile just suffix with _bench
> +	executable(prog + '_bench', prog + '.c',
> +			dependencies : test_deps)
> +endforeach
> diff --git a/lib/meson.build b/lib/meson.build
> new file mode 100644
> index 000000000000..51d3f9e278da
> --- /dev/null
> +++ b/lib/meson.build
> @@ -0,0 +1,166 @@
> +lib_headers = [
> +	'debug.h',
> +	'drmtest.h',
> +	'i830_reg.h',
> +	'i915_3d.h',
> +	'i915_reg.h',
> +	'i915_pciids.h',
> +	'igt.h',
> +	'igt_debugfs.h',
> +	'igt_aux.h',
> +	'igt_edid_template.h',
> +	'igt_gt.h',
> +	'igt_gvt.h',
> +	'igt_primes.h',
> +	'igt_rand.h',
> +	'igt_stats.h',
> +	'igt_sysfs.h',
> +	'igt_x86.h',
> +	'igt_vgem.h',
> +	'instdone.h',
> +	'intel_batchbuffer.h',
> +	'intel_chipset.h',
> +	'intel_io.h',
> +	'intel_reg.h',
> +	'ioctl_wrappers.h',
> +	'media_fill.h',
> +	'media_spin.h',
> +	'gpgpu_fill.h',
> +	'gen7_media.h',
> +	'gen8_media.h',
> +	'gen6_render.h',
> +	'gen7_render.h',
> +	'gen8_render.h',
> +	'gen9_render.h',
> +	'rendercopy.h',
> +	'sw_sync.h',
> +	'igt_kms.h',
> +	'igt_fb.h',
> +	'igt_core.h',
> +	'igt_draw.h',
> +	'igt_pm.h',
> +	'igt_dummyload.h',
> +	'uwildmat/uwildmat.h',
> +	'igt_kmod.h',
> +]
> +
> +lib_sources = [
> +	'drmtest.c',
> +	'igt_debugfs.c',
> +	'igt_aux.c',
> +	'igt_gt.c',
> +	'igt_gvt.c',
> +	'igt_primes.c',
> +	'igt_rand.c',
> +	'igt_stats.c',
> +	'igt_sysfs.c',
> +	'igt_x86.c',
> +	'igt_vgem.c',
> +	'instdone.c',
> +	'intel_batchbuffer.c',
> +	'intel_chipset.c',
> +	'intel_device_info.c',
> +	'intel_os.c',
> +	'intel_mmio.c',
> +	'ioctl_wrappers.c',
> +	'media_fill_gen7.c',
> +	'media_fill_gen8.c',
> +	'media_fill_gen8lp.c',
> +	'media_fill_gen9.c',
> +	'media_spin.c',
> +	'gpgpu_fill.c',
> +	'rendercopy_i915.c',
> +	'rendercopy_i830.c',
> +	'rendercopy_gen6.c',
> +	'rendercopy_gen7.c',
> +	'rendercopy_gen8.c',
> +	'rendercopy_gen9.c',
> +	'sw_sync.c',
> +	'intel_reg_map.c',
> +	'intel_iosf.c',
> +	'igt_kms.c',
> +	'igt_fb.c',
> +	'igt_core.c',
> +	'igt_draw.c',
> +	'igt_pm.c',
> +	'igt_dummyload.c',
> +	'uwildmat/uwildmat.c',
> +	'igt_kmod.c',
> +]
> +
> +lib_deps = [
> +	cairo,
> +	glib,
> +	libdrm,
> +	libkmod,
> +	libprocps,
> +	libudev,
> +	libunwind,
> +	pciaccess,
> +	pthreads,
> +	math,
> +	realtime,
> +]
> +
> +if libdrm_intel.found()
> +	lib_deps += libdrm_intel
> +else
> +	lib_headers += 'stubs/drm/intel_bufmgr.h'
> +	lib_sources += 'stubs/drm/intel_bufmgr.c'
> +endif
> +
> +if libdrm_vc4.found()
> +	lib_headers += 'igt_vc4.h'
> +	lib_sources += 'igt_vc4.c'
> +endif
> +if valgrind.found()
> +	lib_deps += valgrind
> +endif
> +
> +if gsl.found()
> +	lib_deps += gsl
> +	lib_headers += [ 'igt_frame.h', 'igt_audio.h' ]
> +	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
> +endif
> +
> +if alsa.found()
> +	lib_deps += alsa
> +	lib_headers += 'igt_alsa.h'
> +	lib_sources += 'igt_alsa.c'
> +endif
> +
> +if chamelium.found()
> +	lib_deps += chamelium
> +	lib_headers += 'igt_chamelium.h'
> +	lib_sources += 'igt_chamelium.c'
> +endif
> +
> +install_headers(lib_headers)
> +
> +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
> +srcdir = join_paths(meson.source_root(), 'tests')
> +
> +vcs_tag(input : 'version.h.in', output : 'version.h',
> +	fallback : 'NO-GIT',
> +	command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] )
> +
> +# FIXME we don't regenerate when the script changes
> +prepend_log_domain = generator(find_program('prepend_log_domain.sh'),
> +		arguments : [ '@INPUT@', '@OUTPUT@' ],
> +		output : '@PLAINNAME@' + '.pre.c')
> +
> +processed_src_dep = prepend_log_domain.process(lib_sources)
> +
> +lib_igt_build = shared_library('igt',
> +			 processed_src_dep,
> +			 include_directories : inc,
> +			 dependencies : lib_deps,
> +			 c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
> +				'-DIGT_SRCDIR="@0@"'.format(srcdir), ])
> +
> +lib_igt = declare_dependency(link_with : lib_igt_build,
> +			    include_directories : inc)
> +
> +igt_deps = [ lib_igt ] + lib_deps
> +
> +subdir('tests')
> diff --git a/lib/prepend_log_domain.sh b/lib/prepend_log_domain.sh
> new file mode 100755
> index 000000000000..93a911508b7f
> --- /dev/null
> +++ b/lib/prepend_log_domain.sh
> @@ -0,0 +1,8 @@
> +#!/bin/bash
> +
> +input=$1
> +output=$2
> +basename=$(basename $1 .c)
> +
> +echo "#define IGT_LOG_DOMAIN \"$basename\"" > $output
> +cat $input >> $output
> diff --git a/lib/tests/meson.build b/lib/tests/meson.build
> new file mode 100644
> index 000000000000..29bdb2c4222c
> --- /dev/null
> +++ b/lib/tests/meson.build
> @@ -0,0 +1,34 @@
> +lib_tests = [
> +	'igt_fork_helper',
> +	'igt_list_only',
> +	'igt_simulation',
> +	'igt_stats',
> +	'igt_segfault',
> +	'igt_subtest_group',
> +	'igt_assert',
> +	'igt_exit_handler',
> +	'igt_hdmi_inject',
> +	'igt_can_fail',
> +	'igt_can_fail_simple',
> +]
> +
> +lib_fail_tests = [
> +	'igt_no_exit',
> +	'igt_no_exit_list_only',
> +	'igt_no_subtest',
> +	'igt_simple_test_subtests',
> +	'igt_timeout',
> +	'igt_invalid_subtest_name',
> +]
> +
> +foreach lib_test : lib_tests
> +	exec = executable(lib_test, lib_test + '.c', install : true,
> +			dependencies : igt_deps)
> +	test('lib: ' + lib_test, exec)
> +endforeach
> +
> +foreach lib_test : lib_fail_tests
> +	exec = executable(lib_test, lib_test + '.c', install : true,
> +			dependencies : igt_deps)
> +	test('lib: ' + lib_test, exec, should_fail : true)
> +endforeach
> diff --git a/lib/version.h.in b/lib/version.h.in
> new file mode 100644
> index 000000000000..72fc6978cf32
> --- /dev/null
> +++ b/lib/version.h.in
> @@ -0,0 +1 @@
> +#define IGT_GIT_SHA1 "@VCS_TAG@"
> diff --git a/meson.build b/meson.build
> new file mode 100644
> index 000000000000..fee64fcdf36e
> --- /dev/null
> +++ b/meson.build
> @@ -0,0 +1,105 @@
> +project('IGT gpu tests', 'c',
> +	version : '1.19',
> +        default_options: [
> +          'warning_level=2',
> +          'c_std=gnu99',
> +        ],
> +	license : 'MIT')
> +
> +cc = meson.get_compiler('c')
> +
> +inc = include_directories('lib', '.')
> +
> +config_h = configuration_data()
> +
> +libdrm = dependency('libdrm', version : '>=2.4.82')
> +libdrm_intel = dependency('libdrm_intel', required : false)
> +libdrm_vc4 = dependency('libdrm_vc4', required : false)
> +libdrm_nouveau = dependency('libdrm_nouveau', required : false)
> +libdrm_amdgpu = dependency('libdrm_amdgpu', required : false)
> +
> +pciaccess = dependency('pciaccess', version : '>=0.10')
> +libkmod = dependency('libkmod')
> +libprocps = dependency('libprocps', required : false)
> +if libprocps.found()
> +	config_h.set('HAVE_PROCPS', 1)
> +endif

I wish we used #if instead of #ifdef in code. With that you could use
the one-liner:

config_h.set10('HAVE_PROCPS', libprocps.found())

and have

#define HAVE_PROCPS 0

in config.h, which is helpful for debugging issues.

> +
> +valgrind = dependency('valgrind', required : false)
> +if valgrind.found()
> +	config_h.set('HAVE_VALGRIND', 1)
> +endif
> +
> +cairo = dependency('cairo', version : '>1.12.0', required : false)
> +
> +libudev = dependency('libudev', required : false)
> +if libudev.found()
> +	config_h.set('HAVE_UDEV', 1)
> +endif
> +
> +glib = dependency('glib-2.0', required : false)
> +if glib.found()
> +	config_h.set('HAVE_GLIB', 1)
> +endif
> +
> +libunwind = dependency('libunwind')
> +gsl = dependency('gsl', required : false)
> +alsa = dependency('alsa', required : false)
> +
> +pixman = dependency('pixman-1', required : false)
> +xmlrpc = dependency('xmlrpc', required : false)
> +xmlrpc_util = dependency('xmlrpc_util', required : false)
> +xmlrpc_client = dependency('xmlrpc_client', required : false)
> +
> +if pixman.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> +	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> +	  xmlrpc_util, xmlrpc_client])
> +else
> +	chamelium = dependency('', required: false)
> +endif
> +
> +pthreads = dependency('threads')
> +math = cc.find_library('m')
> +realtime = cc.find_library('rt')
> +dlsym = cc.find_library('dl')
> +zlib = cc.find_library('z')
> +
> +if cc.has_header('linux/kd.h')
> +	config_h.set('HAVE_LINUX_KD_H', 1)
> +endif
> +if cc.has_header('sys/kd.h')
> +	config_h.set('HAVE_SYS_KD_H', 1)
> +endif
> +if cc.has_header('libgen.h')
> +	config_h.set('HAVE_LIBGEN_H', 1)
> +endif
> +if cc.has_header('sys/io.h')
> +	config_h.set('HAVE_SYS_IO_H', 1)
> +endif
> +if cc.has_header('cpuid.h')
> +	# FIXME: Do we need the example link test from configure.ac?
> +	config_h.set('HAVE_CPUID_H', 1)
> +endif
> +
> +if cc.has_member('struct sysinfo', 'totalram',
> +		prefix : '#include <sys/sysinfo.h>')
> +	config_h.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1)
> +endif
> +
> +add_project_arguments('-D_GNU_SOURCE', language : 'c')
> +add_project_arguments('-include', 'config.h', language : 'c')

Ooo, that's a nice way to do this. TIL.

> +
> +config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
> +config_h.set_quoted('PACKAGE', meson.project_name())
> +config_h.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family())
> +
> +configure_file(output: 'config.h', install: false, configuration: config_h)

This makes me think config_h is a misnomer for the configuration data
object. I'd probably use plain "config" instead.

I think we'll end up wanting to use the configuration data for the test
runner shell scripts too, and generate a sh.config from the same
config. We can source the sh.config from e.g. run-tests.sh, to figure
out the source and build directories. We can use find_program() to find
piglit, for example, and shove that into sh.config.

Look at the beginning of run-tests.sh and see how much better it could
be with a sh.config.

Of course, the alternative is to use a separate configuration data
object for sh.config, but I think it's clearer to use one, and use .in
files to decide what goes in them.

> +
> +subdir('lib')
> +subdir('tests')
> +subdir('benchmarks')
> +subdir('tools')
> +if libdrm_intel.found()
> +	subdir('assembler')
> +	subdir('overlay')
> +endif
> diff --git a/overlay/meson.build b/overlay/meson.build
> new file mode 100644
> index 000000000000..a4b778ca5a86
> --- /dev/null
> +++ b/overlay/meson.build
> @@ -0,0 +1,59 @@
> +gpu_overlay_src = [
> +	'chart.c',
> +	'config.c',
> +	'cpu-top.c',
> +	'debugfs.c',
> +	'gem-interrupts.c',
> +	'gem-objects.c',
> +	'gpu-top.c',
> +	'gpu-perf.c',
> +	'gpu-freq.c',
> +	'igfx.c',
> +	'overlay.c',
> +	'perf.c',
> +	'power.c',
> +	'rc6.c',
> +]
> +
> +xv = dependency('xv', required : false)
> +x11 = dependency('x11', required : false)
> +xext = dependency('xext', required : false)
> +dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> +cairo_xlib = dependency('cairo-xlib', required : false)
> +xrandr = dependency('xrandr', version : '>=1.3', required : false)
> +
> +gpu_overlay_deps = [ realtime, cairo, pciaccess, libdrm, libdrm_intel ]
> +
> +both_x11_src = ''
> +
> +gpu_overlay_cflags = []
> +if xv.found() and x11.found() and xext.found() and dri2proto.found()
> +	both_x11_src = 'x11/position.c'
> +	gpu_overlay_src += [
> +		'x11/dri2.c',
> +		'x11/dri2.h',
> +		'x11/rgb2yuv.c',
> +		'x11/rgb2yuv.h',
> +		'x11/x11-overlay.c',
> +	]
> +	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
> +	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]

Hmm, seems a bit odd to have the config data split between a
configuration data object and flags like this.

> +endif
> +
> +if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> +	both_x11_src = 'x11/position.c'
> +	gpu_overlay_src += 'x11/x11-window.c'
> +	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
> +	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]

Ditto.

> +endif
> +
> +gpu_overlay_src += both_x11_src
> +
> +gpu_overlay_src += 'kms/kms-overlay.c'
> +
> +if xrandr.found() and cairo.found()
> +	executable('intel_gpu_overlay', gpu_overlay_src,
> +			include_directories : inc,
> +			c_args : gpu_overlay_cflags,
> +			dependencies : gpu_overlay_deps)
> +endif
> diff --git a/tests/generate_testlist.sh b/tests/generate_testlist.sh
> new file mode 100755
> index 000000000000..6ea78655daca
> --- /dev/null
> +++ b/tests/generate_testlist.sh
> @@ -0,0 +1,10 @@
> +#!/bin/bash
> +
> +echo TESTLIST > $MESON_BUILD_ROOT/tests/test-list.txt
> +
> +while [[ $# -gt 0 ]] ; do
> +	echo $1 >> $MESON_BUILD_ROOT/tests/test-list.txt
> +	shift
> +done
> +
> +echo END TESTLIST >> $MESON_BUILD_ROOT/tests/test-list.txt
> diff --git a/tests/meson.build b/tests/meson.build
> new file mode 100644
> index 000000000000..73833758be0e
> --- /dev/null
> +++ b/tests/meson.build
> @@ -0,0 +1,290 @@
> +test_progs = [
> +	'core_auth',
> +	'core_get_client_auth',
> +	'core_getclient',
> +	'core_getstats',
> +	'core_getversion',
> +	'core_prop_blob',
> +	'core_setmaster_vs_auth',
> +	'debugfs_test',
> +	'drm_import_export',
> +	'drm_mm',
> +	'drm_read',
> +	'drm_vma_limiter',
> +	'drm_vma_limiter_cached',
> +	'drm_vma_limiter_cpu',
> +	'drm_vma_limiter_gtt',
> +	'drv_getparams_basic',
> +	'drv_hangman',
> +	'drv_missed_irq',
> +	'drv_module_reload',
> +	'drv_selftest',
> +	'drv_suspend',
> +	'gem_bad_length',
> +	'gem_bad_reloc',
> +	'gem_basic',
> +	'gem_busy',
> +	'gem_caching',
> +	'gem_close',
> +	'gem_close_race',
> +	'gem_concurrent_blit',
> +	'gem_cpu_reloc',
> +	'gem_create',
> +	'gem_cs_prefetch',
> +	'gem_cs_tlb',
> +	'gem_ctx_bad_destroy',
> +	'gem_ctx_bad_exec',
> +	'gem_ctx_basic',
> +	'gem_ctx_create',
> +	'gem_ctx_exec',
> +	'gem_ctx_param',
> +	'gem_ctx_switch',
> +	'gem_ctx_thrash',
> +	'gem_double_irq_loop',
> +	'gem_eio',
> +	'gem_evict_alignment',
> +	'gem_evict_everything',
> +	'gem_exec_alignment',
> +	'gem_exec_async',
> +	'gem_exec_await',
> +	'gem_exec_bad_domains',
> +	'gem_exec_basic',
> +	'gem_exec_big',
> +	'gem_exec_blt',
> +	'gem_exec_capture',
> +	'gem_exec_create',
> +	'gem_exec_faulting_reloc',
> +	'gem_exec_fence',
> +	'gem_exec_flush',
> +	'gem_exec_gttfill',
> +	'gem_exec_latency',
> +	'gem_exec_lut_handle',
> +	'gem_exec_nop',
> +	'gem_exec_parallel',
> +	'gem_exec_params',
> +	'gem_exec_parse',
> +	'gem_exec_reloc',
> +	'gem_exec_reuse',
> +	'gem_exec_schedule',
> +	'gem_exec_store',
> +	'gem_exec_suspend',
> +	'gem_exec_whisper',
> +	'gem_fd_exhaustion',
> +	'gem_fence_thrash',
> +	'gem_fence_upload',
> +	'gem_fenced_exec_thrash',
> +	'gem_flink_basic',
> +	'gem_flink_race',
> +	'gem_gpgpu_fill',
> +	'gem_gtt_cpu_tlb',
> +	'gem_gtt_hog',
> +	'gem_gtt_speed',
> +	'gem_hangcheck_forcewake',
> +	'gem_largeobject',
> +	'gem_linear_blits',
> +	'gem_lut_handle',
> +	'gem_madvise',
> +	'gem_media_fill',
> +	'gem_mmap',
> +	'gem_mmap_gtt',
> +	'gem_mmap_offset_exhaustion',
> +	'gem_mmap_wc',
> +	'gem_mocs_settings',
> +	'gem_partial_pwrite_pread',
> +	'gem_persistent_relocs',
> +	'gem_pin',
> +	'gem_pipe_control_store_loop',
> +	'gem_ppgtt',
> +	'gem_pread',
> +	'gem_pread_after_blit',
> +	'gem_pwrite',
> +	'gem_pwrite_pread',
> +	'gem_pwrite_snooped',
> +	'gem_read_read_speed',
> +	'gem_readwrite',
> +	'gem_reg_read',
> +	'gem_reloc_overflow',
> +	'gem_reloc_vs_gpu',
> +	'gem_render_copy',
> +	'gem_render_copy_redux',
> +	'gem_render_linear_blits',
> +	'gem_render_tiled_blits',
> +	'gem_request_retire',
> +	'gem_reset_stats',
> +	'gem_ring_sync_copy',
> +	'gem_ring_sync_loop',
> +	'gem_ringfill',
> +	'gem_seqno_wrap',
> +	'gem_set_tiling_vs_blt',
> +	'gem_set_tiling_vs_gtt',
> +	'gem_set_tiling_vs_pwrite',
> +	'gem_shrink',
> +	'gem_softpin',
> +	'gem_spin_batch',
> +	'gem_stolen',
> +	'gem_storedw_batches_loop',
> +	'gem_storedw_loop',
> +	'gem_streaming_writes',
> +	'gem_sync',
> +	'gem_threaded_access_tiled',
> +	'gem_tiled_blits',
> +	'gem_tiled_fence_blits',
> +	'gem_tiled_partial_pwrite_pread',
> +	'gem_tiled_pread_basic',
> +	'gem_tiled_pread_pwrite',
> +	'gem_tiled_swapping',
> +	'gem_tiled_wb',
> +	'gem_tiled_wc',
> +	'gem_tiling_max_stride',
> +	'gem_unfence_active_buffers',
> +	'gem_unref_active_buffers',
> +	'gem_userptr_blits',
> +	'gem_wait',
> +	'gem_workarounds',
> +	'gem_write_read_ring_switch',
> +	'gen3_mixed_blits',
> +	'gen3_render_linear_blits',
> +	'gen3_render_mixed_blits',
> +	'gen3_render_tiledx_blits',
> +	'gen3_render_tiledy_blits',
> +	'gen7_forcewake_mt',
> +	'gvt_basic',
> +	'kms_3d',
> +	'kms_addfb_basic',
> +	'kms_atomic',
> +	'kms_atomic_transition',
> +	'kms_busy',
> +	'kms_ccs',
> +	'kms_chv_cursor_fail',
> +	'kms_concurrent',
> +	'kms_crtc_background_color',
> +	'kms_cursor_crc',
> +	'kms_cursor_legacy',
> +	'kms_draw_crc',
> +	'kms_fbc_crc',
> +	'kms_fbcon_fbt',
> +	'kms_fence_pin_leak',
> +	'kms_flip',
> +	'kms_flip_event_leak',
> +	'kms_flip_tiling',
> +	'kms_force_connector_basic',
> +	'kms_frontbuffer_tracking',
> +	'kms_hdmi_inject',
> +	'kms_invalid_dotclock',
> +	'kms_legacy_colorkey',
> +	'kms_mmap_write_crc',
> +	'kms_mmio_vs_cs_flip',
> +	'kms_panel_fitting',
> +	'kms_pipe_b_c_ivb',
> +	'kms_pipe_color',
> +	'kms_pipe_crc_basic',
> +	'kms_plane',
> +	'kms_plane_lowres',
> +	'kms_plane_multiple',
> +	'kms_plane_scaling',
> +	'kms_properties',
> +	'kms_psr_sink_crc',
> +	'kms_pwrite_crc',
> +	'kms_render',
> +	'kms_rmfb',
> +	'kms_rotation_crc',
> +	'kms_setmode',
> +	'kms_sink_crc_basic',
> +	'kms_sysfs_edid_timing',
> +	'kms_tv_load_detect',
> +	'kms_universal_plane',
> +	'kms_vblank',
> +	'meta_test',
> +	'perf',
> +	'pm_backlight',
> +	'pm_lpsp',
> +	'pm_rc6_residency',
> +	'pm_rpm',
> +	'pm_rps',
> +	'pm_sseu',
> +	'prime_busy',
> +	'prime_mmap',
> +	'prime_mmap_coherency',
> +	'prime_mmap_kms',
> +	'prime_self_import',
> +	'prime_udl',
> +	'prime_vgem',
> +	'sw_sync',
> +	'syncobj_basic',
> +	'template',
> +	'tools_test',
> +	'vgem_basic',
> +	'vgem_slow',
> +]
> +
> +test_deps = [ igt_deps ]
> +if libdrm_nouveau.found()
> +	test_progs += [
> +		'prime_nv_api',
> +		'prime_nv_pcopy',
> +		'prime_nv_test',
> +	]
> +	test_deps += libdrm_nouveau
> +endif
> +
> +if libdrm_vc4.found()
> +	test_progs += [
> +		'vc4_create_bo',
> +		'vc4_dmabuf_poll',
> +		'vc4_lookup_fail',
> +		'vc4_wait_bo',
> +		'vc4_wait_seqno',
> +	]
> +	test_deps += libdrm_vc4
> +endif
> +
> +if libdrm_amdgpu.found()
> +	# FIXME meson/ninja really doesn't like build targets with paths in them
> +	test_progs += [
> +		'amdgpu/amd_basic',
> +		'amdgpu/amd_cs_nop',
> +		'amdgpu/amd_prime',
> +	]
> +	test_deps += libdrm_amdgpu
> +endif
> +
> +if alsa.found()
> +	test_progs += [
> +		'audio',
> +	]
> +	test_deps += alsa
> +endif
> +
> +foreach prog : test_progs
> +	executable(prog, prog + '.c',
> +			dependencies : test_deps)
> +endforeach
> +
> +executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
> +		dependencies : test_deps)
> +test_progs += 'testdisplay'
> +
> +run_command('generate_testlist.sh', test_progs)
> +
> +test_script = find_program('igt_command_line.sh')
> +foreach prog : test_progs
> +	test('testcase check: ' + prog, test_script,
> +			args : prog)
> +endforeach
> +
> +executable('gem_stress', 'gem_stress.c', dependencies : igt_deps)
> +
> +# IMPORTANT: These tests here are all disabled because the result in sometime
> +# unrecoverable gpu hangs. Don't put real testcases here.
> +hang_progs = [
> +	'gem_bad_batch',
> +	'gem_hang',
> +	'gem_bad_blit',
> +	'gem_bad_address',
> +	'gem_non_secure_batch',
> +]
> +foreach prog : hang_progs
> +	executable(prog, prog + '.c',
> +			dependencies : igt_deps,
> +			install : false)
> +endforeach
> diff --git a/tools/meson.build b/tools/meson.build
> new file mode 100644
> index 000000000000..d2d4410e2130
> --- /dev/null
> +++ b/tools/meson.build
> @@ -0,0 +1,59 @@
> +tools_progs_noisnt = [
> +	'hsw_compute_wrpll',
> +	'skl_compute_wrpll',
> +	'skl_ddb_allocation',
> +]
> +
> +foreach prog : tools_progs_noisnt
> +	executable(prog, prog + '.c',
> +			dependencies : igt_deps,
> +			install : false)
> +endforeach
> +
> +tools_progs = [
> +	# FIXME we already have a libtestcase with this name as target
> +	#'igt_stats',
> +	'intel_audio_dump',
> +	'intel_backlight',
> +	'intel_bios_dumper',
> +	'intel_display_crc',
> +	'intel_display_poller',
> +	'intel_forcewaked',
> +	'intel_gpu_frequency',
> +	'intel_firmware_decode',
> +	'intel_gpu_time',
> +	'intel_gpu_top',
> +	'intel_gtt',
> +	'intel_guc_logger',
> +	'intel_infoframes',
> +	'intel_lid',
> +	'intel_opregion_decode',
> +	'intel_panel_fitter',
> +	'intel_reg_checker',
> +	'intel_residency',
> +	'intel_stepping',
> +	'intel_vbt_decode',
> +	'intel_watermark',
> +	'intel_gem_info',
> +	'intel_gvtg_test',
> +]
> +tool_deps = igt_deps
> +
> +if libdrm_intel.found()
> +	tools_progs += [
> +		'intel_dump_decode',
> +		'intel_error_decode',
> +		'intel_framebuffer_dump',
> +		'intel_perf_counters',
> +	]
> +	tool_deps += zlib
> +endif
> +
> +foreach prog : tools_progs
> +	executable(prog, prog + '.c',
> +			dependencies : tool_deps)
> +endforeach
> +
> +shared_library('intel_aubdump', 'aubdump.c', dependencies : [ igt_deps, dlsym ])
> +
> +subdir('null_state_gen')
> diff --git a/tools/null_state_gen/meson.build b/tools/null_state_gen/meson.build
> new file mode 100644
> index 000000000000..96697dbf64f1
> --- /dev/null
> +++ b/tools/null_state_gen/meson.build
> @@ -0,0 +1,15 @@
> +intel_null_state_gen_src = [
> +	'intel_batchbuffer.c',
> +	'intel_renderstate_gen6.c',
> +	'intel_renderstate_gen7.c',
> +	'intel_renderstate_gen8.c',
> +	'intel_renderstate_gen9.c',
> +	'intel_null_state_gen.c',
> +]
> +
> +intel_null_state_gen = executable('intel_null_state_gen',
> +		intel_null_state_gen_src, dependencies : igt_deps,
> +		install : false)
> +
> +# FIXME actual null_state generation. We probably want to push the the copyright
> +# header generation into intel_null_state_gen for simplicity

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 12/22] meson: basic build system support
  2017-09-06 14:01   ` Jani Nikula
@ 2017-09-08  6:50     ` Daniel Vetter
  2017-09-08  8:53       ` Jani Nikula
  0 siblings, 1 reply; 48+ messages in thread
From: Daniel Vetter @ 2017-09-08  6:50 UTC (permalink / raw)
  To: Jani Nikula; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

On Wed, Sep 06, 2017 at 05:01:42PM +0300, Jani Nikula wrote:
> On Tue, 05 Sep 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > Why?
> >
> > Because it's fast.
> 
> And that's not even the main reason from my perspective! ;)
> 
> Please find some comments inline. None of them are blockers.
> 
> BR,
> Jani.
> 
> >
> > Like really, really fast.
> >
> > Some data (from a snb laptop, so rather lower-powered):
> >
> > - Incremental build after $ touch lib/igt_core.c with meson: 0.6s
> >   It notices that the symbol list of the libigt.so hasn't changed and
> >   doesn't bother re-linking the almost 300 binaries we have. make -j 6
> >   for the same scenario takes 44s.
> >
> > - Incremental build with nothing changed: make: 0.7s, meson: 0.2s This
> >   means stuff like --disable-git-hash is entirely pointless with
> >   meson, it's faster than a make ever can be (with 0.6s).
> >
> > - Reconfigure stage: ninja reconfigure 0.8s vs. ./configure 8.6s)
> >
> > - Running tests, after a full build: ninja test 6s vs. make check 24s
> >
> > - Full build (i.e. including ./autogen.sh respectively meson build),
> >   including tests, from a pristine git checkout. automake 2m49s vs.
> >   meson 44s.
> >
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: Daniel Stone <daniel@fooishbar.org>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  .gitignore                       |   1 +
> >  assembler/meson.build            |  73 ++++++++++
> >  benchmarks/meson.build           |  36 +++++
> >  lib/meson.build                  | 166 ++++++++++++++++++++++
> >  lib/prepend_log_domain.sh        |   8 ++
> >  lib/tests/meson.build            |  34 +++++
> >  lib/version.h.in                 |   1 +
> >  meson.build                      | 105 ++++++++++++++
> >  overlay/meson.build              |  59 ++++++++
> >  tests/generate_testlist.sh       |  10 ++
> >  tests/meson.build                | 290 +++++++++++++++++++++++++++++++++++++++
> >  tools/meson.build                |  59 ++++++++
> >  tools/null_state_gen/meson.build |  15 ++
> >  13 files changed, 857 insertions(+)
> >  create mode 100644 assembler/meson.build
> >  create mode 100644 benchmarks/meson.build
> >  create mode 100644 lib/meson.build
> >  create mode 100755 lib/prepend_log_domain.sh
> >  create mode 100644 lib/tests/meson.build
> >  create mode 100644 lib/version.h.in
> >  create mode 100644 meson.build
> >  create mode 100644 overlay/meson.build
> >  create mode 100755 tests/generate_testlist.sh
> >  create mode 100644 tests/meson.build
> >  create mode 100644 tools/meson.build
> >  create mode 100644 tools/null_state_gen/meson.build
> >
> > diff --git a/.gitignore b/.gitignore
> > index 6204965a0e32..e6919272d8b6 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -93,3 +93,4 @@ intel-gpu-tools-*/
> >  
> >  piglit
> >  results
> > +build
> > diff --git a/assembler/meson.build b/assembler/meson.build
> > new file mode 100644
> > index 000000000000..bdddd0e2db25
> > --- /dev/null
> > +++ b/assembler/meson.build
> > @@ -0,0 +1,73 @@
> > +lib_brw_src = [
> > +	'brw_context.c',
> > +	'brw_disasm.c',
> > +	'brw_eu.c',
> > +	'brw_eu_compact.c',
> > +	'brw_eu_debug.c',
> > +	'brw_eu_emit.c',
> > +	'brw_eu_util.c',
> > +	'gen8_disasm.c',
> > +	'gen8_instruction.c',
> > +	'ralloc.c',
> > +]
> 
> FWIW I like this style of assigning lists.
> 
> > +
> > +lib_brw = shared_library('brw', lib_brw_src,
> > +		dependencies : igt_deps)
> 
> The Emacs meson mode nicely indents the continuation lines after the
> opening (. These seem off... all over the place.
> 
> > +
> > +flex = find_program('flex')
> > +bison = find_program('bison')
> > +
> > +lgen = generator(flex,
> > +		output : '@BASENAME@.c',
> > +		arguments : ['-o', '@OUTPUT@', '@INPUT@'])
> > +
> > +lfiles = lgen.process('lex.l')
> > +
> > +pgen = generator(bison,
> > +		output : ['@BASENAME@.c', '@BASENAME@.h'],
> > +		arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
> > +
> > +pfiles = pgen.process('gram.y')
> > +
> > +executable('intel-gen4asm', 'main.c', lfiles, pfiles, link_with : lib_brw)
> > +
> > +executable('intel-gen4disasm', 'disasm-main.c', link_with : lib_brw)
> > +
> > +gen4asm_testcases = [
> > +	'test/mov',
> > +	'test/frc',
> > +	'test/rndd',
> > +	'test/rndu',
> > +	'test/rnde',
> > +	'test/rnde-intsrc',
> > +	'test/rndz',
> > +	'test/lzd',
> > +	'test/not',
> > +	'test/immediate',
> > +]
> > +
> > +# Those tests were already failing when the assembler was imported from
> > +# the intel-gen4asm git repository:
> > +#   http://cgit.freedesktop.org/xorg/app/intel-gen4asm/
> > +# We disable them "for now" as a workaround to be able to release i-g-t
> > +gen4asm_testcases_broken = [
> > +	'test/declare',
> > +	'test/jmpi',
> > +	'test/if',
> > +	'test/iff',
> > +	'test/while',
> > +	'test/else',
> > +	'test/break',
> > +	'test/cont',
> > +	'test/halt',
> > +	'test/wait',
> > +	'test/endif',
> > +]
> > +
> > +test_runner = find_program('test/run-test.sh')
> > +foreach testcase : gen4asm_testcases
> > +	test('assembler: ' + testcase, test_runner,
> > +			args : testcase,
> > +			env : [ 'srcdir=' + meson.current_source_dir(),
> > +				'top_builddir=' + meson.current_build_dir()])
> > +endforeach
> > diff --git a/benchmarks/meson.build b/benchmarks/meson.build
> > new file mode 100644
> > index 000000000000..9ab738f76588
> > --- /dev/null
> > +++ b/benchmarks/meson.build
> > @@ -0,0 +1,36 @@
> > +benchmark_progs = [
> > +	'gem_blt',
> > +	'gem_busy',
> > +	'gem_create',
> > +	'gem_exec_ctx',
> > +	'gem_exec_fault',
> > +	'gem_exec_nop',
> > +	'gem_exec_reloc',
> > +	'gem_exec_trace',
> > +	'gem_latency',
> > +	'gem_mmap',
> > +	'gem_prw',
> > +	'gem_set_domain',
> > +	'gem_syslatency',
> > +	'gem_wsim',
> > +	'kms_vblank',
> > +	'prime_lookup',
> > +	'vgem_mmap',
> > +]
> > +
> > +if libdrm_intel.found()
> > +	benchmark_progs += [
> > +		'intel_upload_blit_large',
> > +		'intel_upload_blit_large_gtt',
> > +		'intel_upload_blit_large_map',
> > +		'intel_upload_blit_small',
> > +		'gem_userptr_benchmark',
> > +	]
> > +endif
> > +
> > +foreach prog : benchmark_progs
> > +	# FIXME meson doesn't like binaries with the same name
> > +	# meanwhile just suffix with _bench
> > +	executable(prog + '_bench', prog + '.c',
> > +			dependencies : test_deps)
> > +endforeach
> > diff --git a/lib/meson.build b/lib/meson.build
> > new file mode 100644
> > index 000000000000..51d3f9e278da
> > --- /dev/null
> > +++ b/lib/meson.build
> > @@ -0,0 +1,166 @@
> > +lib_headers = [
> > +	'debug.h',
> > +	'drmtest.h',
> > +	'i830_reg.h',
> > +	'i915_3d.h',
> > +	'i915_reg.h',
> > +	'i915_pciids.h',
> > +	'igt.h',
> > +	'igt_debugfs.h',
> > +	'igt_aux.h',
> > +	'igt_edid_template.h',
> > +	'igt_gt.h',
> > +	'igt_gvt.h',
> > +	'igt_primes.h',
> > +	'igt_rand.h',
> > +	'igt_stats.h',
> > +	'igt_sysfs.h',
> > +	'igt_x86.h',
> > +	'igt_vgem.h',
> > +	'instdone.h',
> > +	'intel_batchbuffer.h',
> > +	'intel_chipset.h',
> > +	'intel_io.h',
> > +	'intel_reg.h',
> > +	'ioctl_wrappers.h',
> > +	'media_fill.h',
> > +	'media_spin.h',
> > +	'gpgpu_fill.h',
> > +	'gen7_media.h',
> > +	'gen8_media.h',
> > +	'gen6_render.h',
> > +	'gen7_render.h',
> > +	'gen8_render.h',
> > +	'gen9_render.h',
> > +	'rendercopy.h',
> > +	'sw_sync.h',
> > +	'igt_kms.h',
> > +	'igt_fb.h',
> > +	'igt_core.h',
> > +	'igt_draw.h',
> > +	'igt_pm.h',
> > +	'igt_dummyload.h',
> > +	'uwildmat/uwildmat.h',
> > +	'igt_kmod.h',
> > +]
> > +
> > +lib_sources = [
> > +	'drmtest.c',
> > +	'igt_debugfs.c',
> > +	'igt_aux.c',
> > +	'igt_gt.c',
> > +	'igt_gvt.c',
> > +	'igt_primes.c',
> > +	'igt_rand.c',
> > +	'igt_stats.c',
> > +	'igt_sysfs.c',
> > +	'igt_x86.c',
> > +	'igt_vgem.c',
> > +	'instdone.c',
> > +	'intel_batchbuffer.c',
> > +	'intel_chipset.c',
> > +	'intel_device_info.c',
> > +	'intel_os.c',
> > +	'intel_mmio.c',
> > +	'ioctl_wrappers.c',
> > +	'media_fill_gen7.c',
> > +	'media_fill_gen8.c',
> > +	'media_fill_gen8lp.c',
> > +	'media_fill_gen9.c',
> > +	'media_spin.c',
> > +	'gpgpu_fill.c',
> > +	'rendercopy_i915.c',
> > +	'rendercopy_i830.c',
> > +	'rendercopy_gen6.c',
> > +	'rendercopy_gen7.c',
> > +	'rendercopy_gen8.c',
> > +	'rendercopy_gen9.c',
> > +	'sw_sync.c',
> > +	'intel_reg_map.c',
> > +	'intel_iosf.c',
> > +	'igt_kms.c',
> > +	'igt_fb.c',
> > +	'igt_core.c',
> > +	'igt_draw.c',
> > +	'igt_pm.c',
> > +	'igt_dummyload.c',
> > +	'uwildmat/uwildmat.c',
> > +	'igt_kmod.c',
> > +]
> > +
> > +lib_deps = [
> > +	cairo,
> > +	glib,
> > +	libdrm,
> > +	libkmod,
> > +	libprocps,
> > +	libudev,
> > +	libunwind,
> > +	pciaccess,
> > +	pthreads,
> > +	math,
> > +	realtime,
> > +]
> > +
> > +if libdrm_intel.found()
> > +	lib_deps += libdrm_intel
> > +else
> > +	lib_headers += 'stubs/drm/intel_bufmgr.h'
> > +	lib_sources += 'stubs/drm/intel_bufmgr.c'
> > +endif
> > +
> > +if libdrm_vc4.found()
> > +	lib_headers += 'igt_vc4.h'
> > +	lib_sources += 'igt_vc4.c'
> > +endif
> > +if valgrind.found()
> > +	lib_deps += valgrind
> > +endif
> > +
> > +if gsl.found()
> > +	lib_deps += gsl
> > +	lib_headers += [ 'igt_frame.h', 'igt_audio.h' ]
> > +	lib_sources += [ 'igt_frame.c', 'igt_audio.c' ]
> > +endif
> > +
> > +if alsa.found()
> > +	lib_deps += alsa
> > +	lib_headers += 'igt_alsa.h'
> > +	lib_sources += 'igt_alsa.c'
> > +endif
> > +
> > +if chamelium.found()
> > +	lib_deps += chamelium
> > +	lib_headers += 'igt_chamelium.h'
> > +	lib_sources += 'igt_chamelium.c'
> > +endif
> > +
> > +install_headers(lib_headers)
> > +
> > +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools')
> > +srcdir = join_paths(meson.source_root(), 'tests')
> > +
> > +vcs_tag(input : 'version.h.in', output : 'version.h',
> > +	fallback : 'NO-GIT',
> > +	command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] )
> > +
> > +# FIXME we don't regenerate when the script changes
> > +prepend_log_domain = generator(find_program('prepend_log_domain.sh'),
> > +		arguments : [ '@INPUT@', '@OUTPUT@' ],
> > +		output : '@PLAINNAME@' + '.pre.c')
> > +
> > +processed_src_dep = prepend_log_domain.process(lib_sources)
> > +
> > +lib_igt_build = shared_library('igt',
> > +			 processed_src_dep,
> > +			 include_directories : inc,
> > +			 dependencies : lib_deps,
> > +			 c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir),
> > +				'-DIGT_SRCDIR="@0@"'.format(srcdir), ])
> > +
> > +lib_igt = declare_dependency(link_with : lib_igt_build,
> > +			    include_directories : inc)
> > +
> > +igt_deps = [ lib_igt ] + lib_deps
> > +
> > +subdir('tests')
> > diff --git a/lib/prepend_log_domain.sh b/lib/prepend_log_domain.sh
> > new file mode 100755
> > index 000000000000..93a911508b7f
> > --- /dev/null
> > +++ b/lib/prepend_log_domain.sh
> > @@ -0,0 +1,8 @@
> > +#!/bin/bash
> > +
> > +input=$1
> > +output=$2
> > +basename=$(basename $1 .c)
> > +
> > +echo "#define IGT_LOG_DOMAIN \"$basename\"" > $output
> > +cat $input >> $output
> > diff --git a/lib/tests/meson.build b/lib/tests/meson.build
> > new file mode 100644
> > index 000000000000..29bdb2c4222c
> > --- /dev/null
> > +++ b/lib/tests/meson.build
> > @@ -0,0 +1,34 @@
> > +lib_tests = [
> > +	'igt_fork_helper',
> > +	'igt_list_only',
> > +	'igt_simulation',
> > +	'igt_stats',
> > +	'igt_segfault',
> > +	'igt_subtest_group',
> > +	'igt_assert',
> > +	'igt_exit_handler',
> > +	'igt_hdmi_inject',
> > +	'igt_can_fail',
> > +	'igt_can_fail_simple',
> > +]
> > +
> > +lib_fail_tests = [
> > +	'igt_no_exit',
> > +	'igt_no_exit_list_only',
> > +	'igt_no_subtest',
> > +	'igt_simple_test_subtests',
> > +	'igt_timeout',
> > +	'igt_invalid_subtest_name',
> > +]
> > +
> > +foreach lib_test : lib_tests
> > +	exec = executable(lib_test, lib_test + '.c', install : true,
> > +			dependencies : igt_deps)
> > +	test('lib: ' + lib_test, exec)
> > +endforeach
> > +
> > +foreach lib_test : lib_fail_tests
> > +	exec = executable(lib_test, lib_test + '.c', install : true,
> > +			dependencies : igt_deps)
> > +	test('lib: ' + lib_test, exec, should_fail : true)
> > +endforeach
> > diff --git a/lib/version.h.in b/lib/version.h.in
> > new file mode 100644
> > index 000000000000..72fc6978cf32
> > --- /dev/null
> > +++ b/lib/version.h.in
> > @@ -0,0 +1 @@
> > +#define IGT_GIT_SHA1 "@VCS_TAG@"
> > diff --git a/meson.build b/meson.build
> > new file mode 100644
> > index 000000000000..fee64fcdf36e
> > --- /dev/null
> > +++ b/meson.build
> > @@ -0,0 +1,105 @@
> > +project('IGT gpu tests', 'c',
> > +	version : '1.19',
> > +        default_options: [
> > +          'warning_level=2',
> > +          'c_std=gnu99',
> > +        ],
> > +	license : 'MIT')
> > +
> > +cc = meson.get_compiler('c')
> > +
> > +inc = include_directories('lib', '.')
> > +
> > +config_h = configuration_data()
> > +
> > +libdrm = dependency('libdrm', version : '>=2.4.82')
> > +libdrm_intel = dependency('libdrm_intel', required : false)
> > +libdrm_vc4 = dependency('libdrm_vc4', required : false)
> > +libdrm_nouveau = dependency('libdrm_nouveau', required : false)
> > +libdrm_amdgpu = dependency('libdrm_amdgpu', required : false)
> > +
> > +pciaccess = dependency('pciaccess', version : '>=0.10')
> > +libkmod = dependency('libkmod')
> > +libprocps = dependency('libprocps', required : false)
> > +if libprocps.found()
> > +	config_h.set('HAVE_PROCPS', 1)
> > +endif
> 
> I wish we used #if instead of #ifdef in code. With that you could use
> the one-liner:
> 
> config_h.set10('HAVE_PROCPS', libprocps.found())
> 
> and have
> 
> #define HAVE_PROCPS 0
> 
> in config.h, which is helpful for debugging issues.
> 
> > +
> > +valgrind = dependency('valgrind', required : false)
> > +if valgrind.found()
> > +	config_h.set('HAVE_VALGRIND', 1)
> > +endif
> > +
> > +cairo = dependency('cairo', version : '>1.12.0', required : false)
> > +
> > +libudev = dependency('libudev', required : false)
> > +if libudev.found()
> > +	config_h.set('HAVE_UDEV', 1)
> > +endif
> > +
> > +glib = dependency('glib-2.0', required : false)
> > +if glib.found()
> > +	config_h.set('HAVE_GLIB', 1)
> > +endif
> > +
> > +libunwind = dependency('libunwind')
> > +gsl = dependency('gsl', required : false)
> > +alsa = dependency('alsa', required : false)
> > +
> > +pixman = dependency('pixman-1', required : false)
> > +xmlrpc = dependency('xmlrpc', required : false)
> > +xmlrpc_util = dependency('xmlrpc_util', required : false)
> > +xmlrpc_client = dependency('xmlrpc_client', required : false)
> > +
> > +if pixman.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()
> > +	chamelium = declare_dependency(dependencies : [ pixman, xmlrpc,
> > +	  xmlrpc_util, xmlrpc_client])
> > +else
> > +	chamelium = dependency('', required: false)
> > +endif
> > +
> > +pthreads = dependency('threads')
> > +math = cc.find_library('m')
> > +realtime = cc.find_library('rt')
> > +dlsym = cc.find_library('dl')
> > +zlib = cc.find_library('z')
> > +
> > +if cc.has_header('linux/kd.h')
> > +	config_h.set('HAVE_LINUX_KD_H', 1)
> > +endif
> > +if cc.has_header('sys/kd.h')
> > +	config_h.set('HAVE_SYS_KD_H', 1)
> > +endif
> > +if cc.has_header('libgen.h')
> > +	config_h.set('HAVE_LIBGEN_H', 1)
> > +endif
> > +if cc.has_header('sys/io.h')
> > +	config_h.set('HAVE_SYS_IO_H', 1)
> > +endif
> > +if cc.has_header('cpuid.h')
> > +	# FIXME: Do we need the example link test from configure.ac?
> > +	config_h.set('HAVE_CPUID_H', 1)
> > +endif
> > +
> > +if cc.has_member('struct sysinfo', 'totalram',
> > +		prefix : '#include <sys/sysinfo.h>')
> > +	config_h.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1)
> > +endif
> > +
> > +add_project_arguments('-D_GNU_SOURCE', language : 'c')
> > +add_project_arguments('-include', 'config.h', language : 'c')
> 
> Ooo, that's a nice way to do this. TIL.
> 
> > +
> > +config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
> > +config_h.set_quoted('PACKAGE', meson.project_name())
> > +config_h.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family())
> > +
> > +configure_file(output: 'config.h', install: false, configuration: config_h)
> 
> This makes me think config_h is a misnomer for the configuration data
> object. I'd probably use plain "config" instead.
> 
> I think we'll end up wanting to use the configuration data for the test
> runner shell scripts too, and generate a sh.config from the same
> config. We can source the sh.config from e.g. run-tests.sh, to figure
> out the source and build directories. We can use find_program() to find
> piglit, for example, and shove that into sh.config.
> 
> Look at the beginning of run-tests.sh and see how much better it could
> be with a sh.config.
> 
> Of course, the alternative is to use a separate configuration data
> object for sh.config, but I think it's clearer to use one, and use .in
> files to decide what goes in them.

configuration_data() seems to just be a special-purpose
wrangler/generator. I use it also for mangling manpages later on iirc.

> 
> > +
> > +subdir('lib')
> > +subdir('tests')
> > +subdir('benchmarks')
> > +subdir('tools')
> > +if libdrm_intel.found()
> > +	subdir('assembler')
> > +	subdir('overlay')
> > +endif
> > diff --git a/overlay/meson.build b/overlay/meson.build
> > new file mode 100644
> > index 000000000000..a4b778ca5a86
> > --- /dev/null
> > +++ b/overlay/meson.build
> > @@ -0,0 +1,59 @@
> > +gpu_overlay_src = [
> > +	'chart.c',
> > +	'config.c',
> > +	'cpu-top.c',
> > +	'debugfs.c',
> > +	'gem-interrupts.c',
> > +	'gem-objects.c',
> > +	'gpu-top.c',
> > +	'gpu-perf.c',
> > +	'gpu-freq.c',
> > +	'igfx.c',
> > +	'overlay.c',
> > +	'perf.c',
> > +	'power.c',
> > +	'rc6.c',
> > +]
> > +
> > +xv = dependency('xv', required : false)
> > +x11 = dependency('x11', required : false)
> > +xext = dependency('xext', required : false)
> > +dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
> > +cairo_xlib = dependency('cairo-xlib', required : false)
> > +xrandr = dependency('xrandr', version : '>=1.3', required : false)
> > +
> > +gpu_overlay_deps = [ realtime, cairo, pciaccess, libdrm, libdrm_intel ]
> > +
> > +both_x11_src = ''
> > +
> > +gpu_overlay_cflags = []
> > +if xv.found() and x11.found() and xext.found() and dri2proto.found()
> > +	both_x11_src = 'x11/position.c'
> > +	gpu_overlay_src += [
> > +		'x11/dri2.c',
> > +		'x11/dri2.h',
> > +		'x11/rgb2yuv.c',
> > +		'x11/rgb2yuv.h',
> > +		'x11/x11-overlay.c',
> > +	]
> > +	gpu_overlay_deps += [ xv, x11, xext, dri2proto ]
> > +	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XVLIB' ]
> 
> Hmm, seems a bit odd to have the config data split between a
> configuration data object and flags like this.
> 
> > +endif
> > +
> > +if cairo_xlib.found() and xrandr.found() and dri2proto.found()
> > +	both_x11_src = 'x11/position.c'
> > +	gpu_overlay_src += 'x11/x11-window.c'
> > +	gpu_overlay_deps += [ cairo_xlib, dri2proto ]
> > +	gpu_overlay_cflags += [ '-DHAVE_OVERLAY_XLIB' ]
> 
> Ditto.

The overlay is a bit a strange subproject, and I guess I can't decided
whether I want config.h or -Ddefines on the gcc cmdline. I can respin,
assuming there's some real interest in meson (thus far you seem the first
besides me).
-Daniel


> 
> > +endif
> > +
> > +gpu_overlay_src += both_x11_src
> > +
> > +gpu_overlay_src += 'kms/kms-overlay.c'
> > +
> > +if xrandr.found() and cairo.found()
> > +	executable('intel_gpu_overlay', gpu_overlay_src,
> > +			include_directories : inc,
> > +			c_args : gpu_overlay_cflags,
> > +			dependencies : gpu_overlay_deps)
> > +endif
> > diff --git a/tests/generate_testlist.sh b/tests/generate_testlist.sh
> > new file mode 100755
> > index 000000000000..6ea78655daca
> > --- /dev/null
> > +++ b/tests/generate_testlist.sh
> > @@ -0,0 +1,10 @@
> > +#!/bin/bash
> > +
> > +echo TESTLIST > $MESON_BUILD_ROOT/tests/test-list.txt
> > +
> > +while [[ $# -gt 0 ]] ; do
> > +	echo $1 >> $MESON_BUILD_ROOT/tests/test-list.txt
> > +	shift
> > +done
> > +
> > +echo END TESTLIST >> $MESON_BUILD_ROOT/tests/test-list.txt
> > diff --git a/tests/meson.build b/tests/meson.build
> > new file mode 100644
> > index 000000000000..73833758be0e
> > --- /dev/null
> > +++ b/tests/meson.build
> > @@ -0,0 +1,290 @@
> > +test_progs = [
> > +	'core_auth',
> > +	'core_get_client_auth',
> > +	'core_getclient',
> > +	'core_getstats',
> > +	'core_getversion',
> > +	'core_prop_blob',
> > +	'core_setmaster_vs_auth',
> > +	'debugfs_test',
> > +	'drm_import_export',
> > +	'drm_mm',
> > +	'drm_read',
> > +	'drm_vma_limiter',
> > +	'drm_vma_limiter_cached',
> > +	'drm_vma_limiter_cpu',
> > +	'drm_vma_limiter_gtt',
> > +	'drv_getparams_basic',
> > +	'drv_hangman',
> > +	'drv_missed_irq',
> > +	'drv_module_reload',
> > +	'drv_selftest',
> > +	'drv_suspend',
> > +	'gem_bad_length',
> > +	'gem_bad_reloc',
> > +	'gem_basic',
> > +	'gem_busy',
> > +	'gem_caching',
> > +	'gem_close',
> > +	'gem_close_race',
> > +	'gem_concurrent_blit',
> > +	'gem_cpu_reloc',
> > +	'gem_create',
> > +	'gem_cs_prefetch',
> > +	'gem_cs_tlb',
> > +	'gem_ctx_bad_destroy',
> > +	'gem_ctx_bad_exec',
> > +	'gem_ctx_basic',
> > +	'gem_ctx_create',
> > +	'gem_ctx_exec',
> > +	'gem_ctx_param',
> > +	'gem_ctx_switch',
> > +	'gem_ctx_thrash',
> > +	'gem_double_irq_loop',
> > +	'gem_eio',
> > +	'gem_evict_alignment',
> > +	'gem_evict_everything',
> > +	'gem_exec_alignment',
> > +	'gem_exec_async',
> > +	'gem_exec_await',
> > +	'gem_exec_bad_domains',
> > +	'gem_exec_basic',
> > +	'gem_exec_big',
> > +	'gem_exec_blt',
> > +	'gem_exec_capture',
> > +	'gem_exec_create',
> > +	'gem_exec_faulting_reloc',
> > +	'gem_exec_fence',
> > +	'gem_exec_flush',
> > +	'gem_exec_gttfill',
> > +	'gem_exec_latency',
> > +	'gem_exec_lut_handle',
> > +	'gem_exec_nop',
> > +	'gem_exec_parallel',
> > +	'gem_exec_params',
> > +	'gem_exec_parse',
> > +	'gem_exec_reloc',
> > +	'gem_exec_reuse',
> > +	'gem_exec_schedule',
> > +	'gem_exec_store',
> > +	'gem_exec_suspend',
> > +	'gem_exec_whisper',
> > +	'gem_fd_exhaustion',
> > +	'gem_fence_thrash',
> > +	'gem_fence_upload',
> > +	'gem_fenced_exec_thrash',
> > +	'gem_flink_basic',
> > +	'gem_flink_race',
> > +	'gem_gpgpu_fill',
> > +	'gem_gtt_cpu_tlb',
> > +	'gem_gtt_hog',
> > +	'gem_gtt_speed',
> > +	'gem_hangcheck_forcewake',
> > +	'gem_largeobject',
> > +	'gem_linear_blits',
> > +	'gem_lut_handle',
> > +	'gem_madvise',
> > +	'gem_media_fill',
> > +	'gem_mmap',
> > +	'gem_mmap_gtt',
> > +	'gem_mmap_offset_exhaustion',
> > +	'gem_mmap_wc',
> > +	'gem_mocs_settings',
> > +	'gem_partial_pwrite_pread',
> > +	'gem_persistent_relocs',
> > +	'gem_pin',
> > +	'gem_pipe_control_store_loop',
> > +	'gem_ppgtt',
> > +	'gem_pread',
> > +	'gem_pread_after_blit',
> > +	'gem_pwrite',
> > +	'gem_pwrite_pread',
> > +	'gem_pwrite_snooped',
> > +	'gem_read_read_speed',
> > +	'gem_readwrite',
> > +	'gem_reg_read',
> > +	'gem_reloc_overflow',
> > +	'gem_reloc_vs_gpu',
> > +	'gem_render_copy',
> > +	'gem_render_copy_redux',
> > +	'gem_render_linear_blits',
> > +	'gem_render_tiled_blits',
> > +	'gem_request_retire',
> > +	'gem_reset_stats',
> > +	'gem_ring_sync_copy',
> > +	'gem_ring_sync_loop',
> > +	'gem_ringfill',
> > +	'gem_seqno_wrap',
> > +	'gem_set_tiling_vs_blt',
> > +	'gem_set_tiling_vs_gtt',
> > +	'gem_set_tiling_vs_pwrite',
> > +	'gem_shrink',
> > +	'gem_softpin',
> > +	'gem_spin_batch',
> > +	'gem_stolen',
> > +	'gem_storedw_batches_loop',
> > +	'gem_storedw_loop',
> > +	'gem_streaming_writes',
> > +	'gem_sync',
> > +	'gem_threaded_access_tiled',
> > +	'gem_tiled_blits',
> > +	'gem_tiled_fence_blits',
> > +	'gem_tiled_partial_pwrite_pread',
> > +	'gem_tiled_pread_basic',
> > +	'gem_tiled_pread_pwrite',
> > +	'gem_tiled_swapping',
> > +	'gem_tiled_wb',
> > +	'gem_tiled_wc',
> > +	'gem_tiling_max_stride',
> > +	'gem_unfence_active_buffers',
> > +	'gem_unref_active_buffers',
> > +	'gem_userptr_blits',
> > +	'gem_wait',
> > +	'gem_workarounds',
> > +	'gem_write_read_ring_switch',
> > +	'gen3_mixed_blits',
> > +	'gen3_render_linear_blits',
> > +	'gen3_render_mixed_blits',
> > +	'gen3_render_tiledx_blits',
> > +	'gen3_render_tiledy_blits',
> > +	'gen7_forcewake_mt',
> > +	'gvt_basic',
> > +	'kms_3d',
> > +	'kms_addfb_basic',
> > +	'kms_atomic',
> > +	'kms_atomic_transition',
> > +	'kms_busy',
> > +	'kms_ccs',
> > +	'kms_chv_cursor_fail',
> > +	'kms_concurrent',
> > +	'kms_crtc_background_color',
> > +	'kms_cursor_crc',
> > +	'kms_cursor_legacy',
> > +	'kms_draw_crc',
> > +	'kms_fbc_crc',
> > +	'kms_fbcon_fbt',
> > +	'kms_fence_pin_leak',
> > +	'kms_flip',
> > +	'kms_flip_event_leak',
> > +	'kms_flip_tiling',
> > +	'kms_force_connector_basic',
> > +	'kms_frontbuffer_tracking',
> > +	'kms_hdmi_inject',
> > +	'kms_invalid_dotclock',
> > +	'kms_legacy_colorkey',
> > +	'kms_mmap_write_crc',
> > +	'kms_mmio_vs_cs_flip',
> > +	'kms_panel_fitting',
> > +	'kms_pipe_b_c_ivb',
> > +	'kms_pipe_color',
> > +	'kms_pipe_crc_basic',
> > +	'kms_plane',
> > +	'kms_plane_lowres',
> > +	'kms_plane_multiple',
> > +	'kms_plane_scaling',
> > +	'kms_properties',
> > +	'kms_psr_sink_crc',
> > +	'kms_pwrite_crc',
> > +	'kms_render',
> > +	'kms_rmfb',
> > +	'kms_rotation_crc',
> > +	'kms_setmode',
> > +	'kms_sink_crc_basic',
> > +	'kms_sysfs_edid_timing',
> > +	'kms_tv_load_detect',
> > +	'kms_universal_plane',
> > +	'kms_vblank',
> > +	'meta_test',
> > +	'perf',
> > +	'pm_backlight',
> > +	'pm_lpsp',
> > +	'pm_rc6_residency',
> > +	'pm_rpm',
> > +	'pm_rps',
> > +	'pm_sseu',
> > +	'prime_busy',
> > +	'prime_mmap',
> > +	'prime_mmap_coherency',
> > +	'prime_mmap_kms',
> > +	'prime_self_import',
> > +	'prime_udl',
> > +	'prime_vgem',
> > +	'sw_sync',
> > +	'syncobj_basic',
> > +	'template',
> > +	'tools_test',
> > +	'vgem_basic',
> > +	'vgem_slow',
> > +]
> > +
> > +test_deps = [ igt_deps ]
> > +if libdrm_nouveau.found()
> > +	test_progs += [
> > +		'prime_nv_api',
> > +		'prime_nv_pcopy',
> > +		'prime_nv_test',
> > +	]
> > +	test_deps += libdrm_nouveau
> > +endif
> > +
> > +if libdrm_vc4.found()
> > +	test_progs += [
> > +		'vc4_create_bo',
> > +		'vc4_dmabuf_poll',
> > +		'vc4_lookup_fail',
> > +		'vc4_wait_bo',
> > +		'vc4_wait_seqno',
> > +	]
> > +	test_deps += libdrm_vc4
> > +endif
> > +
> > +if libdrm_amdgpu.found()
> > +	# FIXME meson/ninja really doesn't like build targets with paths in them
> > +	test_progs += [
> > +		'amdgpu/amd_basic',
> > +		'amdgpu/amd_cs_nop',
> > +		'amdgpu/amd_prime',
> > +	]
> > +	test_deps += libdrm_amdgpu
> > +endif
> > +
> > +if alsa.found()
> > +	test_progs += [
> > +		'audio',
> > +	]
> > +	test_deps += alsa
> > +endif
> > +
> > +foreach prog : test_progs
> > +	executable(prog, prog + '.c',
> > +			dependencies : test_deps)
> > +endforeach
> > +
> > +executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
> > +		dependencies : test_deps)
> > +test_progs += 'testdisplay'
> > +
> > +run_command('generate_testlist.sh', test_progs)
> > +
> > +test_script = find_program('igt_command_line.sh')
> > +foreach prog : test_progs
> > +	test('testcase check: ' + prog, test_script,
> > +			args : prog)
> > +endforeach
> > +
> > +executable('gem_stress', 'gem_stress.c', dependencies : igt_deps)
> > +
> > +# IMPORTANT: These tests here are all disabled because the result in sometime
> > +# unrecoverable gpu hangs. Don't put real testcases here.
> > +hang_progs = [
> > +	'gem_bad_batch',
> > +	'gem_hang',
> > +	'gem_bad_blit',
> > +	'gem_bad_address',
> > +	'gem_non_secure_batch',
> > +]
> > +foreach prog : hang_progs
> > +	executable(prog, prog + '.c',
> > +			dependencies : igt_deps,
> > +			install : false)
> > +endforeach
> > diff --git a/tools/meson.build b/tools/meson.build
> > new file mode 100644
> > index 000000000000..d2d4410e2130
> > --- /dev/null
> > +++ b/tools/meson.build
> > @@ -0,0 +1,59 @@
> > +tools_progs_noisnt = [
> > +	'hsw_compute_wrpll',
> > +	'skl_compute_wrpll',
> > +	'skl_ddb_allocation',
> > +]
> > +
> > +foreach prog : tools_progs_noisnt
> > +	executable(prog, prog + '.c',
> > +			dependencies : igt_deps,
> > +			install : false)
> > +endforeach
> > +
> > +tools_progs = [
> > +	# FIXME we already have a libtestcase with this name as target
> > +	#'igt_stats',
> > +	'intel_audio_dump',
> > +	'intel_backlight',
> > +	'intel_bios_dumper',
> > +	'intel_display_crc',
> > +	'intel_display_poller',
> > +	'intel_forcewaked',
> > +	'intel_gpu_frequency',
> > +	'intel_firmware_decode',
> > +	'intel_gpu_time',
> > +	'intel_gpu_top',
> > +	'intel_gtt',
> > +	'intel_guc_logger',
> > +	'intel_infoframes',
> > +	'intel_lid',
> > +	'intel_opregion_decode',
> > +	'intel_panel_fitter',
> > +	'intel_reg_checker',
> > +	'intel_residency',
> > +	'intel_stepping',
> > +	'intel_vbt_decode',
> > +	'intel_watermark',
> > +	'intel_gem_info',
> > +	'intel_gvtg_test',
> > +]
> > +tool_deps = igt_deps
> > +
> > +if libdrm_intel.found()
> > +	tools_progs += [
> > +		'intel_dump_decode',
> > +		'intel_error_decode',
> > +		'intel_framebuffer_dump',
> > +		'intel_perf_counters',
> > +	]
> > +	tool_deps += zlib
> > +endif
> > +
> > +foreach prog : tools_progs
> > +	executable(prog, prog + '.c',
> > +			dependencies : tool_deps)
> > +endforeach
> > +
> > +shared_library('intel_aubdump', 'aubdump.c', dependencies : [ igt_deps, dlsym ])
> > +
> > +subdir('null_state_gen')
> > diff --git a/tools/null_state_gen/meson.build b/tools/null_state_gen/meson.build
> > new file mode 100644
> > index 000000000000..96697dbf64f1
> > --- /dev/null
> > +++ b/tools/null_state_gen/meson.build
> > @@ -0,0 +1,15 @@
> > +intel_null_state_gen_src = [
> > +	'intel_batchbuffer.c',
> > +	'intel_renderstate_gen6.c',
> > +	'intel_renderstate_gen7.c',
> > +	'intel_renderstate_gen8.c',
> > +	'intel_renderstate_gen9.c',
> > +	'intel_null_state_gen.c',
> > +]
> > +
> > +intel_null_state_gen = executable('intel_null_state_gen',
> > +		intel_null_state_gen_src, dependencies : igt_deps,
> > +		install : false)
> > +
> > +# FIXME actual null_state generation. We probably want to push the the copyright
> > +# header generation into intel_null_state_gen for simplicity
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 07/22] lib: clean up header includes
  2017-09-06 11:44   ` Chris Wilson
@ 2017-09-08  6:55     ` Daniel Vetter
  0 siblings, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-08  6:55 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development

On Wed, Sep 06, 2017 at 12:44:20PM +0100, Chris Wilson wrote:
> Quoting Daniel Vetter (2017-09-05 13:36:09)
> > diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> > index f2a94b5572ea..a2061ff6138e 100644
> > --- a/lib/igt_dummyload.c
> > +++ b/lib/igt_dummyload.c
> > @@ -22,11 +22,18 @@
> >   *
> >   */
> >  
> > -#include "igt.h"
> > -#include "igt_dummyload.h"
> >  #include <time.h>
> >  #include <signal.h>
> >  #include <sys/syscall.h>
> > +#include <sys/mman.h>
> 
> For PROT_*? It's using the gem_mmap/gem_munmap interfaces, should we not
> then be defining PROT_* as part of that interface.
> 
> We don't need the raw syscall interface here.
> 
> > +
> > +#include <i915_drm.h>
> > +
> > +#include "igt_dummyload.h"
> > +#include "igt_gt.h"
> > +#include "intel_batchbuffer.h"
> 
> What are we pulling in from batchbuffer.h? I think you mean intel_reg.h.
> Both are inappropriate places for MI commands.
> 
> igt_core.h for igt_require
> 
> -#include "igt.h"
> -#include "igt_dummyload.h"
>  #include <time.h>
>  #include <signal.h>
> -#include <sys/syscall.h>
> +
> +#include <i915_drm.h>
> +
> +#include "igt_core.h"
> +#include "igt_dummyload.h"
> +#include "igt_gt.h"
> +#include "intel_chipset.h"
> +#include "intel_reg.h"
> +#include "ioctl_wrappers.h"
> 
> plus the indirect sys/mman.h via ioctl_wrappers.h

That indirect include doesn't exist, it's only in drmtest.h. But I agree
it should be there, so I'll add it and use your version.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 12/22] meson: basic build system support
  2017-09-08  6:50     ` Daniel Vetter
@ 2017-09-08  8:53       ` Jani Nikula
  0 siblings, 0 replies; 48+ messages in thread
From: Jani Nikula @ 2017-09-08  8:53 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Intel Graphics Development, Daniel Vetter

On Fri, 08 Sep 2017, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Sep 06, 2017 at 05:01:42PM +0300, Jani Nikula wrote:
>> On Tue, 05 Sep 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>> > +configure_file(output: 'config.h', install: false, configuration: config_h)
>> 
>> This makes me think config_h is a misnomer for the configuration data
>> object. I'd probably use plain "config" instead.
>> 
>> I think we'll end up wanting to use the configuration data for the test
>> runner shell scripts too, and generate a sh.config from the same
>> config. We can source the sh.config from e.g. run-tests.sh, to figure
>> out the source and build directories. We can use find_program() to find
>> piglit, for example, and shove that into sh.config.
>> 
>> Look at the beginning of run-tests.sh and see how much better it could
>> be with a sh.config.
>> 
>> Of course, the alternative is to use a separate configuration data
>> object for sh.config, but I think it's clearer to use one, and use .in
>> files to decide what goes in them.
>
> configuration_data() seems to just be a special-purpose
> wrangler/generator. I use it also for mangling manpages later on iirc.

We had a misunderstanding here, clarified on IRC.

I meant, do use configuration data, but only use one configuration data
object, and generate several outputs from one object. I think we'll
benefit from being able to pull in some config data to a sh.config later
on, and using that in run-tests.sh and elsewhere. Which means "config_h"
will be a slightly misleading name, just call it "config".

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 00/22] RFC: meson build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (26 preceding siblings ...)
  2017-09-06  9:44 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-09-08  9:07 ` Jani Nikula
  2017-09-08  9:30 ` Arkadiusz Hiler
                   ` (5 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Jani Nikula @ 2017-09-08  9:07 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Tue, 05 Sep 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Assuming we can get some consensus around this I'd like to merge it and
> polish the meson support in-tree, it's kinda growing into a bigger series
> already. And of course we need to keep autohell working for probably a
> fairly long time, at least for the tools that distro install.

FWIW, I'm on the meson bandwagon, and uncharacteristically so.

I glanced through everything here, with a bit more focus on patch 12. I
don't have it in me to do a detailed review of everything right now, but
let's make that

Acked-by: Jani Nikula <jani.nikula@intel.com>

on merging the series.

That said, I don't think my ack alone is enough for merging.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* [PATCH i-g-t] lib: clean up header includes
  2017-09-05 12:36 ` [PATCH i-g-t 07/22] lib: clean up header includes Daniel Vetter
  2017-09-06 11:44   ` Chris Wilson
@ 2017-09-08  9:23   ` Daniel Vetter
  1 sibling, 0 replies; 48+ messages in thread
From: Daniel Vetter @ 2017-09-08  9:23 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

Just a bit of OCD, I like it when connections within library modules
are a bit more obvious. igt.h is ok for tests, but let's use individual
include lines for libraries consistently.

Also order standard includes before igt ones.

v2: Rebase.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 lib/igt_alsa.c      |  3 ++-
 lib/igt_alsa.h      |  1 -
 lib/igt_audio.c     |  3 ++-
 lib/igt_audio.h     |  1 -
 lib/igt_chamelium.c |  6 +++++-
 lib/igt_chamelium.h |  6 +++++-
 lib/igt_frame.c     |  3 ++-
 lib/igt_frame.h     |  1 -
 lib/igt_gvt.c       | 10 +++++-----
 lib/igt_kmod.c      |  6 +++---
 lib/igt_sysfs.h     |  1 +
 lib/igt_vgem.c      | 10 +++++++---
 lib/igt_vgem.h      |  1 +
 13 files changed, 33 insertions(+), 19 deletions(-)

diff --git a/lib/igt_alsa.c b/lib/igt_alsa.c
index b5574c7622a1..3ad0521aa6ee 100644
--- a/lib/igt_alsa.c
+++ b/lib/igt_alsa.c
@@ -28,7 +28,8 @@
 
 #include <alsa/asoundlib.h>
 
-#include "igt.h"
+#include "igt_alsa.h"
+#include "igt_core.h"
 
 #define HANDLES_MAX	8
 
diff --git a/lib/igt_alsa.h b/lib/igt_alsa.h
index 8f7724ad9727..50795130a4f8 100644
--- a/lib/igt_alsa.h
+++ b/lib/igt_alsa.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 struct alsa;
diff --git a/lib/igt_audio.c b/lib/igt_audio.c
index 6b35529aa224..2321d1c6e3f1 100644
--- a/lib/igt_audio.c
+++ b/lib/igt_audio.c
@@ -29,7 +29,8 @@
 #include <math.h>
 #include <gsl/gsl_fft_real.h>
 
-#include "igt.h"
+#include "igt_audio.h"
+#include "igt_core.h"
 
 #define FREQS_MAX	8
 
diff --git a/lib/igt_audio.h b/lib/igt_audio.h
index 21adfee82756..b3b658a4017f 100644
--- a/lib/igt_audio.h
+++ b/lib/igt_audio.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 struct audio_signal;
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index dcd8855f3d1b..fb250366ca2c 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -35,7 +35,11 @@
 #include <pixman.h>
 #include <cairo.h>
 
-#include "igt.h"
+#include "igt_chamelium.h"
+#include "igt_core.h"
+#include "igt_aux.h"
+#include "igt_kms.h"
+#include "igt_frame.h"
 
 /**
  * SECTION:igt_chamelium
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index a2d626eca957..af9655a0b1cf 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -28,8 +28,12 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
+#include <xf86drmMode.h>
+
+#include "igt_debugfs.h"
+
+struct igt_fb;
 
 struct chamelium;
 struct chamelium_port;
diff --git a/lib/igt_frame.c b/lib/igt_frame.c
index 0f6bca243e39..6984c02e9912 100644
--- a/lib/igt_frame.c
+++ b/lib/igt_frame.c
@@ -32,7 +32,8 @@
 #include <gsl/gsl_statistics_double.h>
 #include <gsl/gsl_fit.h>
 
-#include "igt.h"
+#include "igt_frame.h"
+#include "igt_core.h"
 
 /**
  * SECTION:igt_frame
diff --git a/lib/igt_frame.h b/lib/igt_frame.h
index 680ad5bbd293..11f96cbea203 100644
--- a/lib/igt_frame.h
+++ b/lib/igt_frame.h
@@ -29,7 +29,6 @@
 
 #include "config.h"
 
-#include "igt.h"
 #include <stdbool.h>
 
 bool igt_frame_dump_is_enabled(void);
diff --git a/lib/igt_gvt.c b/lib/igt_gvt.c
index a78e98e9f233..acbc349145ce 100644
--- a/lib/igt_gvt.c
+++ b/lib/igt_gvt.c
@@ -21,16 +21,16 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
-#include "igt_gvt.h"
-#include "igt_sysfs.h"
-#include "igt_kmod.h"
-
 #include <signal.h>
 #include <dirent.h>
 #include <unistd.h>
 #include <fcntl.h>
 
+#include "igt_gvt.h"
+#include "igt_sysfs.h"
+#include "igt_kmod.h"
+#include "drmtest.h"
+
 /**
  * SECTION:igt_gvt
  * @short_description: Graphics virtualization technology library
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 26691e308cbd..58624cd12f32 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -21,13 +21,13 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
+#include <signal.h>
+#include <errno.h>
+
 #include "igt_core.h"
 #include "igt_sysfs.h"
 #include "igt_kmod.h"
 
-#include <signal.h>
-
 /**
  * SECTION:igt_kmod
  * @short_description: Wrappers around libkmod for module loading/unloading
diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h
index 3ee89b0fc28f..74e61060d224 100644
--- a/lib/igt_sysfs.h
+++ b/lib/igt_sysfs.h
@@ -26,6 +26,7 @@
 #define __IGT_SYSFS_H__
 
 #include <stdbool.h>
+#include <stdarg.h>
 
 char *igt_sysfs_path(int device, char *path, int pathlen, int *idx);
 int igt_sysfs_open(int device, int *idx);
diff --git a/lib/igt_vgem.c b/lib/igt_vgem.c
index 3dd9621d0459..7f933b23bd4f 100644
--- a/lib/igt_vgem.c
+++ b/lib/igt_vgem.c
@@ -21,10 +21,14 @@
  * IN THE SOFTWARE.
  */
 
-#include "igt.h"
-#include "igt_vgem.h"
-
 #include <sys/mman.h>
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+#include <errno.h>
+
+#include "igt_vgem.h"
+#include "igt_core.h"
+#include "ioctl_wrappers.h"
 
 /**
  * SECTION:igt_vgem
diff --git a/lib/igt_vgem.h b/lib/igt_vgem.h
index 002ad7f09ceb..92045f0e7a81 100644
--- a/lib/igt_vgem.h
+++ b/lib/igt_vgem.h
@@ -25,6 +25,7 @@
 #define IGT_VGEM_H
 
 #include <stdint.h>
+#include <stdbool.h>
 
 struct vgem_bo {
 	uint32_t handle;
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 00/22] RFC: meson build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (27 preceding siblings ...)
  2017-09-08  9:07 ` [PATCH i-g-t 00/22] RFC: meson build system support Jani Nikula
@ 2017-09-08  9:30 ` Arkadiusz Hiler
  2017-09-08  9:36 ` Petri Latvala
                   ` (4 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Arkadiusz Hiler @ 2017-09-08  9:30 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Tue, Sep 05, 2017 at 02:36:02PM +0200, Daniel Vetter wrote:
> Assuming we can get some consensus around this I'd like to merge it and
> polish the meson support in-tree, it's kinda growing into a bigger series
> already. And of course we need to keep autohell working for probably a
> fairly long time, at least for the tools that distro install.
> 
> Comments and testing very much welcom.

Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 00/22] RFC: meson build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (28 preceding siblings ...)
  2017-09-08  9:30 ` Arkadiusz Hiler
@ 2017-09-08  9:36 ` Petri Latvala
  2017-09-08 10:49 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev7) Patchwork
                   ` (3 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Petri Latvala @ 2017-09-08  9:36 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Tue, Sep 05, 2017 at 02:36:02PM +0200, Daniel Vetter wrote:
> Hi all,
> 
> Ok, this time around a proper patch series with cover letter and a pile of
> fixes (bunch of them thanks to Eric) thrown on top.
> 
> The motivation for this has 2 primary reasons:
> 
> - I want a build system that's fast, especially for hacking on the
>   library. Currently with over 300 binaries the relinking step every time
>   you change the library is extremely painful.
> 
> - I want a build system that I can hack on. After years of automake, I
>   still don't get it. After a few days of meson I have at least the
>   illusion I understand stuff. And that's with an obviously still fairly
>   fresh tool with the occasional sharp corner (lesson learned: if it
>   complains about the meson files, it's a missing comman nearby).
> 
> - Finally there's the question of whether this will die like previous
>   attempts at a better build toolchain, or whether the meson/ninja combo
>   will win. There's a lot of very enthusastic initial conversion in
>   various X.org projects, and the people I've chatted are extremely
>   positive on this. I think meson/ninja could very well be the git of the
>   build: Painful to use in the first years, but has the fundamental rights
>   and will win in the end.
> 
> Assuming we can get some consensus around this I'd like to merge it and
> polish the meson support in-tree, it's kinda growing into a bigger series
> already. And of course we need to keep autohell working for probably a
> fairly long time, at least for the tools that distro install.
> 
> Comments and testing very much welcom.
> 


Series is

Acked-by: Petri Latvala <petri.latvala@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* ✓ Fi.CI.BAT: success for RFC: meson build system support (rev7)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (29 preceding siblings ...)
  2017-09-08  9:36 ` Petri Latvala
@ 2017-09-08 10:49 ` Patchwork
  2017-09-08 10:58 ` [PATCH i-g-t 00/22] RFC: meson build system support Daniel Stone
                   ` (2 subsequent siblings)
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-08 10:49 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev7)
URL   : https://patchwork.freedesktop.org/series/29823/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
d5de89eb17938484718be1144f5957f05ab44dc2 lib/dummyload: Use -1 for all engines

with latest DRM-Tip kernel build CI_DRM_3061
16fef66706a3 drm-tip: 2017y-09m-08d-08h-41m-49s UTC integration manifest

Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-legacy:
                pass       -> FAIL       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:461s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:443s
fi-blb-e6850     total:289  pass:224  dwarn:1   dfail:0   fail:0   skip:64  time:361s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:574s
fi-bwr-2160      total:289  pass:184  dwarn:0   dfail:0   fail:0   skip:105 time:254s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:525s
fi-byt-j1900     total:289  pass:254  dwarn:1   dfail:0   fail:0   skip:34  time:530s
fi-byt-n2820     total:289  pass:250  dwarn:1   dfail:0   fail:0   skip:38  time:520s
fi-cfl-s         total:289  pass:250  dwarn:4   dfail:0   fail:0   skip:35  time:472s
fi-elk-e7500     total:289  pass:230  dwarn:0   dfail:0   fail:0   skip:59  time:445s
fi-glk-2a        total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:612s
fi-hsw-4770      total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:451s
fi-hsw-4770r     total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:427s
fi-ilk-650       total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:431s
fi-ivb-3520m     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:512s
fi-ivb-3770      total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:479s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:514s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:600s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:609s
fi-pnv-d510      total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:531s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:469s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:543s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:519s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:444s
fi-skl-x1585l    total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:502s
fi-snb-2520m     total:289  pass:251  dwarn:0   dfail:0   fail:0   skip:38  time:562s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:1   skip:39  time:408s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_165/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 00/22] RFC: meson build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (30 preceding siblings ...)
  2017-09-08 10:49 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev7) Patchwork
@ 2017-09-08 10:58 ` Daniel Stone
  2017-09-08 11:01 ` Szwichtenberg, Radoslaw
  2017-09-08 13:14 ` ✓ Fi.CI.IGT: success for RFC: meson build system support (rev7) Patchwork
  33 siblings, 0 replies; 48+ messages in thread
From: Daniel Stone @ 2017-09-08 10:58 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On 5 September 2017 at 13:36, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Ok, this time around a proper patch series with cover letter and a pile of
> fixes (bunch of them thanks to Eric) thrown on top.
>
> The motivation for this has 2 primary reasons:
>
> - I want a build system that's fast, especially for hacking on the
>   library. Currently with over 300 binaries the relinking step every time
>   you change the library is extremely painful.
>
> - I want a build system that I can hack on. After years of automake, I
>   still don't get it. After a few days of meson I have at least the
>   illusion I understand stuff. And that's with an obviously still fairly
>   fresh tool with the occasional sharp corner (lesson learned: if it
>   complains about the meson files, it's a missing comman nearby).
>
> - Finally there's the question of whether this will die like previous
>   attempts at a better build toolchain, or whether the meson/ninja combo
>   will win. There's a lot of very enthusastic initial conversion in
>   various X.org projects, and the people I've chatted are extremely
>   positive on this. I think meson/ninja could very well be the git of the
>   build: Painful to use in the first years, but has the fundamental rights
>   and will win in the end.
>
> Assuming we can get some consensus around this I'd like to merge it and
> polish the meson support in-tree, it's kinda growing into a bigger series
> already. And of course we need to keep autohell working for probably a
> fairly long time, at least for the tools that distro install.

Yes please. I've taken a couple of passes looking at it, and it seems
fine to me.

Acked-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* Re: [PATCH i-g-t 00/22] RFC: meson build system support
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (31 preceding siblings ...)
  2017-09-08 10:58 ` [PATCH i-g-t 00/22] RFC: meson build system support Daniel Stone
@ 2017-09-08 11:01 ` Szwichtenberg, Radoslaw
  2017-09-08 13:14 ` ✓ Fi.CI.IGT: success for RFC: meson build system support (rev7) Patchwork
  33 siblings, 0 replies; 48+ messages in thread
From: Szwichtenberg, Radoslaw @ 2017-09-08 11:01 UTC (permalink / raw)
  To: intel-gfx, daniel.vetter

On Tue, 2017-09-05 at 14:36 +0200, Daniel Vetter wrote:
> Assuming we can get some consensus around this I'd like to merge it and
> polish the meson support in-tree, it's kinda growing into a bigger series
> already. And of course we need to keep autohell working for probably a
> fairly long time, at least for the tools that distro install.

As discussed on IRC, we may have to re-visit Android support in the future
(maybe even near future), but for now it is not really a concern.

Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

* ✓ Fi.CI.IGT: success for RFC: meson build system support (rev7)
  2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
                   ` (32 preceding siblings ...)
  2017-09-08 11:01 ` Szwichtenberg, Radoslaw
@ 2017-09-08 13:14 ` Patchwork
  33 siblings, 0 replies; 48+ messages in thread
From: Patchwork @ 2017-09-08 13:14 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

== Series Details ==

Series: RFC: meson build system support (rev7)
URL   : https://patchwork.freedesktop.org/series/29823/
State : success

== Summary ==

Test kms_flip:
        Subgroup wf_vblank-ts-check-interruptible:
                fail       -> PASS       (shard-hsw) fdo#100368
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw        total:2302 pass:1238 dwarn:0   dfail:0   fail:12  skip:1052 time:9513s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_165/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2017-09-08 13:14 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 12:36 [PATCH i-g-t 00/22] RFC: meson build system support Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 01/22] build: Define _GNU_SOURCE in Makefile.am Daniel Vetter
2017-09-05 16:19   ` [PATCH i-g-t] " Daniel Vetter
2017-09-05 21:08     ` Chris Wilson
2017-09-06  9:02       ` Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 02/22] build: Nuke #ifdef HAVE_CONFIG_H cargo-cult Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 03/22] build: use HAVE_LIBGEN_H consistently Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 04/22] build: remove _GNU_SOURCE from source files Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 05/22] tests/gem_spin_batch: Fix warning Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 06/22] lib: prefix frame_dump_path Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 07/22] lib: clean up header includes Daniel Vetter
2017-09-06 11:44   ` Chris Wilson
2017-09-08  6:55     ` Daniel Vetter
2017-09-08  9:23   ` [PATCH i-g-t] " Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 08/22] tests/igt_command_line.sh: Allow testing individual tests Daniel Vetter
2017-09-05 16:43   ` [PATCH i-g-t] " Daniel Vetter
2017-09-06  8:02     ` Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 09/22] lib/uwildmat: Use include paths Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 10/22] demos: remove Daniel Vetter
2017-09-05 16:20   ` [PATCH i-g-t] " Daniel Vetter
2017-09-05 16:45     ` Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 11/22] assembler/test: Prep work for meson Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 12/22] meson: basic build system support Daniel Vetter
2017-09-06 14:01   ` Jani Nikula
2017-09-08  6:50     ` Daniel Vetter
2017-09-08  8:53       ` Jani Nikula
2017-09-05 12:36 ` [PATCH i-g-t 13/22] lib/ioctl_wrappers: make the valgrind wrapper always emit a statement:w Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 14/22] tests/kms_plane: Appease gcc -Wempty-body Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 15/22] meson: Add some compiler flags to reduce warnings Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 16/22] meson: Don't build the igt audio test without gsl available Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 17/22] meson: Use static libs to handle IGT_LOG_DOMAIN Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 18/22] meson: detect cc flags Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 19/22] meson: add manpage support Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 20/22] meson: igt_frame also needs pixman Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 21/22] meson: Minimal README update Daniel Vetter
2017-09-05 12:36 ` [PATCH i-g-t 22/22] meson: Bump required version to 0.40 Daniel Vetter
2017-09-05 16:21 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev3) Patchwork
2017-09-06  7:52 ` ✗ Fi.CI.BAT: failure for RFC: meson build system support (rev5) Patchwork
2017-09-06  7:53 ` Patchwork
2017-09-06  8:19 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev6) Patchwork
2017-09-06  9:44 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-08  9:07 ` [PATCH i-g-t 00/22] RFC: meson build system support Jani Nikula
2017-09-08  9:30 ` Arkadiusz Hiler
2017-09-08  9:36 ` Petri Latvala
2017-09-08 10:49 ` ✓ Fi.CI.BAT: success for RFC: meson build system support (rev7) Patchwork
2017-09-08 10:58 ` [PATCH i-g-t 00/22] RFC: meson build system support Daniel Stone
2017-09-08 11:01 ` Szwichtenberg, Radoslaw
2017-09-08 13:14 ` ✓ Fi.CI.IGT: success for RFC: meson build system support (rev7) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.