[igt-dev] [PATCH i-g-t 1/2] Revert "lib/igt_psr: Move "is enabled" implementation to lib"

José Roberto de Souza jose.souza at intel.com
Thu Nov 28 00:49:01 UTC 2019


This reverts commit 4bb46f08f7cb6485642c4351cecdad93072d27a0.
The next patch have more information about why this patch was
reverted.

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>
---
 lib/igt_psr.c           | 16 ----------------
 lib/igt_psr.h           |  1 -
 tests/i915/i915_pm_dc.c | 13 ++++++++++++-
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 32d69fea..83ccacdd 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -210,19 +210,3 @@ bool psr2_wait_su(int debugfs_fd, uint16_t *num_su_blocks)
 {
 	return igt_wait(psr2_read_last_num_su_blocks_val(debugfs_fd, num_su_blocks), 40, 1);
 }
-
-bool psr_enabled(int debugfs_fd, enum psr_mode mode)
-{
-	char buf[PSR_STATUS_MAX_LEN];
-	int ret;
-
-	ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
-				      sizeof(buf));
-	if (ret < 0)
-		return false;
-
-	if (mode == PSR_MODE_1)
-		return strstr(buf, "PSR mode: PSR1 enabled");
-	else
-		return strstr(buf, "PSR mode: PSR2 enabled");
-}
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index 9885cb11..ca385736 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -42,6 +42,5 @@ bool psr_enable(int debugfs_fd, enum psr_mode);
 bool psr_disable(int debugfs_fd);
 bool psr_sink_support(int debugfs_fd, enum psr_mode);
 bool psr2_wait_su(int debugfs_fd, uint16_t *num_su_blocks);
-bool psr_enabled(int debugfs_fd, enum psr_mode mode);
 
 #endif
diff --git a/tests/i915/i915_pm_dc.c b/tests/i915/i915_pm_dc.c
index 2cf357a2..02b08189 100644
--- a/tests/i915/i915_pm_dc.c
+++ b/tests/i915/i915_pm_dc.c
@@ -84,6 +84,16 @@ static void display_fini(data_t *data)
 	igt_display_fini(&data->display);
 }
 
+static bool edp_psr2_enabled(data_t *data)
+{
+	char buf[512];
+
+	igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status",
+				buf, sizeof(buf));
+
+	return strstr(buf, "PSR mode: PSR2 enabled") != NULL;
+}
+
 static void cleanup_dc_psr(data_t *data)
 {
 	igt_plane_t *primary;
@@ -288,7 +298,8 @@ static void setup_dc3co(data_t *data)
 {
 	data->op_psr_mode = PSR_MODE_2;
 	psr_enable(data->debugfs_fd, data->op_psr_mode);
-	igt_require(psr_enabled(data->debugfs_fd, PSR_MODE_2));
+	igt_require_f(edp_psr2_enabled(data),
+		      "PSR2 is not enabled\n");
 }
 
 static void test_dc3co_vpb_simulation(data_t *data)
-- 
2.24.0



More information about the igt-dev mailing list