[igt-dev] [PATCH i-g-t 2/4] tests/i915_pm_dc: Use psr_sink_support of reimplement it again

José Roberto de Souza jose.souza at intel.com
Wed Nov 13 22:39:29 UTC 2019


Also moving the sink check to igt_fixture as it do not change
overtime.

Cc: Jeevan B <jeevan.b at intel.com>
Cc: Anshuman Gupta <anshuman.gupta at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 tests/i915/i915_pm_dc.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index f7a3896b..d241ed16 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -84,16 +84,6 @@ static void display_fini(data_t *data)
 	igt_display_fini(&data->display);
 }
 
-static bool edp_psr_sink_support(data_t *data)
-{
-	char buf[512];
-
-	igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status",
-				buf, sizeof(buf));
-
-	return strstr(buf, "Sink support: yes");
-}
-
 static bool edp_psr2_enabled(data_t *data)
 {
 	char buf[512];
@@ -417,6 +407,7 @@ int main(int argc, char *argv[])
 		igt_require(has_runtime_pm);
 		igt_require(igt_pm_dmc_loaded(data.debugfs_fd));
 		igt_display_require(&data.display, data.drm_fd);
+		igt_require(psr_sink_support(data.debugfs_fd, PSR_MODE_2));
 		/* Make sure our Kernel supports MSR and the module is loaded */
 		igt_require(igt_kmod_load("msr", NULL) == 0);
 
@@ -436,8 +427,6 @@ int main(int argc, char *argv[])
 	igt_subtest("dc5-psr") {
 		data.op_psr_mode = PSR_MODE_1;
 		psr_enable(data.debugfs_fd, data.op_psr_mode);
-		igt_require_f(edp_psr_sink_support(&data),
-			      "Sink does not support PSR\n");
 		test_dc_state_psr(&data, CHECK_DC5);
 	}
 
@@ -446,8 +435,6 @@ int main(int argc, char *argv[])
 	igt_subtest("dc6-psr") {
 		data.op_psr_mode = PSR_MODE_1;
 		psr_enable(data.debugfs_fd, data.op_psr_mode);
-		igt_require_f(edp_psr_sink_support(&data),
-			      "Sink does not support PSR\n");
 		igt_require_f(igt_pm_pc8_plus_residencies_enabled(data.msr_fd),
 			      "PC8+ residencies not supported\n");
 		test_dc_state_psr(&data, CHECK_DC6);
-- 
2.24.0



More information about the igt-dev mailing list