[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

intel-gpu-tools: Changes to 'debian-unstable'



 .editorconfig                                           |   14 
 .gitignore                                              |    1 
 CONTRIBUTING                                            |   13 
 Makefile.am                                             |    7 
 NEWS                                                    |   43 
 README                                                  |   33 
 assembler/Makefile.am                                   |    1 
 assembler/meson.build                                   |   86 
 assembler/test/run-test.sh                              |   16 
 autogen.sh                                              |    3 
 benchmarks/Makefile.am                                  |   11 
 benchmarks/ezbench.d/Makefile.am                        |   16 
 benchmarks/gem_busy.c                                   |   27 
 benchmarks/gem_exec_fault.c                             |   20 
 benchmarks/gem_exec_tracer.c                            |   12 
 benchmarks/gem_latency.c                                |    1 
 benchmarks/gem_syslatency.c                             |   89 
 benchmarks/meson.build                                  |   36 
 benchmarks/prime_lookup.c                               |    2 
 benchmarks/wsim/Makefile.am                             |   31 
 configure.ac                                            |   73 
 debian/changelog                                        |    7 
 demos/.gitignore                                        |    1 
 demos/Android.mk                                        |   32 
 demos/Makefile.am                                       |   12 
 demos/Makefile.sources                                  |    7 
 demos/intel_sprite_on.c                                 |  960 ----
 docs/Makefile.am                                        |    5 
 docs/audio.txt                                          |   45 
 docs/chamelium.txt                                      |  159 
 docs/reference/intel-gpu-tools/Makefile.am              |   24 
 docs/reference/intel-gpu-tools/igt_test_programs.xml    |  123 
 docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml |   28 
 lib/Makefile.am                                         |   27 
 lib/Makefile.sources                                    |    1 
 lib/drmtest.c                                           |   27 
 lib/i915_pciids.h                                       |   42 
 lib/igt.h                                               |    3 
 lib/igt_alsa.c                                          |  638 ++
 lib/igt_alsa.h                                          |   57 
 lib/igt_audio.c                                         |  327 +
 lib/igt_audio.h                                         |   44 
 lib/igt_aux.c                                           |   98 
 lib/igt_aux.h                                           |    1 
 lib/igt_chamelium.c                                     |  527 +-
 lib/igt_chamelium.h                                     |   31 
 lib/igt_core.c                                          |  328 +
 lib/igt_core.h                                          |   19 
 lib/igt_debugfs.c                                       |  150 
 lib/igt_debugfs.h                                       |    3 
 lib/igt_draw.c                                          |  205 
 lib/igt_dummyload.c                                     |   50 
 lib/igt_dummyload.h                                     |   10 
 lib/igt_fb.c                                            |   99 
 lib/igt_fb.h                                            |    6 
 lib/igt_frame.c                                         |  269 +
 lib/igt_frame.h                                         |   42 
 lib/igt_gt.c                                            |   32 
 lib/igt_gvt.c                                           |   17 
 lib/igt_kmod.c                                          |   54 
 lib/igt_kms.c                                           |  173 
 lib/igt_kms.h                                           |   60 
 lib/igt_primes.c                                        |    7 
 lib/igt_rand.c                                          |    7 
 lib/igt_rand.h                                          |    6 
 lib/igt_rc.h                                            |   34 
 lib/igt_sysfs.c                                         |  125 
 lib/igt_sysfs.h                                         |    8 
 lib/igt_vgem.c                                          |   10 
 lib/igt_vgem.h                                          |    1 
 lib/igt_x86.c                                           |    9 
 lib/igt_x86.h                                           |   12 
 lib/instdone.c                                          |   10 
 lib/intel_batchbuffer.c                                 |    4 
 lib/intel_chipset.h                                     |    5 
 lib/intel_device_info.c                                 |   16 
 lib/intel_os.c                                          |    2 
 lib/ioctl_wrappers.c                                    |  139 
 lib/ioctl_wrappers.h                                    |    6 
 lib/media_fill.c                                        |   16 
 lib/meson.build                                         |  185 
 lib/sw_sync.c                                           |   11 
 lib/tests/.gitignore                                    |    2 
 lib/tests/Makefile.am                                   |    5 
 lib/tests/Makefile.sources                              |    2 
 lib/tests/igt_can_fail.c                                |   44 
 lib/tests/igt_can_fail_simple.c                         |   32 
 lib/tests/igt_exit_handler.c                            |    1 
 lib/tests/meson.build                                   |   34 
 lib/uwildmat/uwildmat.c                                 |    2 
 lib/version.h.in                                        |    1 
 man/Makefile.am                                         |    8 
 man/defs.rst.in                                         |    5 
 man/meson.build                                         |   39 
 man/rst2man.sh                                          |   16 
 meson.build                                             |  128 
 meson.sh                                                |   35 
 overlay/Makefile.am                                     |    5 
 overlay/meson.build                                     |   60 
 overlay/overlay.h                                       |    2 
 overlay/x11/position.c                                  |    2 
 scripts/run-tests.sh                                    |    2 
 tests/Makefile.am                                       |   35 
 tests/Makefile.sources                                  |   21 
 tests/ZZ_check_dmesg                                    |   11 
 tests/amdgpu/amd_basic.c                                |    2 
 tests/audio.c                                           |  193 
 tests/chamelium.c                                       |  441 +-
 tests/check_drm_clients                                 |    6 
 tests/core_auth.c                                       |    9 
 tests/core_get_client_auth.c                            |    1 
 tests/core_setmaster_vs_auth.c                          |    1 
 tests/debugfs_emon_crash                                |   16 
 tests/debugfs_test.c                                    |  118 
 tests/debugfs_wedged                                    |   10 
 tests/drm_getopt.sh                                     |   38 
 tests/drm_import_export.c                               |    1 
 tests/drm_lib.sh                                        |  112 
 tests/drv_debugfs_reader                                |    9 
 tests/drv_missed_irq.c                                  |    1 
 tests/drv_module_reload.c                               |   11 
 tests/gem_busy.c                                        |    4 
 tests/gem_close.c                                       |   97 
 tests/gem_cpu_reloc.c                                   |    4 
 tests/gem_create.c                                      |    5 
 tests/gem_ctx_switch.c                                  |    2 
 tests/gem_eio.c                                         |  278 +
 tests/gem_evict_alignment.c                             |   37 
 tests/gem_evict_everything.c                            |   35 
 tests/gem_exec_await.c                                  |   17 
 tests/gem_exec_capture.c                                |   65 
 tests/gem_exec_fence.c                                  | 1036 ++++
 tests/gem_exec_nop.c                                    |  118 
 tests/gem_exec_params.c                                 |  113 
 tests/gem_exec_reloc.c                                  |    6 
 tests/gem_exec_reuse.c                                  |    3 
 tests/gem_exec_schedule.c                               |  824 +++
 tests/gem_exec_suspend.c                                |   19 
 tests/gem_exec_whisper.c                                |   56 
 tests/gem_fd_exhaustion.c                               |    3 
 tests/gem_fence_thrash.c                                |    2 
 tests/gem_fence_upload.c                                |    2 
 tests/gem_fenced_exec_thrash.c                          |    2 
 tests/gem_flink_basic.c                                 |   18 
 tests/gem_flink_race.c                                  |   36 
 tests/gem_mmap_gtt.c                                    |    1 
 tests/gem_mmap_wc.c                                     |    1 
 tests/gem_mocs_settings.c                               |  355 -
 tests/gem_persistent_relocs.c                           |    1 
 tests/gem_reloc_overflow.c                              |   16 
 tests/gem_reloc_vs_gpu.c                                |    1 
 tests/gem_render_linear_blits.c                         |    2 
 tests/gem_reset_stats.c                                 |   45 
 tests/gem_ringfill.c                                    |   10 
 tests/gem_shrink.c                                      |    4 
 tests/gem_spin_batch.c                                  |    8 
 tests/gem_streaming_writes.c                            |    1 
 tests/gem_sync.c                                        |  166 
 tests/gem_userptr_blits.c                               |    7 
 tests/gem_wait.c                                        |    2 
 tests/gem_workarounds.c                                 |   39 
 tests/generate_testlist.sh                              |   18 
 tests/igt_command_line.sh                               |   44 
 tests/intel-ci/Makefile.am                              |    5 
 tests/intel-ci/README                                   |   15 
 tests/intel-ci/extended.testlist                        | 1839 --------
 tests/intel-ci/fast-feedback-simulation.testlist        |   91 
 tests/intel-ci/fast-feedback.testlist                   |   19 
 tests/intel-ci/generic.testlist                         |  125 
 tests/intel-ci/meta.testlist                            |    1 
 tests/kms_atomic.c                                      |   20 
 tests/kms_atomic_interruptible.c                        |  333 +
 tests/kms_atomic_transition.c                           |  223 -
 tests/kms_busy.c                                        |  179 
 tests/kms_ccs.c                                         |  415 +
 tests/kms_color.c                                       | 1223 +++++
 tests/kms_concurrent.c                                  |    9 
 tests/kms_cursor_crc.c                                  |   39 
 tests/kms_cursor_legacy.c                               |  157 
 tests/kms_draw_crc.c                                    |   57 
 tests/kms_fbc_crc.c                                     |   85 
 tests/kms_flip.c                                        |   49 
 tests/kms_frontbuffer_tracking.c                        |  243 -
 tests/kms_hdmi_inject.c                                 |    2 
 tests/kms_mmap_write_crc.c                              |    2 
 tests/kms_panel_fitting.c                               |   16 
 tests/kms_pipe_color.c                                  | 1194 -----
 tests/kms_pipe_crc_basic.c                              |    6 
 tests/kms_plane.c                                       |   14 
 tests/kms_plane_lowres.c                                |    4 
 tests/kms_plane_multiple.c                              |   28 
 tests/kms_plane_scaling.c                               |   14 
 tests/kms_properties.c                                  |   53 
 tests/kms_psr_sink_crc.c                                |   27 
 tests/kms_render.c                                      |    2 
 tests/kms_rmfb.c                                        |   13 
 tests/kms_rotation_crc.c                                |  235 -
 tests/kms_setmode.c                                     |    2 
 tests/kms_universal_plane.c                             |    4 
 tests/meson.build                                       |  319 +
 tests/meta_test.c                                       |    6 
 tests/perf.c                                            | 3457 +++++++++++++---
 tests/pm_rc6_residency.c                                |    1 
 tests/pm_rpm.c                                          |  105 
 tests/pm_rps.c                                          |  170 
 tests/prime_busy.c                                      |   81 
 tests/prime_mmap.c                                      |    1 
 tests/prime_self_import.c                               |    1 
 tests/prime_vgem.c                                      |   41 
 tests/sw_sync.c                                         |    4 
 tests/syncobj_basic.c                                   |  260 +
 tests/sysfs_l3_parity                                   |   22 
 tests/test_rte_check                                    |    6 
 tests/testdisplay.c                                     |    2 
 tests/testdisplay_hotplug.c                             |    2 
 tests/tools_test                                        |   16 
 tests/tools_test.c                                      |  128 
 tests/vgem_basic.c                                      |   35 
 tools/Makefile.am                                       |   11 
 tools/Makefile.sources                                  |    1 
 tools/aubdump.c                                         |   99 
 tools/intel_audio_dump.c                                |    1 
 tools/intel_bios.h                                      |  760 ---
 tools/intel_display_poller.c                            |    2 
 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                                   |    4 
 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/intel_lid.c                                       |    5 
 tools/intel_opregion_decode.c                           |    2 
 tools/intel_reg.c                                       |    2 
 tools/intel_vbt_decode.c                                |  180 
 tools/intel_vbt_defs.h                                  |  897 ++++
 tools/intel_watermark.c                                 |    2 
 tools/meson.build                                       |   99 
 tools/null_state_gen/Makefile.am                        |    4 
 tools/null_state_gen/meson.build                        |   15 
 242 files changed, 16048 insertions(+), 8306 deletions(-)

New commits:
commit 21a0e540ea55e635d09f0ac6727d38292b034bb0
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Sat Oct 7 01:28:56 2017 +0300

    release to unstable

diff --git a/debian/changelog b/debian/changelog
index 43dfb11..928b7aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,9 @@
-intel-gpu-tools (1.20-1) UNRELEASED; urgency=medium
+intel-gpu-tools (1.20-1) unstable; urgency=medium
 
   * New upstream release.
     - support for CFL, CNL added
 
- -- Timo Aaltonen <tjaalton@debian.org>  Sat, 07 Oct 2017 01:25:47 +0300
+ -- Timo Aaltonen <tjaalton@debian.org>  Sat, 07 Oct 2017 01:28:43 +0300
 
 intel-gpu-tools (1.19-2) unstable; urgency=medium
 

commit bfeb8593c01bf45cc89013e158b9ce9a0ca06596
Author: Timo Aaltonen <tjaalton@debian.org>
Date:   Sat Oct 7 01:27:08 2017 +0300

    update changelog

diff --git a/debian/changelog b/debian/changelog
index 6530769..43dfb11 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+intel-gpu-tools (1.20-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+    - support for CFL, CNL added
+
+ -- Timo Aaltonen <tjaalton@debian.org>  Sat, 07 Oct 2017 01:25:47 +0300
+
 intel-gpu-tools (1.19-2) unstable; urgency=medium
 
   * control: Add flex to build-depends. (Closes: #867344)

commit 7f93a2632aae7c5865823b4a2fa4cd8c2a1c0977
Author: Petri Latvala <petri.latvala@intel.com>
Date:   Wed Oct 4 13:48:15 2017 +0300

    Update NEWS, bump version to 1.20.
    
    Signed-off-by: Petri Latvala <petri.latvala@intel.com>
    Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

diff --git a/NEWS b/NEWS
index 80136fa..b6d0958 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,46 @@
+Release 1.20 (2017-10-03)
+-------------------------
+
+Library changes:
+
+- Added helpers for launching external processes and capturing their
+  outputs. (Abdiel Janulgue)
+
+- Increased max pipe count to 6 to support AMD GPUs. (Leo (Sunpeng) Li)
+
+- Various improvements for Chamelium support. (Paul Kocialkowski)
+
+- Added Coffeelake platform support. (Rodrigo Vivi, Anusha Srivatsa)
+
+- Added Cannonlake platform support. (Rodrigo Vivi)
+
+- Added support for audio testing. (Paul Kocialkowski)
+
+- Added preliminary meson build system support. (Daniel Vetter, et al)
+  -- Autotools remains the supported build system for now.
+
+Tools changes:
+
+- Refactored video bios data to use definitions copied from the
+  kernel. (Jani Nikula)
+
+Documentation changes:
+
+- Added user and developer documentation about Chamelium support to
+  aid deploying the platform. (Paul Kocialkowski)
+
+- Added documentation about the required hardware setup for audio
+  testing. (Paul Kocialkowski)
+
+Tests changes:
+
+- Converted remaining shell-script tests to C code (Abdiel Janulgue)
+
+- Multiple new tests.
+
+
+And many other bug fixes and improvements.
+
 Release 1.19 (2017-06-09)
 -------------------------
 
diff --git a/configure.ac b/configure.ac
index 01bb2f4..53ef704 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ([2.60])
 AC_INIT([intel-gpu-tools],
-	[1.19],
+	[1.20],
 	[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT],
 	[intel-gpu-tools])
 
diff --git a/meson.build b/meson.build
index 7a09228..310174a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('IGT gpu tests', 'c',
-	version : '1.19',
+	version : '1.20',
         default_options: [
           'warning_level=2',
           'c_std=gnu99',

commit 332108184493d0b58963ffe13f9b568a6fa462df
Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date:   Wed Oct 4 12:11:40 2017 +0100

    tests/perf: split array of formats descriptions
    
    The I915_OA_FORMAT_C4_B8 format has different offset on Haswell &
    Gen8. Let's split the format lists so we don't mix them.
    
    Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>

diff --git a/tests/perf.c b/tests/perf.c
index 2adce76..ad62319 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -188,7 +188,7 @@ struct accumulator {
 	uint64_t deltas[MAX_RAW_OA_COUNTERS];
 };
 
-static struct {
+struct oa_format {
 	const char *name;
 	size_t size;
 	int a40_high_off; /* bytes */
@@ -201,69 +201,59 @@ static struct {
 	int n_b;
 	int c_off;
 	int n_c;
-	int min_gen;
-	int max_gen;
-} oa_formats[local_I915_OA_FORMAT_MAX] = {
+};
+
+static struct oa_format hsw_oa_formats[local_I915_OA_FORMAT_MAX] = {
 	[I915_OA_FORMAT_A13] = { /* HSW only */
 		"A13", .size = 64,
-		.a_off = 12, .n_a = 13,
-		.max_gen = 7 },
+		.a_off = 12, .n_a = 13, },
 	[I915_OA_FORMAT_A29] = { /* HSW only */
 		"A29", .size = 128,
-		.a_off = 12, .n_a = 29,
-		.max_gen = 7 },
+		.a_off = 12, .n_a = 29, },
 	[I915_OA_FORMAT_A13_B8_C8] = { /* HSW only */
 		"A13_B8_C8", .size = 128,
 		.a_off = 12, .n_a = 13,
 		.b_off = 64, .n_b = 8,
-		.c_off = 96, .n_c = 8,
-		.max_gen = 7 },
+		.c_off = 96, .n_c = 8, },
 	[I915_OA_FORMAT_A45_B8_C8] = { /* HSW only */
 		"A45_B8_C8", .size = 256,
 		.a_off = 12,  .n_a = 45,
 		.b_off = 192, .n_b = 8,
-		.c_off = 224, .n_c = 8,
-		.max_gen = 7 },
+		.c_off = 224, .n_c = 8, },
 	[I915_OA_FORMAT_B4_C8] = { /* HSW only */
 		"B4_C8", .size = 64,
 		.b_off = 16, .n_b = 4,
-		.c_off = 32, .n_c = 8,
-		.max_gen = 7 },
+		.c_off = 32, .n_c = 8, },
 	[I915_OA_FORMAT_B4_C8_A16] = { /* HSW only */
 		"B4_C8_A16", .size = 128,
 		.b_off = 16, .n_b = 4,
 		.c_off = 32, .n_c = 8,
-		.a_off = 60, .n_a = 16, .first_a = 29,
-		.max_gen = 7 },
+		.a_off = 60, .n_a = 16, .first_a = 29, },
 	[I915_OA_FORMAT_C4_B8] = { /* HSW+ (header differs from HSW-Gen8+) */
 		"C4_B8", .size = 64,
 		.c_off = 16, .n_c = 4,
 		.b_off = 28, .n_b = 8 },
+};
 
-	/* Gen8+ */
-
+static struct oa_format gen8_oa_formats[local_I915_OA_FORMAT_MAX] = {
 	[local_I915_OA_FORMAT_A12] = {
 		"A12", .size = 64,
-		.a_off = 12, .n_a = 12, .first_a = 7,
-		.min_gen = 8 },
+		.a_off = 12, .n_a = 12, .first_a = 7, },
 	[local_I915_OA_FORMAT_A12_B8_C8] = {
 		"A12_B8_C8", .size = 128,
 		.a_off = 12, .n_a = 12,
 		.b_off = 64, .n_b = 8,
-		.c_off = 96, .n_c = 8, .first_a = 7,
-		.min_gen = 8 },
+		.c_off = 96, .n_c = 8, .first_a = 7, },
 	[local_I915_OA_FORMAT_A32u40_A4u32_B8_C8] = {
 		"A32u40_A4u32_B8_C8", .size = 256,
 		.a40_high_off = 160, .a40_low_off = 16, .n_a40 = 32,
 		.a_off = 144, .n_a = 4, .first_a = 32,
 		.b_off = 192, .n_b = 8,
-		.c_off = 224, .n_c = 8,
-		.min_gen = 8 },
+		.c_off = 224, .n_c = 8, },
 	[I915_OA_FORMAT_C4_B8] = {
 		"C4_B8", .size = 64,
 		.c_off = 16, .n_c = 4,
-		.b_off = 32, .n_b = 8,
-		.min_gen = 8 },
+		.b_off = 32, .n_b = 8, },
 };
 
 static bool hsw_undefined_a_counters[45] = {
@@ -308,6 +298,14 @@ static uint32_t (*read_report_ticks)(uint32_t *report,
 static void (*sanity_check_reports)(uint32_t *oa_report0, uint32_t *oa_report1,
 				    enum drm_i915_oa_format format);
 
+static struct oa_format
+get_oa_format(enum drm_i915_oa_format format)
+{
+	if (IS_HASWELL(devid))
+		return hsw_oa_formats[format];
+	return gen8_oa_formats[format];
+}
+
 static bool
 timestamp_delta_within(uint32_t delta,
 		       uint32_t expected_delta,
@@ -371,7 +369,7 @@ static int
 lookup_format(int i915_perf_fmt_id)
 {
 	igt_assert(i915_perf_fmt_id < local_I915_OA_FORMAT_MAX);
-	igt_assert(oa_formats[i915_perf_fmt_id].name);
+	igt_assert(get_oa_format(i915_perf_fmt_id).name);
 
 	return i915_perf_fmt_id;
 }
@@ -497,9 +495,9 @@ read_debugfs_u64_record(int fd, const char *file, const char *key)
 static uint32_t
 hsw_read_report_ticks(uint32_t *report, enum drm_i915_oa_format format)
 {
-	uint32_t *c = (uint32_t *)(((uint8_t *)report) + oa_formats[format].c_off);
+	uint32_t *c = (uint32_t *)(((uint8_t *)report) + get_oa_format(format).c_off);
 
-	igt_assert_neq(oa_formats[format].n_c, 0);
+	igt_assert_neq(get_oa_format(format).n_c, 0);
 
 	return c[2];
 }
@@ -760,6 +758,7 @@ hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1
 	uint32_t time_delta = timebase_scale(oa_report1[1] - oa_report0[1]);
 	uint32_t clock_delta;
 	uint32_t max_delta;
+	struct oa_format format = get_oa_format(fmt);
 
 	igt_assert_neq(time_delta, 0);
 
@@ -767,7 +766,7 @@ hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1
 	 * can't explicitly derive a clock delta for all OA report
 	 * formats...
 	 */
-	if (oa_formats[fmt].n_c == 0) {
+	if (format.n_c == 0) {
 		/* Assume running at max freq for sake of
 		 * below sanity check on counters... */
 		clock_delta = (gt_max_freq_mhz *
@@ -797,14 +796,14 @@ hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1
 	max_delta = clock_delta * n_eus;
 
 	/* 40bit A counters were only introduced for Gen8+ */
-	igt_assert_eq(oa_formats[fmt].n_a40, 0);
+	igt_assert_eq(format.n_a40, 0);
 
-	for (int j = 0; j < oa_formats[fmt].n_a; j++) {
+	for (int j = 0; j < format.n_a; j++) {
 		uint32_t *a0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].a_off);
+					    format.a_off);
 		uint32_t *a1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].a_off);
-		int a_id = oa_formats[fmt].first_a + j;
+					    format.a_off);
+		int a_id = format.first_a + j;
 		uint32_t delta = a1[j] - a0[j];
 
 		if (undefined_a_counters[a_id])
@@ -814,22 +813,22 @@ hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1
 		igt_assert(delta <= max_delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_b; j++) {
+	for (int j = 0; j < format.n_b; j++) {
 		uint32_t *b0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].b_off);
+					    format.b_off);
 		uint32_t *b1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].b_off);
