[igt-dev] [PATCH i-g-t v2 1/3] tests/psr: Prepare for moving PSR state checking functions into lib

Rodrigo Vivi rodrigo.vivi at intel.com
Tue Jul 17 05:06:28 UTC 2018


On Mon, Jul 16, 2018 at 03:39:03PM -0700, Dhinakaran Pandiyan wrote:
> Change the function arguments to not rely on test specific data as
> the following patches change kms_frontbuffer_tracking to reuse PSR
> functions.
> 
> v2: Leave --no-psr intact (Rodrigo)

Thanks...


> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
>  tests/kms_psr.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/kms_psr.c b/tests/kms_psr.c
> index 4eca51da..9e893ed8 100644
> --- a/tests/kms_psr.c
> +++ b/tests/kms_psr.c
> @@ -197,12 +197,12 @@ static bool sink_support(data_t *data)
>  		strstr(buf, "Sink_Support: yes\n");
>  }
>  
> -static bool psr_active(data_t *data, bool check_active)
> +static bool psr_active(int fd, bool check_active)
>  {
>  	bool active;
>  	char buf[512];
>  
> -	igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
> +	igt_debugfs_read(fd, "i915_edp_psr_status", buf);
>  
>  	active = strstr(buf, "HW Enabled & Active bit: yes\n") &&
>  		 (strstr(buf, "SRDENT") || strstr(buf, "SLEEP"));
> @@ -214,7 +214,7 @@ static bool wait_psr_entry(data_t *data)
>  	if (data->with_psr_disabled)
>  		return true;
>  
> -	return igt_wait((psr_active(data, true)), 500, 1);
> +	return igt_wait((psr_active(data->drm_fd, true)), 500, 1);
>  }
>  
>  static inline void manual(const char *expected)
> @@ -303,7 +303,7 @@ static void run_test(data_t *data)
>  		expected = "screen GREEN";
>  		break;
>  	}
> -	igt_assert(psr_active(data, false));
> +	igt_assert(psr_active(data->drm_fd, false));

I wonder if we shouldn't change it to only get the fd
and here for instance use igt_assert(!psr_active...

anyways this can be in separated patch

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

>  	manual(expected);
>  }
>  
> -- 
> 2.17.1
> 


More information about the igt-dev mailing list