Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add has_dsc()
@ 2023-05-18  5:27 Swati Sharma
  2023-05-18  6:18 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Swati Sharma @ 2023-05-18  5:27 UTC (permalink / raw)
  To: igt-dev

Instead of assuming dsc is supported gen11+, lets use has_dsc
flag in i915_capability to check h/w support.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/i915/kms_dsc.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 3ce28f84..ad698f27 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -253,6 +253,24 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 	}
 }
 
+static bool has_dsc(data_t *data)
+{
+	char buf[4096];
+	int dir, res;
+
+	dir = igt_debugfs_dir(data->drm_fd);
+	igt_assert(dir >= 0);
+
+	igt_require_intel(data->drm_fd);
+
+	res = igt_debugfs_simple_read(dir, "i915_capabilities",
+				      buf, sizeof(buf));
+	igt_require(res > 0);
+	close(dir);
+
+	return strstr(buf, "has_dsc: yes");
+}
+
 igt_main
 {
 	data_t data = {};
@@ -265,7 +283,7 @@ igt_main
 		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
-		igt_require(data.disp_ver >= 11);
+		igt_require(has_dsc(&data));
 	}
 
 	igt_describe("Tests basic display stream compression functionality if supported "
-- 
2.25.1

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

end of thread, other threads:[~2023-05-30  5:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18  5:27 [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add has_dsc() Swati Sharma
2023-05-18  6:18 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-05-18 17:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-30  5:40 ` [igt-dev] [PATCH i-g-t] " Nautiyal, Ankit K

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