Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [i-g-t] lib/kms_psr: Honour PSR OS capability alongside Sink capability
@ 2024-01-17  9:49 soumya prabhu nidoni
  2024-01-17 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: soumya prabhu nidoni @ 2024-01-17  9:49 UTC (permalink / raw)
  To: igt-dev

Currently IGT code is checking only the Sink Support it's not verifying
OS capability.So this patch is verifying OS PSR capability.

Signed-off-by: soumya prabhu nidoni <soumya.prabhu.nidoni@intel.com>
---
 lib/igt_psr.c | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 663bac163..f43d46dfb 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -208,7 +208,8 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode, igt_output
 {
 	char *line;
 	char debugfs_file[128] = {0};
-	char buf[PSR_STATUS_MAX_LEN];
+	char debugfs_file1[128] = {0};
+	char buf[PSR_STATUS_MAX_LEN], buf1[5000];
 	int ret;
 
 	if (output)
@@ -216,10 +217,16 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode, igt_output
 	else
 		sprintf(debugfs_file, "%s", "i915_edp_psr_status");
 
+	sprintf(debugfs_file1, "%s", "i915_capabilities");
+
 	ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file, buf,
 				      sizeof(buf));
 	if (ret < 1)
 		return false;
+	ret = igt_debugfs_simple_read(debugfs_fd, debugfs_file1, buf1,
+				      sizeof(buf1));
+	if (ret < 1)
+		return false;
 
 	line = strstr(buf, "Sink support: ");
 	if (!line)
@@ -227,9 +234,10 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode, igt_output
 
 	switch (mode) {
 	case PSR_MODE_1:
-		return strstr(line, "PSR = yes") ||
+		return ((strstr(line, "PSR = yes") ||
 		       strstr(buf, "Sink_Support: yes\n") ||
-		       strstr(buf, "Sink support: yes");
+		       strstr(buf, "Sink support: yes")) &&
+		       strstr(buf1, "i915.enable_psr=1"));
 	case PSR_MODE_2:
 	case PSR_MODE_2_SEL_FETCH:
 		/*
@@ -240,10 +248,11 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode, igt_output
 		 * PSR version 0x4 that is PSR2 + SU w/ Y-coordinate and SU
 		 * Region Early Transport to support PSR2 (eDP 1.5)
 		 */
-		return strstr(buf, "Sink support: yes [0x03]") ||
+		return ((strstr(buf, "Sink support: yes [0x03]") ||
 		       strstr(buf, "Sink support: yes [0x04]") ||
 		       (strstr(line, "PSR = yes") &&
-		       (strstr(line, "[0x03]") || strstr(line, "[0x04]")));
+		       (strstr(line, "[0x03]") || strstr(line, "[0x04]")))) &&
+			strstr(buf1, "i915.enable_psr=2"));
 	case PR_MODE:
 		return strstr(line, "Panel Replay = yes");
 	default:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-18  5:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17  9:49 [PATCH] [i-g-t] lib/kms_psr: Honour PSR OS capability alongside Sink capability soumya prabhu nidoni
2024-01-17 11:09 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-01-17 11:10 ` ✓ CI.xeBAT: " Patchwork
2024-01-17 13:51 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-01-18  5:12 ` [PATCH] [i-g-t] " Sharma, Swati2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox