[igt-dev] [PATCH i-g-t] tests/kms_psr2_sf: Enable selective fetch

Petri Latvala petri.latvala at intel.com
Thu Feb 4 15:11:28 UTC 2021


On Thu, Feb 04, 2021 at 06:08:41AM -0800, José Roberto de Souza wrote:
> Reload driver enabling PSR2 selective fetch to start to have
> some tests coverage of this feature by CI.
> 
> Cc: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
> Cc: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya at intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
>  tests/kms_psr2_sf.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/tests/kms_psr2_sf.c b/tests/kms_psr2_sf.c
> index 296ed8476..751d6ff03 100644
> --- a/tests/kms_psr2_sf.c
> +++ b/tests/kms_psr2_sf.c
> @@ -24,6 +24,7 @@
>  
>  #include "igt.h"
>  #include "igt_sysfs.h"
> +#include "igt_kmod.h"
>  #include "igt_psr.h"
>  #include <errno.h>
>  #include <stdbool.h>
> @@ -544,6 +545,14 @@ static void cleanup(data_t *data)
>  	igt_remove_fb(data->drm_fd, &data->fb_test);
>  }
>  
> +static void reload_driver(bool enable_sel_fetch)
> +{
> +	const char *params = enable_sel_fetch ? "enable_psr2_sel_fetch=1" : "";
> +
> +	igt_i915_driver_unload();
> +	igt_assert_eq(igt_i915_driver_load(params), 0);
> +}


Does this parameter need to be set at load time or would igt_params_set() suffice?


-- 
Petri Latvala



> +
>  igt_main
>  {
>  	data_t data = {};
> @@ -552,6 +561,9 @@ igt_main
>  	igt_fixture {
>  		int r;
>  
> +		/* TODO: drop this as soon driver enables it by default */
> +		reload_driver(true);
> +
>  		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>  		data.debugfs_fd = igt_debugfs_dir(data.drm_fd);
>  		kmstest_set_vt_graphics_mode();
> @@ -645,5 +657,7 @@ igt_main
>  		close(data.debugfs_fd);
>  		drm_intel_bufmgr_destroy(data.bufmgr);
>  		display_fini(&data);
> +
> +		reload_driver(false);
>  	}
>  }
> -- 
> 2.30.0
> 
> _______________________________________________
> 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