[igt-dev] [i-g-t V2 33/40] tests/kms_panel_fitting: Add XE support

Bhanuprakash Modem bhanuprakash.modem at intel.com
Tue Apr 25 06:49:46 UTC 2023


Add XE driver support for kms tests.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 tests/kms_panel_fitting.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c
index 2d0590da2..97ef1ae48 100644
--- a/tests/kms_panel_fitting.c
+++ b/tests/kms_panel_fitting.c
@@ -23,6 +23,7 @@
  */
 
 #include "igt.h"
+#include <limits.h>
 #include <math.h>
 #include <sys/stat.h>
 
@@ -133,7 +134,7 @@ test_panel_fitting_legacy(data_t *d, igt_display_t *display,
 	igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200);
 	igt_plane_set_position(d->plane2, 100, 100);
 
-	if (is_i915_device(display->drm_fd)) {
+	if (is_intel_device(display->drm_fd)) {
 		uint32_t devid = intel_get_drm_devid(display->drm_fd);
 		/*
 		 * Most of gen7 and all of gen8 doesn't support plane scaling
@@ -233,10 +234,15 @@ static void test_panel_fitting(data_t *data, enum test_type type)
 	struct stat sb;
 
 	if (type == TEST_ATOMIC) {
-		igt_require_f(is_i915_device(display->drm_fd), "not valid for non-i915 devices\n");
+		char path[PATH_MAX];
+
+		igt_require_f(is_intel_device(display->drm_fd), "not valid for non-intel devices\n");
 
 		/* Until this is force enabled, force modeset evasion. */
-		if (stat("/sys/module/i915/parameters/fastboot", &sb) == 0)
+		snprintf(path, PATH_MAX, "/sys/module/%s/parameters/fastboot",
+					 is_i915_device(data->drm_fd) ? "i915" : "xe");
+
+		if (stat(path, &sb) == 0)
 			igt_set_module_param_int(data->drm_fd, "fastboot", 1);
 
 		igt_require(intel_display_ver(intel_get_drm_devid(display->drm_fd)) >= 5);
-- 
2.40.0



More information about the igt-dev mailing list