intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] gem_watchdog: Skip test if default request expiry is not compiled in
@ 2021-05-24 14:01 Tvrtko Ursulin
  2021-05-24 14:19 ` [Intel-gfx] [igt-dev] " Petri Latvala
  0 siblings, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2021-05-24 14:01 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Test incorrectly assumes no modparam means default expiry, while in
reality no modparam means old kernel / de-selected feature in which
case test should skip.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_watchdog.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
index 8f9fb17750fb..89992a3c5099 100644
--- a/tests/i915/gem_watchdog.c
+++ b/tests/i915/gem_watchdog.c
@@ -630,6 +630,7 @@ igt_main
 
 	igt_fixture {
 		struct drm_i915_query_item item;
+		const unsigned int timeout = 1;
 		char *tmp;
 
 		i915 = drm_open_driver_master(DRIVER_INTEL);
@@ -639,16 +640,13 @@ igt_main
 		igt_require_gem(i915);
 
 		tmp = __igt_params_get(i915, "request_timeout_ms");
-		if (tmp) {
-			const unsigned int timeout = 1;
+		igt_skip_on_f(!tmp || !atoi(tmp),
+			      "Request expiry not supported!");
+		free(tmp);
 
-			igt_params_save_and_set(i915, "request_timeout_ms",
-						"%u", timeout * 1000);
-			default_timeout_wait_s = timeout * 5;
-			free(tmp);
-		} else {
-			default_timeout_wait_s = 12;
-		}
+		igt_params_save_and_set(i915, "request_timeout_ms", "%u",
+					timeout * 1000);
+		default_timeout_wait_s = timeout * 5;
 
 		i915 = gem_reopen_driver(i915); /* Apply modparam. */
 
-- 
2.30.2

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

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] gem_watchdog: Skip test if default request expiry is not compiled in
  2021-05-24 14:01 [Intel-gfx] [PATCH i-g-t] gem_watchdog: Skip test if default request expiry is not compiled in Tvrtko Ursulin
@ 2021-05-24 14:19 ` Petri Latvala
  2021-05-24 14:38   ` [Intel-gfx] [PATCH i-g-t v2] " Tvrtko Ursulin
  0 siblings, 1 reply; 4+ messages in thread
From: Petri Latvala @ 2021-05-24 14:19 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: igt-dev, Intel-gfx

On Mon, May 24, 2021 at 03:01:13PM +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Test incorrectly assumes no modparam means default expiry, while in
> reality no modparam means old kernel / de-selected feature in which
> case test should skip.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  tests/i915/gem_watchdog.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
> index 8f9fb17750fb..89992a3c5099 100644
> --- a/tests/i915/gem_watchdog.c
> +++ b/tests/i915/gem_watchdog.c
> @@ -630,6 +630,7 @@ igt_main
>  
>  	igt_fixture {
>  		struct drm_i915_query_item item;
> +		const unsigned int timeout = 1;
>  		char *tmp;
>  
>  		i915 = drm_open_driver_master(DRIVER_INTEL);
> @@ -639,16 +640,13 @@ igt_main
>  		igt_require_gem(i915);
>  
>  		tmp = __igt_params_get(i915, "request_timeout_ms");
> -		if (tmp) {
> -			const unsigned int timeout = 1;
> +		igt_skip_on_f(!tmp || !atoi(tmp),
> +			      "Request expiry not supported!");

Newline missing at the end.


-- 
Petri Latvala


> +		free(tmp);
>  
> -			igt_params_save_and_set(i915, "request_timeout_ms",
> -						"%u", timeout * 1000);
> -			default_timeout_wait_s = timeout * 5;
> -			free(tmp);
> -		} else {
> -			default_timeout_wait_s = 12;
> -		}
> +		igt_params_save_and_set(i915, "request_timeout_ms", "%u",
> +					timeout * 1000);
> +		default_timeout_wait_s = timeout * 5;
>  
>  		i915 = gem_reopen_driver(i915); /* Apply modparam. */
>  
> -- 
> 2.30.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [Intel-gfx] [PATCH i-g-t v2] gem_watchdog: Skip test if default request expiry is not compiled in
  2021-05-24 14:19 ` [Intel-gfx] [igt-dev] " Petri Latvala
@ 2021-05-24 14:38   ` Tvrtko Ursulin
  2021-06-29 22:00     ` Dixit, Ashutosh
  0 siblings, 1 reply; 4+ messages in thread
From: Tvrtko Ursulin @ 2021-05-24 14:38 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Test incorrectly assumes no modparam means default expiry, while in
reality no modparam means old kernel / de-selected feature in which
case test should skip.

v2:
 * New line. (Petri)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/i915/gem_watchdog.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
index 8f9fb17750fb..67fddac74bc1 100644
--- a/tests/i915/gem_watchdog.c
+++ b/tests/i915/gem_watchdog.c
@@ -630,6 +630,7 @@ igt_main
 
 	igt_fixture {
 		struct drm_i915_query_item item;
+		const unsigned int timeout = 1;
 		char *tmp;
 
 		i915 = drm_open_driver_master(DRIVER_INTEL);
@@ -639,16 +640,13 @@ igt_main
 		igt_require_gem(i915);
 
 		tmp = __igt_params_get(i915, "request_timeout_ms");
-		if (tmp) {
-			const unsigned int timeout = 1;
+		igt_skip_on_f(!tmp || !atoi(tmp),
+			      "Request expiry not supported!\n");
+		free(tmp);
 
-			igt_params_save_and_set(i915, "request_timeout_ms",
-						"%u", timeout * 1000);
-			default_timeout_wait_s = timeout * 5;
-			free(tmp);
-		} else {
-			default_timeout_wait_s = 12;
-		}
+		igt_params_save_and_set(i915, "request_timeout_ms", "%u",
+					timeout * 1000);
+		default_timeout_wait_s = timeout * 5;
 
 		i915 = gem_reopen_driver(i915); /* Apply modparam. */
 
-- 
2.30.2

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

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

* Re: [Intel-gfx] [PATCH i-g-t v2] gem_watchdog: Skip test if default request expiry is not compiled in
  2021-05-24 14:38   ` [Intel-gfx] [PATCH i-g-t v2] " Tvrtko Ursulin
@ 2021-06-29 22:00     ` Dixit, Ashutosh
  0 siblings, 0 replies; 4+ messages in thread
From: Dixit, Ashutosh @ 2021-06-29 22:00 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: igt-dev, Intel-gfx

On Mon, 24 May 2021 07:38:01 -0700, Tvrtko Ursulin wrote:
>
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> Test incorrectly assumes no modparam means default expiry, while in
> reality no modparam means old kernel / de-selected feature in which
> case test should skip.
>
> v2:
>  * New line. (Petri)

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>

> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  tests/i915/gem_watchdog.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/tests/i915/gem_watchdog.c b/tests/i915/gem_watchdog.c
> index 8f9fb17750fb..67fddac74bc1 100644
> --- a/tests/i915/gem_watchdog.c
> +++ b/tests/i915/gem_watchdog.c
> @@ -630,6 +630,7 @@ igt_main
>
>	igt_fixture {
>		struct drm_i915_query_item item;
> +		const unsigned int timeout = 1;
>		char *tmp;
>
>		i915 = drm_open_driver_master(DRIVER_INTEL);
> @@ -639,16 +640,13 @@ igt_main
>		igt_require_gem(i915);
>
>		tmp = __igt_params_get(i915, "request_timeout_ms");
> -		if (tmp) {
> -			const unsigned int timeout = 1;
> +		igt_skip_on_f(!tmp || !atoi(tmp),
> +			      "Request expiry not supported!\n");
> +		free(tmp);
>
> -			igt_params_save_and_set(i915, "request_timeout_ms",
> -						"%u", timeout * 1000);
> -			default_timeout_wait_s = timeout * 5;
> -			free(tmp);
> -		} else {
> -			default_timeout_wait_s = 12;
> -		}
> +		igt_params_save_and_set(i915, "request_timeout_ms", "%u",
> +					timeout * 1000);
> +		default_timeout_wait_s = timeout * 5;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2021-06-29 22:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 14:01 [Intel-gfx] [PATCH i-g-t] gem_watchdog: Skip test if default request expiry is not compiled in Tvrtko Ursulin
2021-05-24 14:19 ` [Intel-gfx] [igt-dev] " Petri Latvala
2021-05-24 14:38   ` [Intel-gfx] [PATCH i-g-t v2] " Tvrtko Ursulin
2021-06-29 22:00     ` Dixit, Ashutosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).