public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] tests/kms_psr2_su: Read su blocks of frame 1 if frame 0 is 0
@ 2020-05-30  1:16 José Roberto de Souza
  2020-05-30  1:16 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_psr2_su: Print debugfs when skipping test José Roberto de Souza
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: José Roberto de Souza @ 2020-05-30  1:16 UTC (permalink / raw)
  To: igt-dev

Not sure why but in recent kernels + IGT when PSR status debugfs is
read the frame already passed, so the su blocks is set in frame 1
and causing the test to fail for page flips.
So here reading from frame 1 if frame 0 has 0 blocks, as this test
always changes screen with the same number of su blocks it is not a
issue.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/608
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 lib/igt_psr.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/igt_psr.c b/lib/igt_psr.c
index 4109b5295..956f6219c 100644
--- a/lib/igt_psr.c
+++ b/lib/igt_psr.c
@@ -195,11 +195,12 @@ bool psr_sink_support(int device, int debugfs_fd, enum psr_mode mode)
 
 #define PSR2_SU_BLOCK_STR_LOOKUP "PSR2 SU blocks:\n0\t"
 
+/* Return the the last or last but one su blocks */
 static bool
 psr2_read_last_num_su_blocks_val(int debugfs_fd, uint16_t *num_su_blocks)
 {
 	char buf[PSR_STATUS_MAX_LEN];
-	char *str;
+	char *str, *str2;
 	int ret;
 
 	ret = igt_debugfs_simple_read(debugfs_fd, "i915_edp_psr_status", buf,
@@ -212,6 +213,13 @@ psr2_read_last_num_su_blocks_val(int debugfs_fd, uint16_t *num_su_blocks)
 		return false;
 
 	str = &str[strlen(PSR2_SU_BLOCK_STR_LOOKUP)];
+	*num_su_blocks = (uint16_t)strtol(str, &str2, 10);
+	if (*num_su_blocks != 0)
+		return true;
+
+	str = str2;
+	/* Jump '\n''1''\t' */
+	str += 3;
 	*num_su_blocks = (uint16_t)strtol(str, NULL, 10);
 
 	return true;
-- 
2.26.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2020-06-02 17:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-30  1:16 [igt-dev] [PATCH i-g-t 1/2] tests/kms_psr2_su: Read su blocks of frame 1 if frame 0 is 0 José Roberto de Souza
2020-05-30  1:16 ` [igt-dev] [PATCH i-g-t 2/2] tests/kms_psr2_su: Print debugfs when skipping test José Roberto de Souza
2020-06-01  8:18   ` Petri Latvala
2020-06-01 16:46     ` Souza, Jose
2020-06-02 16:56       ` Mun, Gwan-gyeong
2020-06-02 17:11         ` Souza, Jose
2020-05-30  1:59 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_psr2_su: Read su blocks of frame 1 if frame 0 is 0 Patchwork
2020-05-30  6:30 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-06-02 16:40 ` [igt-dev] [PATCH i-g-t 1/2] " Mun, Gwan-gyeong

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