Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 1/3] tests/i915/perf: constify report checks functions
Date: Wed, 25 Nov 2020 13:25:38 +0200	[thread overview]
Message-ID: <20201125112540.426554-2-lionel.g.landwerlin@intel.com> (raw)
In-Reply-To: <20201125112540.426554-1-lionel.g.landwerlin@intel.com>

Those don't need to modify the reports they inspect.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/i915/perf.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index caeabd623..2fbea0f0c 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -206,9 +206,10 @@ static bool *undefined_a_counters;
 static uint64_t oa_exp_1_millisec;
 
 static igt_render_copyfunc_t render_copy = NULL;
-static uint32_t (*read_report_ticks)(uint32_t *report,
+static uint32_t (*read_report_ticks)(const uint32_t *report,
 				     enum drm_i915_oa_format format);
-static void (*sanity_check_reports)(uint32_t *oa_report0, uint32_t *oa_report1,
+static void (*sanity_check_reports)(const uint32_t *oa_report0,
+				    const uint32_t *oa_report1,
 				    enum drm_i915_oa_format format);
 
 static void
@@ -354,7 +355,7 @@ sysfs_read(const char *path)
  * but it's not included in all of the formats.
  */
 static uint32_t
-hsw_read_report_ticks(uint32_t *report, enum drm_i915_oa_format format)
+hsw_read_report_ticks(const uint32_t *report, enum drm_i915_oa_format format)
 {
 	uint32_t *c = (uint32_t *)(((uint8_t *)report) + get_oa_format(format).c_off);
 
@@ -364,13 +365,13 @@ hsw_read_report_ticks(uint32_t *report, enum drm_i915_oa_format format)
 }
 
 static uint32_t
-gen8_read_report_ticks(uint32_t *report, enum drm_i915_oa_format format)
+gen8_read_report_ticks(const uint32_t *report, enum drm_i915_oa_format format)
 {
 	return report[3];
 }
 
 static void
-gen8_read_report_clock_ratios(uint32_t *report,
+gen8_read_report_clock_ratios(const uint32_t *report,
 			      uint32_t *slice_freq_mhz,
 			      uint32_t *unslice_freq_mhz)
 {
@@ -554,7 +555,8 @@ emit_report_perf_count(struct intel_bb *ibb,
 }
 
 static void
-hsw_sanity_check_render_basic_reports(uint32_t *oa_report0, uint32_t *oa_report1,
+hsw_sanity_check_render_basic_reports(const uint32_t *oa_report0,
+				      const uint32_t *oa_report1,
 				      enum drm_i915_oa_format fmt)
 {
 	uint32_t time_delta = timebase_scale(oa_report1[1] - oa_report0[1]);
@@ -639,7 +641,8 @@ 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)
+gen8_read_40bit_a_counter(const uint32_t *report,
+			  enum drm_i915_oa_format fmt, int a_id)
 {
 	struct oa_format format = get_oa_format(fmt);
 	uint8_t *a40_high = (((uint8_t *)report) + format.a40_high_off);
@@ -757,7 +760,8 @@ accumulator_print(struct accumulator *accumulator, const char *title)
 
 /* The TestOa metric set is designed so */
 static void
-gen8_sanity_check_test_oa_reports(uint32_t *oa_report0, uint32_t *oa_report1,
+gen8_sanity_check_test_oa_reports(const uint32_t *oa_report0,
+				  const uint32_t *oa_report1,
 				  enum drm_i915_oa_format fmt)
 {
 	struct oa_format format = get_oa_format(fmt);
-- 
2.29.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-11-25 11:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 11:25 [igt-dev] [PATCH i-g-t v2 0/3] tests/i915/perf: verify non zero reason field in OA reports Lionel Landwerlin
2020-11-25 11:25 ` Lionel Landwerlin [this message]
2020-11-25 21:43   ` [igt-dev] [PATCH i-g-t v2 1/3] tests/i915/perf: constify report checks functions Umesh Nerlige Ramappa
2020-11-25 11:25 ` [igt-dev] [PATCH i-g-t v2 2/3] tests/i915/perf: deal with 0 delta reports Lionel Landwerlin
2020-11-25 22:12   ` Umesh Nerlige Ramappa
2020-11-25 11:25 ` [igt-dev] [PATCH i-g-t v2 3/3] tests/i915/perf: verify reason field in OA reports is never 0 Lionel Landwerlin
2020-11-25 22:35   ` Umesh Nerlige Ramappa
2020-11-26 11:40     ` Lionel Landwerlin
2020-11-25 12:25 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/perf: verify non zero reason field in OA reports Patchwork
2020-11-25 13:57 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-11-25 14:08   ` Lionel Landwerlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125112540.426554-2-lionel.g.landwerlin@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox