[PATCH i-g-t v3 1/7] lib/igt_psr: Set Panel Replay disable bit for PSR modes
Jouni Högander
jouni.hogander at intel.com
Fri Jun 14 05:38:33 UTC 2024
Set Panel Replay disable bit for PSR_MODE_* to prevent using Panel Replay
for panels supporting it.
Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
Reviewed-by: Kunal Joshi <kunal1.joshi at intel.com>
---
lib/igt_psr.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 6008b73a6..964f18487 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -163,30 +163,36 @@ static bool psr_set(int device, int debugfs_fd, int mode, igt_output_t *output)
*/
ret = psr_modparam_set(device, mode >= PSR_MODE_1);
} else {
- const char *debug_val;
+ int debug_val = mode <= PSR_MODE_2_SEL_FETCH ? 0x40 : 0;
switch (mode) {
case PSR_MODE_1:
- debug_val = "0x3";
- break;
+ case PR_MODE:
+ debug_val |= 0x3;
+ break;
case PSR_MODE_2:
- debug_val = "0x2";
- break;
+ debug_val |= 0x2;
+ break;
case PSR_MODE_2_SEL_FETCH:
- debug_val = "0x4";
- break;
- case PR_MODE:
- debug_val = "0x5";
- break;
case PR_MODE_SEL_FETCH:
- debug_val = "0x6";
+ debug_val |= 0x4;
break;
default:
/* Disables PSR */
- debug_val = "0x1";
+ debug_val = 0x1;
}
- ret = psr_write(debugfs_fd, debug_val, output);
+ /* old debugfs interface doesn't recognize Panel Replay disable bit */
+ do {
+ char debug_str[8];
+
+ sprintf(debug_str, "0x%x", debug_val);
+ ret = psr_write(debugfs_fd, debug_str, output);
+ if (!(debug_val & 0x40))
+ break;
+
+ debug_val &= ~0x40;
+ } while (ret <= 0);
igt_require_f(ret > 0, "PSR2 SF feature not available\n");
}
--
2.34.1
More information about the igt-dev
mailing list