Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Kunal Joshi" <kunal1.joshi@intel.com>,
	"Jouni Högander" <jouni.hogander@intel.com>,
	"Animesh Manna" <animesh.manna@intel.com>,
	"Arun R Murthy" <arun.r.murthy@intel.com>
Subject: [PATCH i-g-t 2/3] lib/igt_psr: add support for PR selective update
Date: Mon, 19 Feb 2024 22:03:32 +0530	[thread overview]
Message-ID: <20240219163333.2339647-3-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20240219163333.2339647-1-kunal1.joshi@intel.com>

adapt to kmd changes to support PR selective update
https://patchwork.freedesktop.org/patch/575163/?series=128193&rev=3

v2: "PSR2 selective fetch: enable" valid for both cases (Jouni)
v3: use check_psr2_support (Jouni)
v4: split patches (Jouni)
v5: drop changes on psr2_sel_fetch_to_psr1 and *_restore (Jouni)

Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 lib/igt_psr.c | 20 ++++++++++++++------
 lib/igt_psr.h |  2 +-
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index cad8cce05..6008b73a6 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -41,7 +41,7 @@ bool psr_disabled_check(int debugfs_fd)
 	return strstr(buf, "PSR mode: disabled\n");
 }
 
-bool psr2_selective_fetch_check(int debugfs_fd, igt_output_t *output)
+bool selective_fetch_check(int debugfs_fd, igt_output_t *output)
 {
 	char buf[PSR_STATUS_MAX_LEN];
 	char debugfs_file[128] = {0};
@@ -248,7 +248,9 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode, igt_output
 		       (strstr(line, "PSR = yes") &&
 		       (strstr(line, "[0x03]") || strstr(line, "[0x04]")));
 	case PR_MODE:
-		return strstr(line, "Panel Replay = yes");
+		return strstr(line, "Panel Replay = yes, Panel Replay Selective Update = no");
+	case PR_MODE_SEL_FETCH:
+		return strstr(line, "Panel Replay = yes, Panel Replay Selective Update = yes");
 	default:
 		igt_assert_f(false, "Invalid psr mode\n");
 		return false;
@@ -317,7 +319,7 @@ bool i915_psr2_selective_fetch_check(int drm_fd, igt_output_t *output)
 		return false;
 
 	debugfs_fd = igt_debugfs_dir(drm_fd);
-	ret = psr2_selective_fetch_check(debugfs_fd, output);
+	ret = selective_fetch_check(debugfs_fd, output);
 	close(debugfs_fd);
 
 	return ret;
@@ -343,7 +345,11 @@ bool i915_psr2_sel_fetch_to_psr1(int drm_fd, igt_output_t *output)
 		return ret;
 
 	debugfs_fd = igt_debugfs_dir(drm_fd);
-	if (psr2_selective_fetch_check(debugfs_fd, output)) {
+	if (selective_fetch_check(debugfs_fd, output)) {
+		/*
+		 * With below we switch to PSR1 incase of PSR and
+		 * Panel Replay Full Frame update in case of Panel Replay.
+		 */
 		psr_set(drm_fd, debugfs_fd, PSR_MODE_1, output);
 		ret = true;
 	}
@@ -389,11 +395,13 @@ enum psr_mode psr_get_mode(int debugfs_fd, igt_output_t *output)
 
 	if (strstr(buf, "Panel Replay Enabled"))
 		return PR_MODE;
+	else if (strstr(buf, "Panel Replay Selective Update Enabled"))
+		return PR_MODE_SEL_FETCH;
 	else if (strstr(buf, "PSR2 selective fetch: enabled"))
 		return PSR_MODE_2_SEL_FETCH;
-	else if (strstr(buf, "PSR2 enabled"))
+	else if (strstr(buf, "PSR2"))
 		return PSR_MODE_2;
-	else if (strstr(buf, "PSR1 enabled"))
+	else if (strstr(buf, "PSR1"))
 		return PSR_MODE_1;
 
 	return PSR_DISABLED;
diff --git a/lib/igt_psr.h b/lib/igt_psr.h
index 372bef2b2..e8595fd8c 100644
--- a/lib/igt_psr.h
+++ b/lib/igt_psr.h
@@ -46,7 +46,7 @@ enum fbc_mode {
 };
 
 bool psr_disabled_check(int debugfs_fd);
-bool psr2_selective_fetch_check(int debugfs_fd, igt_output_t *output);
+bool selective_fetch_check(int debugfs_fd, igt_output_t *output);
 bool psr_wait_entry(int debugfs_fd, enum psr_mode mode, igt_output_t *output);
 bool psr_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *output);
 bool psr_long_wait_update(int debugfs_fd, enum psr_mode mode, igt_output_t *output);
-- 
2.25.1


  parent reply	other threads:[~2024-02-19 16:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 16:33 [PATCH i-g-t 0/3] extend psr2_sf test for pr_sf Kunal Joshi
2024-02-19 16:33 ` [PATCH i-g-t 1/3] lib/igt_psr: modify library to support multiple PSR/PR outputs Kunal Joshi
2024-02-20  8:47   ` Hogander, Jouni
2024-02-19 16:33 ` Kunal Joshi [this message]
2024-02-20  8:48   ` [PATCH i-g-t 2/3] lib/igt_psr: add support for PR selective update Hogander, Jouni
2024-02-19 16:33 ` [PATCH i-g-t 3/3] tests/intel/kms_psr2_sf: extend tests for panel replay sf Kunal Joshi
2024-02-20  9:06   ` Hogander, Jouni
2024-02-21  8:54     ` Joshi, Kunal1
2024-02-19 17:50 ` ✓ Fi.CI.BAT: success for extend psr2_sf test for pr_sf (rev6) Patchwork
2024-02-19 17:57 ` ✗ CI.xeBAT: failure " Patchwork
2024-02-19 23:45 ` ✗ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-02-21  9:01 [PATCH i-g-t 0/3] extend psr2_sf test for pr_sf Kunal Joshi
2024-02-21  9:01 ` [PATCH i-g-t 2/3] lib/igt_psr: add support for PR selective update Kunal Joshi
2024-02-18  9:17 [PATCH i-g-t 0/3] extend psr2_sf test for pr_sf Kunal Joshi
2024-02-18  9:17 ` [PATCH i-g-t 2/3] lib/igt_psr: add support for PR selective update Kunal Joshi
2024-02-19  8:00   ` Hogander, Jouni
2024-02-19  8:12     ` Joshi, Kunal1
2024-02-19  8:56       ` Hogander, Jouni
2024-02-19  9:01         ` Joshi, Kunal1
2024-02-19 10:01   ` Joshi, Kunal1
2024-02-19 10:29     ` Hogander, Jouni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240219163333.2339647-3-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jouni.hogander@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox