diff mbox

[i-g-t,v5,04/11] tests/perf: rc6: try to guess when rc6 is disabled

Message ID 20170831103515.21188-5-lionel.g.landwerlin@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lionel Landwerlin Aug. 31, 2017, 10:35 a.m. UTC
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 tests/perf.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Matthew Auld Sept. 18, 2017, 8:01 p.m. UTC | #1
On 08/31, Lionel Landwerlin wrote:
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Musial, Ewelina Oct. 2, 2017, 8:44 a.m. UTC | #2
On Thu, Aug 31, 2017 at 11:35:08AM +0100, Lionel Landwerlin wrote:
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>  tests/perf.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/tests/perf.c b/tests/perf.c
> index bd139bde..5fe0a332 100644
> --- a/tests/perf.c
> +++ b/tests/perf.c
> @@ -3463,6 +3463,17 @@ gen8_test_single_ctx_render_target_writes_a_counter(void)
>  	} while (WEXITSTATUS(child_ret) == EAGAIN);
>  }
>  
> +static bool
> +rc6_enabled(void)
> +{
> +	char *rc6_status = read_debugfs_record(drm_fd, "i915_drpc_info",
> +					       "RC6 Enabled");
> +	bool enabled = strcmp(rc6_status, "yes") == 0;
> +
> +	free(rc6_status);
> +	return enabled;
> +}

Could we do some helper with that functionality?
We are checking RC6 state in many places so maybe some global helper?
I am just wondering could be that useful :)

--
Ewelina

> +
>  static void
>  test_rc6_disable(void)
>  {
> @@ -3482,6 +3493,8 @@ test_rc6_disable(void)
>  	};
>  	uint64_t n_events_start, n_events_end;
>  
> +	igt_skip_on(!rc6_enabled());
> +
>  	stream_fd = __perf_open(drm_fd, &param);
>  
>  	n_events_start = read_debugfs_u64_record(drm_fd, "i915_drpc_info",
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/tests/perf.c b/tests/perf.c
index bd139bde..5fe0a332 100644
--- a/tests/perf.c
+++ b/tests/perf.c
@@ -3463,6 +3463,17 @@  gen8_test_single_ctx_render_target_writes_a_counter(void)
 	} while (WEXITSTATUS(child_ret) == EAGAIN);
 }
 
+static bool
+rc6_enabled(void)
+{
+	char *rc6_status = read_debugfs_record(drm_fd, "i915_drpc_info",
+					       "RC6 Enabled");
+	bool enabled = strcmp(rc6_status, "yes") == 0;
+
+	free(rc6_status);
+	return enabled;
+}
+
 static void
 test_rc6_disable(void)
 {
@@ -3482,6 +3493,8 @@  test_rc6_disable(void)
 	};
 	uint64_t n_events_start, n_events_end;
 
+	igt_skip_on(!rc6_enabled());
+
 	stream_fd = __perf_open(drm_fd, &param);
 
 	n_events_start = read_debugfs_u64_record(drm_fd, "i915_drpc_info",