[igt-dev] [PATCH i-g-t 18/20] tests/psr: Check for timestamp support

Katarzyna Dec katarzyna.dec at intel.com
Thu Apr 12 12:52:17 UTC 2018


On Tue, Apr 10, 2018 at 07:37:30PM -0700, Dhinakaran Pandiyan wrote:
> BDW+ have PSR interrupts from which the kernel can update exit and
> pre-entry time stamps. Tests should prefer this over sink crc to
> validate PSR.
> 
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> ---
>  tests/kms_psr_sink_crc.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 043b9e38..147b492f 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -75,6 +75,7 @@ typedef struct {
>  	igt_output_t *output;
>  	bool with_psr_disabled;
>  	bool with_sink_crc;
> +	bool with_timestamps;
>  } data_t;
>  
>  static void create_cursor_fb(data_t *data)
> @@ -200,6 +201,17 @@ static bool sink_support(data_t *data)
>  		strstr(buf, "Sink_Support: yes\n");
>  }
>  
> +static void timestamp_support(data_t *data)
> +{
> +	char buf[512];
> +
> +	igt_sysfs_set(data->debugfs_fd, "i915_edp_psr_debug", "1");
> +	igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
> +	data->with_timestamps = strstr(buf, "Last exit at:");
> +	igt_debug("Time stamp support %d\n", data->with_timestamps);
> +	igt_sysfs_set(data->debugfs_fd, "i915_edp_psr_debug", "0");
> +}
> +
Is this information about timestamp in debugs already in the kernel?
Kasia
>  static bool psr_enabled(data_t *data)
>  {
>  	char buf[512];
> @@ -500,6 +512,7 @@ int main(int argc, char *argv[])
>  					 0 : 1);
>  		igt_require_f(sink_support(&data),
>  			      "Sink does not support PSR\n");
> +		timestamp_support(&data);
>  
>  		data.bufmgr = drm_intel_bufmgr_gem_init(data.drm_fd, 4096);
>  		igt_assert(data.bufmgr);
> -- 
> 2.14.1
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list