1. 15 Feb, 2019 2 commits
  2. 21 Jan, 2019 1 commit
    • Petri Latvala's avatar
      lib: Introduce BUILD_BUG_ON_INVALID and igt_assume() · 5b4485f5
      Petri Latvala authored
      BUILD_BUG_ON_INVALID() is a macro that, like the kernel counterpart,
      expands to an expression that generates no code. Useful for making
      sure an expression is valid code while producing no side effects.
      igt_assume() is an assert-like macro that is used to give hints to
      static analysis of code. If static analysis is not used (as detected
      by STATIC_ANALYSIS_BUILD), igt_assume() expands to a
      BUILD_BUG_ON_INVALID, otherwise expands to an assert().
      v2: Make sure the expression in igt_assume is still parsed without
          static analysis. (Chris)
      v3: Also introduce BUILD_BUG_ON_INVALID as standalone
      Signed-off-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
  3. 01 Nov, 2018 1 commit
    • Petri Latvala's avatar
      lib: Help static analyzers figure out the execution flow · ace031dc
      Petri Latvala authored
      When running any kind of static analysis on IGT, one tends to drown in
      warnings about using uninitialized variables in subtests, because
      static analysis is unable to figure out that igt_fixture blocks are
      always entered if a subtest block is entered. Aid the discovery of
      correct execution flow by making static analysis always enter all
      igt_fixture blocks and all subtest blocks.
      Automatic discovery of static analyzers is done for Clang, Coverity
      and Klocwork, using macros found by quick googling. For explicit
      control on possible other analyzers, defining STATIC_ANALYSIS_BUILD=1
      manually will activate this hack.
       - Hack not needed for igt_subtest()
       - Make sure igt_fixture is entered once instead of an infinite loop
       - Rebase properly...
      Signed-off-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
      Reviewed-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
  4. 09 Aug, 2018 1 commit
  5. 13 Jul, 2018 1 commit
  6. 08 Jun, 2018 1 commit
  7. 27 Apr, 2018 1 commit
  8. 26 Mar, 2018 1 commit
    • Tvrtko Ursulin's avatar
      lib/dummyload: Add pollable spin batch · 9d9978af
      Tvrtko Ursulin authored
      Pollable spin batch exports a spin->running pointer which can be checked
      by dereferencing it to see if the spinner is actually executing on the
      This is useful for tests which want to make sure they do not proceed with
      their next step whilst the spinner is potentially only being processed by
      the driver and not actually executing.
      Pollable spinner can be created with igt_spin_batch_new_poll or
      __igt_spin_batch_new_poll, after which igt_spin_busywait_until_running can
      be used to busy wait until it is executing.
       * Move READ_ONCE to igt_core.
       * Add igt_spin_busywait_until_running. (Chris Wilson)
      Signed-off-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
  9. 05 Mar, 2018 1 commit
    • Chris Wilson's avatar
      tests/perf_pmu: Handle CPU hotplug failures better · ec872b7d
      Chris Wilson authored
      CPU hotplug, especially CPU0, can be flaky on commodity hardware.
      To improve test reliability and reponse times when testing larger runs we
      need to handle those cases better.
      Handle failures to off-line a CPU by immediately skipping the test, and
      failures to on-line a CPU by immediately rebooting the machine.
      This patch includes igt_sysrq_reboot implementation from Chris Wilson.
      v2: Halt by default, reboot if env variable IGT_REBOOT_ON_FATAL_ERROR is
          set. (Petri Latvala)
      v3: Add missign docs and update stale comment. (Petri Latvala)
      v4: Use pause instead of sleep. (Chris Wilson)
      v5: Newlines! (Chris Wilson)
      Signed-off-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Petri Latvala <petri.latvala@intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Reviewed-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
  10. 27 Feb, 2018 1 commit
  11. 03 Oct, 2017 1 commit
  12. 08 Sep, 2017 1 commit
  13. 05 Sep, 2017 1 commit
  14. 14 Aug, 2017 1 commit
  15. 19 Jul, 2017 1 commit
  16. 06 Jul, 2017 1 commit
  17. 14 Jun, 2017 2 commits
  18. 25 Apr, 2017 1 commit
    • Tvrtko Ursulin's avatar
      benchmarks/gem_wsim: Command submission workload simulator · 054eb1ab
      Tvrtko Ursulin authored
      Tool which emits batch buffers to engines with configurable
      sequences, durations, contexts, dependencies and userspace waits.
      Unfinished but shows promise so sending out for early feedback.
       * Load workload descriptors from files. (also -w)
       * Help text.
       * Calibration control if needed. (-t)
       * NORELOC | LUT to eb flags.
       * Added sample workload to wsim/workload1.
       * Multiple parallel different workloads (-w -w ...).
       * Multi-context workloads.
       * Variable (random) batch length.
       * Load balancing (round robin and queue depth estimation).
       * Workloads delays and explicit sync steps.
       * Workload frequency (period) control.
       * Fixed queue-depth estimation by creating separate batches
         per engine when qd load balancing is on.
       * Dropped separate -s cmd line option. It can turn itself on
         automatically when needed.
       * Keep a single status page and lie about the write hazard
         as suggested by Chris.
       * Use batch_start_offset for controlling the batch duration.
       * Set status page object cache level. (Chris)
       * Moved workload description to a README.
       * Tidied example workloads.
       * Some other cleanups and refactorings.
       * Master and background workloads (-W / -w).
       * Single batch per step is enough even when balancing. (Chris)
       * Use hars_petruska_f54_1_random IGT functions and see to zero
         at start. (Chris)
       * Use WC cache domain when WC mapping. (Chris)
       * Keep seqnos 64-bytes apart in the status page. (Chris)
       * Add workload throttling and queue-depth throttling commands.
       * Added two more workloads.
       * Merged RT balancer from Chris.
       * Merged NO_RELOC patch from Chris.
       * Added missing RT balancer to help text.
      TODO list:
       * Fence support.
       * Batch buffer caching (re-use pool).
       * Better error handling.
       * Less 1980's workload parsing.
       * More workloads.
       * Threads?
       * ... ?
      Signed-off-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
  19. 07 Feb, 2017 1 commit
  20. 03 Jan, 2017 1 commit
    • Lyude Paul's avatar
      igt_core: add igt_constructor · 31811f4b
      Lyude Paul authored
      This is a simple macro for executing a block of code at the beginning of
      intel-gpu-tools, before any tests have been ran. Useful for
      initialization of global resources used in IGT libraries.
      Signed-off-by: Lyude Paul's avatarLyude <lyude@redhat.com>
      Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
      Changes since v1:
       - Add the line number into the name of the constructor function so that
         multiple constructors may be used per-file.
  21. 15 Nov, 2016 1 commit
  22. 07 Nov, 2016 1 commit
  23. 13 Oct, 2016 1 commit
  24. 27 Jul, 2016 1 commit
  25. 23 Jun, 2016 1 commit
  26. 27 May, 2016 1 commit
  27. 20 Apr, 2016 1 commit
    • Tomeu Vizoso's avatar
      lib: Declare loop variable as volatile before setjmp · 3450cba3
      Tomeu Vizoso authored
      The variable used as loop counter in the igt_fixture macro had
      unspecified value from the setjmp(3) man page quoted below. Because of
      that, in certain circumstances and with -O2 and -Os, the initialization
      of that variable would be eliminated and the compiler would complain of
      uninitialized usage. Below can be found a snippet that reproduces the
      problem with GCC 5.3.1 and 4.9.3 and the errors as printed by 5.3.1.
      "The compiler may optimize variables into registers, and longjmp() may
      restore the values of other registers in addition to the stack pointer
      and program  counter. Consequently, the values of automatic variables
      are unspecified after a call to longjmp() if they meet all the following
      ·  they are local to the function that made the corresponding setjmp(3)
      ·  their values are changed between the calls to setjmp(3) and
      longjmp(); and
      ·  they are not declared as volatile."
      static void test(void)
      	igt_subtest_group {
      		igt_fixture {
      		igt_subtest("foo") {
      		igt_fixture {
      In file included from lib/intel_batchbuffer.h:8:0,
                       from lib/drmtest.h:39,
                       from lib/igt.h:27,
                       from tests/kms_addfb_basic.c:28:
      tests/kms_addfb_basic.c: In function 'tiling_tests.isra.0':
      lib/igt_core.h:110:43: warning: '__tmpint245' is used uninitialized in
      this function [-Wuninitialized]
       #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
      lib/igt_core.h:110:43: note: '__tmpint245' was declared here
       #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
      lib/igt_core.h:148:31: note: in definition of macro '__igt_tokencat2'
       #define __igt_tokencat2(x, y) x ## y
      lib/igt_core.h:110:30: note: in expansion of macro 'igt_tokencat'
       #define igt_fixture for (int igt_tokencat(__tmpint,__LINE__) = 0; \
      tests/kms_addfb_basic.c:245:3: note: in expansion of macro 'igt_fixture'
         igt_fixture {
      Signed-off-by: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
      Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
  28. 19 Mar, 2016 1 commit
    • Daniel Vetter's avatar
      lib: Add igt_subtest_group · 72d04b84
      Daniel Vetter authored
      Useful for creating common setup code in igt_fixture which is only
      needed by a subset of tests. And since I'm a good citizen it comes
      with a library testcase/example included.
      v2: Make testcase nastier to ensure a subtest group SKIPS when it's
      parent is skipping already. I accidentally got this right, but let's
      make sure.
      Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@ffwll.ch>
  29. 18 Mar, 2016 1 commit
  30. 08 Mar, 2016 1 commit
  31. 26 Feb, 2016 1 commit
  32. 21 Dec, 2015 1 commit
  33. 11 Nov, 2015 1 commit
  34. 07 Oct, 2015 3 commits
  35. 14 Aug, 2015 1 commit
    • Paulo Zanoni's avatar
      lib/igt_core: use print("%s", #expr) instead of print(#expr) · a1fce749
      Paulo Zanoni authored
      If I have a program with the following:
          igt_skip_on(i % 2 == 0);
          igt_skip_on_f(i % 2 == 0, "i:%d\n", i);
          igt_require(i % 2 == 0);
          igt_require_f(i % 2 == 0, "i:%d\n", i);
      then I'll get compiler error messages complaining about format
      conversions related to the '%' character used in the mod operation. So
      put the whole string as a %s argument to avoid interpreting '%' and
      any other possible chars.
      Signed-off-by: Paulo Zanoni's avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
  36. 12 Aug, 2015 1 commit