+					    format.b_off);
 		uint32_t delta = b1[j] - b0[j];
 
 		igt_debug("B%d: delta = %"PRIu32"\n", j, delta);
 		igt_assert(delta <= max_delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_c; j++) {
+	for (int j = 0; j < format.n_c; j++) {
 		uint32_t *c0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t *c1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t delta = c1[j] - c0[j];
 
 		igt_debug("C%d: delta = %"PRIu32"\n", j, delta);
@@ -840,9 +839,10 @@ hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1
 static uint64_t
 gen8_read_40bit_a_counter(uint32_t *report, enum drm_i915_oa_format fmt, int a_id)
 {
-	uint8_t *a40_high = (((uint8_t *)report) + oa_formats[fmt].a40_high_off);
+	struct oa_format format = get_oa_format(fmt);
+	uint8_t *a40_high = (((uint8_t *)report) + format.a40_high_off);
 	uint32_t *a40_low = (uint32_t *)(((uint8_t *)report) +
-					 oa_formats[fmt].a40_low_off);
+					 format.a40_low_off);
 	uint64_t high = (uint64_t)(a40_high[a_id]) << 32;
 
 	return a40_low[a_id] | high;
@@ -887,7 +887,7 @@ accumulate_reports(struct accumulator *accumulator,
 		   uint32_t *start,
 		   uint32_t *end)
 {
-	enum drm_i915_oa_format format = accumulator->format;
+	struct oa_format format = get_oa_format(accumulator->format);
 	uint64_t *deltas = accumulator->deltas;
 	int idx = 0;
 
@@ -902,21 +902,23 @@ accumulate_reports(struct accumulator *accumulator,
 		accumulate_uint32(4, start, end, deltas + idx++);
 	}
 
-	for (int i = 0; i < oa_formats[format].n_a40; i++)
-		accumulate_uint40(i, start, end, format, deltas + idx++);
+	for (int i = 0; i < format.n_a40; i++) {
+		accumulate_uint40(i, start, end, accumulator->format,
+				  deltas + idx++);
+	}
 
-	for (int i = 0; i < oa_formats[format].n_a; i++) {
-		accumulate_uint32(oa_formats[format].a_off + 4 * i,
+	for (int i = 0; i < format.n_a; i++) {
+		accumulate_uint32(format.a_off + 4 * i,
 				  start, end, deltas + idx++);
 	}
 
-	for (int i = 0; i < oa_formats[format].n_b; i++) {
-		accumulate_uint32(oa_formats[format].b_off + 4 * i,
+	for (int i = 0; i < format.n_b; i++) {
+		accumulate_uint32(format.b_off + 4 * i,
 				  start, end, deltas + idx++);
 	}
 
-	for (int i = 0; i < oa_formats[format].n_c; i++) {
-		accumulate_uint32(oa_formats[format].c_off + 4 * i,
+	for (int i = 0; i < format.n_c; i++) {
+		accumulate_uint32(format.c_off + 4 * i,
 				  start, end, deltas + idx++);
 	}
 }
@@ -924,7 +926,7 @@ accumulate_reports(struct accumulator *accumulator,
 static void
 accumulator_print(struct accumulator *accumulator, const char *title)
 {
-	enum drm_i915_oa_format format = accumulator->format;
+	struct oa_format format = get_oa_format(accumulator->format);
 	uint64_t *deltas = accumulator->deltas;
 	int idx = 0;
 
@@ -933,21 +935,21 @@ accumulator_print(struct accumulator *accumulator, const char *title)
 		igt_debug("\ttime delta = %lu\n", deltas[idx++]);
 		igt_debug("\tclock cycle delta = %lu\n", deltas[idx++]);
 
-		for (int i = 0; i < oa_formats[format].n_a40; i++)
+		for (int i = 0; i < format.n_a40; i++)
 			igt_debug("\tA%u = %lu\n", i, deltas[idx++]);
 	} else {
 		igt_debug("\ttime delta = %lu\n", deltas[idx++]);
 	}
 
-	for (int i = 0; i < oa_formats[format].n_a; i++) {
-		int a_id = oa_formats[format].first_a + i;
+	for (int i = 0; i < format.n_a; i++) {
+		int a_id = format.first_a + i;
 		igt_debug("\tA%u = %lu\n", a_id, deltas[idx++]);
 	}
 
-	for (int i = 0; i < oa_formats[format].n_a; i++)
+	for (int i = 0; i < format.n_a; i++)
 		igt_debug("\tB%u = %lu\n", i, deltas[idx++]);
 
-	for (int i = 0; i < oa_formats[format].n_c; i++)
+	for (int i = 0; i < format.n_c; i++)
 		igt_debug("\tC%u = %lu\n", i, deltas[idx++]);
 }
 
@@ -956,6 +958,7 @@ static void
 gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 				  enum drm_i915_oa_format fmt)
 {
+	struct oa_format format = get_oa_format(fmt);
 	uint32_t time_delta = timebase_scale(oa_report1[1] - oa_report0[1]);
 	uint32_t ticks0 = read_report_ticks(oa_report0, fmt);
 	uint32_t ticks1 = read_report_ticks(oa_report1, fmt);
@@ -963,9 +966,9 @@ gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 	uint32_t max_delta;
 	uint64_t freq;
 	uint32_t *rpt0_b = (uint32_t *)(((uint8_t *)oa_report0) +
-					oa_formats[fmt].b_off);
+					format.b_off);
 	uint32_t *rpt1_b = (uint32_t *)(((uint8_t *)oa_report1) +
-					oa_formats[fmt].b_off);
+					format.b_off);
 	uint32_t b;
 	uint32_t ref;
 
@@ -983,7 +986,7 @@ gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 	max_delta = clock_delta * n_eus;
 
 	/* Gen8+ has some 40bit A counters... */
-	for (int j = 0; j < oa_formats[fmt].n_a40; j++) {
+	for (int j = 0; j < format.n_a40; j++) {
 		uint64_t value0 = gen8_read_40bit_a_counter(oa_report0, fmt, j);
 		uint64_t value1 = gen8_read_40bit_a_counter(oa_report1, fmt, j);
 		uint64_t delta = gen8_40bit_a_delta(value0, value1);
@@ -995,12 +998,12 @@ gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 		igt_assert(delta <= max_delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_a; j++) {
+	for (int j = 0; j < format.n_a; j++) {
 		uint32_t *a0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].a_off);
+					    format.a_off);
 		uint32_t *a1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].a_off);
-		int a_id = oa_formats[fmt].first_a + j;
+					    format.a_off);
+		int a_id = format.first_a + j;
 		uint32_t delta = a1[j] - a0[j];
 
 		if (undefined_a_counters[a_id])
@@ -1013,7 +1016,7 @@ gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 	/* The TestOa metric set defines all B counters to be a
 	 * multiple of the gpu clock
 	 */
-	if (oa_formats[fmt].n_b) {
+	if (format.n_b) {
 		b = rpt1_b[0] - rpt0_b[0];
 		igt_debug("B0: delta = %"PRIu32"\n", b);
 		igt_assert_eq(b, 0);
@@ -1052,11 +1055,11 @@ gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
 		igt_assert(b >= ref - 1 && b <= ref + 1);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_c; j++) {
+	for (int j = 0; j < format.n_c; j++) {
 		uint32_t *c0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t *c1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t delta = c1[j] - c0[j];
 
 		igt_debug("C%d: delta = %"PRIu32"\n", j, delta);
@@ -1186,7 +1189,7 @@ i915_read_reports_until_timestamp(enum drm_i915_oa_format oa_format,
 				  uint32_t start_timestamp,
 				  uint32_t end_timestamp)
 {
-	size_t format_size = oa_formats[oa_format].size;
+	size_t format_size = get_oa_format(oa_format).size;
 	uint32_t last_seen_timestamp = start_timestamp;
 	int total_len = 0;
 
@@ -1411,7 +1414,7 @@ read_2_oa_reports(int format_id,
 		  uint32_t *oa_report1,
 		  bool timer_only)
 {
-	size_t format_size = oa_formats[format_id].size;
+	size_t format_size = get_oa_format(format_id).size;
 	size_t sample_size = (sizeof(struct drm_i915_perf_record_header) +
 			      format_size);
 	const struct drm_i915_perf_record_header *header;
@@ -1551,10 +1554,12 @@ open_and_read_2_oa_reports(int format_id,
 static void
 print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
 {
+	struct oa_format format = get_oa_format(fmt);
+
 	igt_debug("TIMESTAMP: 1st = %"PRIu32", 2nd = %"PRIu32", delta = %"PRIu32"\n",
 		  oa_report0[1], oa_report1[1], oa_report1[1] - oa_report0[1]);
 
-	if (IS_HASWELL(devid) && oa_formats[fmt].n_c == 0) {
+	if (IS_HASWELL(devid) && format.n_c == 0) {
 		igt_debug("CLOCK = N/A\n");
 	} else {
 		uint32_t clock0 = read_report_ticks(oa_report0, fmt);
@@ -1588,7 +1593,7 @@ print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
 	}
 
 	/* Gen8+ has some 40bit A counters... */
-	for (int j = 0; j < oa_formats[fmt].n_a40; j++) {
+	for (int j = 0; j < format.n_a40; j++) {
 		uint64_t value0 = gen8_read_40bit_a_counter(oa_report0, fmt, j);
 		uint64_t value1 = gen8_read_40bit_a_counter(oa_report1, fmt, j);
 		uint64_t delta = gen8_40bit_a_delta(value0, value1);
@@ -1600,12 +1605,12 @@ print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
 			  j, value0, value1, delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_a; j++) {
+	for (int j = 0; j < format.n_a; j++) {
 		uint32_t *a0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].a_off);
+					    format.a_off);
 		uint32_t *a1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].a_off);
-		int a_id = oa_formats[fmt].first_a + j;
+					    format.a_off);
+		int a_id = format.first_a + j;
 		uint32_t delta = a1[j] - a0[j];
 
 		if (undefined_a_counters[a_id])
@@ -1615,22 +1620,22 @@ print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
 			  a_id, a0[j], a1[j], delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_b; j++) {
+	for (int j = 0; j < format.n_b; j++) {
 		uint32_t *b0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].b_off);
+					    format.b_off);
 		uint32_t *b1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].b_off);
+					    format.b_off);
 		uint32_t delta = b1[j] - b0[j];
 
 		igt_debug("B%d: 1st = %"PRIu32", 2nd = %"PRIu32", delta = %"PRIu32"\n",
 			  j, b0[j], b1[j], delta);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_c; j++) {
+	for (int j = 0; j < format.n_c; j++) {
 		uint32_t *c0 = (uint32_t *)(((uint8_t *)oa_report0) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t *c1 = (uint32_t *)(((uint8_t *)oa_report1) +
-					    oa_formats[fmt].c_off);
+					    format.c_off);
 		uint32_t delta = c1[j] - c0[j];
 
 		igt_debug("C%d: 1st = %"PRIu32", 2nd = %"PRIu32", delta = %"PRIu32"\n",
@@ -1643,9 +1648,11 @@ print_reports(uint32_t *oa_report0, uint32_t *oa_report1, int fmt)
 static void
 print_report(uint32_t *report, int fmt)
 {
+	struct oa_format format = get_oa_format(fmt);
+
 	igt_debug("TIMESTAMP: %"PRIu32"\n", report[1]);
 
-	if (IS_HASWELL(devid) && oa_formats[fmt].n_c == 0) {
+	if (IS_HASWELL(devid) && format.n_c == 0) {
 		igt_debug("CLOCK = N/A\n");
 	} else {
 		uint32_t clock = read_report_ticks(report, fmt);
@@ -1666,7 +1673,7 @@ print_report(uint32_t *report, int fmt)
 	}
 
 	/* Gen8+ has some 40bit A counters... */
-	for (int j = 0; j < oa_formats[fmt].n_a40; j++) {
+	for (int j = 0; j < format.n_a40; j++) {
 		uint64_t value = gen8_read_40bit_a_counter(report, fmt, j);
 
 		if (undefined_a_counters[j])
@@ -1675,10 +1682,10 @@ print_report(uint32_t *report, int fmt)
 		igt_debug("A%d: %"PRIu64"\n", j, value);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_a; j++) {
+	for (int j = 0; j < format.n_a; j++) {
 		uint32_t *a = (uint32_t *)(((uint8_t *)report) +
-					   oa_formats[fmt].a_off);
-		int a_id = oa_formats[fmt].first_a + j;
+					   format.a_off);
+		int a_id = format.first_a + j;
 
 		if (undefined_a_counters[a_id])
 			continue;
@@ -1686,16 +1693,16 @@ print_report(uint32_t *report, int fmt)
 		igt_debug("A%d: %"PRIu32"\n", a_id, a[j]);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_b; j++) {
+	for (int j = 0; j < format.n_b; j++) {
 		uint32_t *b = (uint32_t *)(((uint8_t *)report) +
-					   oa_formats[fmt].b_off);
+					   format.b_off);
 
 		igt_debug("B%d: %"PRIu32"\n", j, b[j]);
 	}
 
-	for (int j = 0; j < oa_formats[fmt].n_c; j++) {
+	for (int j = 0; j < format.n_c; j++) {
 		uint32_t *c = (uint32_t *)(((uint8_t *)report) +
-					   oa_formats[fmt].c_off);
+					   format.c_off);
 
 		igt_debug("C%d: %"PRIu32"\n", j, c[j]);
 	}
@@ -1705,28 +1712,15 @@ print_report(uint32_t *report, int fmt)
 static void
 test_oa_formats(void)
 {
-	for (int i = 0; i < ARRAY_SIZE(oa_formats); i++) {
+	for (int i = 0; i < I915_OA_FORMAT_MAX; i++) {
+		struct oa_format format = get_oa_format(i);
 		uint32_t oa_report0[64];
 		uint32_t oa_report1[64];
 
-		if (!oa_formats[i].name) /* sparse, indexed by ID */
-			continue;
-
-		if (oa_formats[i].min_gen &&
-		    intel_gen(devid) < oa_formats[i].min_gen) {
-			igt_debug("skipping unsupported OA format %s\n",
-				  oa_formats[i].name);
+		if (!format.name) /* sparse, indexed by ID */
 			continue;
-		}
-
-		if (oa_formats[i].max_gen &&
-		    intel_gen(devid) > oa_formats[i].max_gen) {
-			igt_debug("skipping unsupported OA format %s\n",
-				  oa_formats[i].name);
-			continue;
-		}
 
-		igt_debug("Checking OA format %s\n", oa_formats[i].name);
+		igt_debug("Checking OA format %s\n", format.name);
 
 		open_and_read_2_oa_reports(i,
 					   oa_exp_1_millisec,
@@ -2761,7 +2755,7 @@ test_buffer_fill(void)
 	uint8_t *buf = malloc(buf_size);
 	int len;
 	size_t oa_buf_size = 16 * 1024 * 1024;
-	size_t report_size = oa_formats[test_oa_format].size;
+	size_t report_size = get_oa_format(test_oa_format).size;
 	int n_full_oa_reports = oa_buf_size / report_size;
 	uint64_t fill_duration = n_full_oa_reports * oa_period;
 
@@ -2930,7 +2924,7 @@ test_enable_disable(void)
 	int buf_size = 65536 * (256 + sizeof(struct drm_i915_perf_record_header));
 	uint8_t *buf = malloc(buf_size);
 	size_t oa_buf_size = 16 * 1024 * 1024;
-	size_t report_size = oa_formats[test_oa_format].size;
+	size_t report_size = get_oa_format(test_oa_format).size;
 	int n_full_oa_reports = oa_buf_size / report_size;
 	uint64_t fill_duration = n_full_oa_reports * oa_period;
 
@@ -3621,7 +3615,7 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
 		.num_properties = ARRAY_SIZE(properties) / 2,
 		.properties_ptr = to_user_pointer(properties),
 	};
-	size_t format_size = oa_formats[test_oa_format].size;
+	size_t format_size = get_oa_format(test_oa_format).size;
 	size_t sample_size = (sizeof(struct drm_i915_perf_record_header) +
 			      format_size);
 	int max_reports = (16 * 1024 * 1024) / format_size;

commit 23a578df1df1891b943cd5c3f8c6080b5215e8d7
Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date:   Thu Aug 31 11:32:28 2017 +0100

    tests/perf: add support for Coffeelake
    
    Using the same timestamp frequency as Skylake/Kabylake.
    
    Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>

diff --git a/tests/perf.c b/tests/perf.c
index a8b000e..2adce76 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -1145,6 +1145,16 @@ init_sys_info(void)
 		} else if (IS_GEMINILAKE(devid)) {
 			test_set_uuid = "dd3fd789-e783-4204-8cd0-b671bbccb0cf";
 			timestamp_frequency = 19200000;
+		} else if (IS_COFFEELAKE(devid)) {
+			switch (intel_gt(devid)) {
+			case 1:
+				test_set_uuid = "74fb4902-d3d3-4237-9e90-cbdc68d0a446";
+				break;
+			default:
+				igt_debug("unsupported Cannonlake GT size\n");
+				return false;
+			}
+			timestamp_frequency = 12000000;
 		} else {
 			igt_debug("unsupported GT\n");
 			return false;

commit f1514a6320f65a1524f36407f7f22d6fc7c7679e
Author: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date:   Thu Nov 3 17:27:28 2016 +0000

    tests/perf: prevent power management to kick in when necessary
    
    Some of our tests measure that the OA unit produces reports at
    expected time intervals (as configured through the PERF_OPEN
    ioctl). It turns out the power management plays a role in the decision
    of the OA unit to write reports to memory. Under normal circumstances
    we don't really mind if the unit misses one report here or there, but
    for our tests it makes pretty difficult to verify whether we've made a
    mistake in the configuration.
    


Reply to: