[igt-dev] [PATCH i-g-t 4/5] tests/intel/kms_pm_dc: Use gem_has_lmem()

Swati Sharma swati2.sharma at intel.com
Thu Sep 14 14:04:00 UTC 2023


Instead of using i915_capabilities debugfs to know if platform
is discrete or not, use gem_has_lmem for the same.

Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/intel/kms_pm_dc.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 037c5ad2d..e7ba1f919 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -133,15 +133,6 @@ typedef struct {
 static bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count);
 static void check_dc_counter(data_t *data, int dc_flag, uint32_t prev_dc_count);
 
-static bool is_dgfx(data_t *data)
-{
-	char buf[4096];
-
-	igt_debugfs_simple_read(data->debugfs_fd, "i915_capabilities",
-				buf, sizeof(buf));
-	return strstr(buf, "is_dgfx: yes");
-}
-
 static void setup_output(data_t *data)
 {
 	igt_display_t *display = &data->display;
@@ -654,6 +645,7 @@ static void kms_poll_state_restore(int sig)
 igt_main
 {
 	data_t data = {};
+	bool is_dgfx;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
@@ -735,7 +727,8 @@ igt_main
 
 	igt_describe("This test validates display engine entry to DC9 state");
 	igt_subtest("dc9-dpms") {
-		if (!(is_dgfx(&data)))
+		is_dgfx = gem_has_lmem(data.drm_fd);
+		if (!is_dgfx)
 			igt_require_f(igt_pm_pc8_plus_residencies_enabled(data.msr_fd),
 				      "PC8+ residencies not supported\n");
 		test_dc9_dpms(&data);
-- 
2.25.1



More information about the igt-dev mailing list