Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Swati Sharma" <swati2.sharma@intel.com>,
	"Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Subject: [PATCH i-g-t 1/3] tests/intel/i915_pipe_stress: Add XE support
Date: Tue, 11 Feb 2025 17:57:41 +0530	[thread overview]
Message-ID: <20250211122743.329838-2-swati2.sharma@intel.com> (raw)
In-Reply-To: <20250211122743.329838-1-swati2.sharma@intel.com>

Add XE driver support for kms tests. This patch will add a support
to call the corresponding apis based on the driver (i915/xe)

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
---
 tests/intel/i915_pipe_stress.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tests/intel/i915_pipe_stress.c b/tests/intel/i915_pipe_stress.c
index 203eb46a3..78cffe707 100644
--- a/tests/intel/i915_pipe_stress.c
+++ b/tests/intel/i915_pipe_stress.c
@@ -18,6 +18,7 @@
 #include <pthread.h>
 #include <semaphore.h>
 #include "i915/gem.h"
+#include "xe/xe_query.h"
 /**
  * TEST: i915 pipe stress
  * Description: Stress test how gpu and cpu behaves if maximum amount of
@@ -245,6 +246,7 @@ static void *gpu_load(void *ptr)
 	int frame = 0;
 	int rect = 0, total_rects = 0;
 	int pixels = 0;
+	uint32_t region;
 
 	mode = data->highest_mode[pipe];
 	if (!mode)
@@ -255,9 +257,13 @@ static void *gpu_load(void *ptr)
 
 	igt_info("GPU thread pipe %d start\n", pipe);
 
+	if (is_i915_device(data->drm_fd))
+		region = INTEL_MEMORY_REGION_ID(I915_SYSTEM_MEMORY, 0);
+	else
+		region = vram_if_possible(data->drm_fd, 0);
+
 	context->buf = create_buf(data, data->highest_mode[pipe]->hdisplay,
-				  data->highest_mode[pipe]->vdisplay,
-				  INTEL_MEMORY_REGION_ID(I915_SYSTEM_MEMORY, 0));
+				  data->highest_mode[pipe]->vdisplay, region);
 
 	while (data->gpu_thread_state[pipe] != STOPPED) {
 
@@ -846,7 +852,7 @@ igt_main {
 	uint8_t format_idx = 0, tiling_idx = 0;
 
 	igt_fixture {
-		data.drm_fd = data.display.drm_fd = drm_open_driver_master(DRIVER_INTEL);
+		data.drm_fd = data.display.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
 
 		kmstest_set_vt_graphics_mode();
 
@@ -854,7 +860,8 @@ igt_main {
 		igt_require(data.display.is_atomic);
 		igt_display_require_output(&data.display);
 		data.devid = intel_get_drm_devid(data.drm_fd);
-		igt_require_gem(data.drm_fd);
+		if (is_i915_device(data.drm_fd))
+			igt_require_gem(data.drm_fd);
 	}
 
 	for (format_idx = 0; format_idx < N_FORMATS; format_idx++) {
-- 
2.25.1


  reply	other threads:[~2025-02-11 12:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 12:27 [PATCH i-g-t 0/3] Add XE support for i915_pipe_stress Swati Sharma
2025-02-11 12:27 ` Swati Sharma [this message]
2025-02-14 10:21   ` [PATCH i-g-t 1/3] tests/intel/i915_pipe_stress: Add XE support Piecielska, Katarzyna
2025-02-11 12:27 ` [PATCH i-g-t 2/3] tests/intel/i915_pipe_stress: s/i915_pipe_stress/kms_pipe_stress Swati Sharma
2025-02-14 10:22   ` Piecielska, Katarzyna
2025-02-11 12:27 ` [PATCH i-g-t 3/3] tests/intel/kms_pipe_stress: Fix testplan documentation Swati Sharma
2025-02-14 10:23   ` Piecielska, Katarzyna
2025-02-11 15:30 ` ✓ Xe.CI.BAT: success for Add XE support for i915_pipe_stress Patchwork
2025-02-11 15:42 ` ✓ i915.CI.BAT: " Patchwork
2025-02-11 17:22 ` ✗ i915.CI.Full: failure " Patchwork
2025-02-14 10:17   ` Zbigniew Kempczyński
2025-02-11 23:04 ` ✓ Xe.CI.Full: success " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250211122743.329838-2-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox