[i-g-t 28/43] tests/kms_flip: Add XE support
Bhanuprakash Modem
bhanuprakash.modem at intel.com
Fri Mar 24 08:09:48 UTC 2023
Add XE driver support for kms tests.
TODO: Add support for xe specific BUSY tests
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
tests/kms_flip.c | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 5e82f4a2f..bf84f92f6 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -44,6 +44,7 @@
#include "i915/gem_create.h"
#include "igt_stats.h"
+#include "xe/xe_query.h"
#define TEST_DPMS (1 << 0)
@@ -792,7 +793,8 @@ static bool run_test_step(struct test_output *o, unsigned int *events)
memset(&hang, 0, sizeof(hang));
if (do_flip && (o->flags & TEST_HANG)) {
- igt_require_intel(drm_fd);
+ igt_require_i915(drm_fd);
+ /* TODO: Add XE support? */
ahnd = get_reloc_ahnd(drm_fd, 0);
hang = hang_gpu(drm_fd, ahnd);
}
@@ -1347,8 +1349,10 @@ restart:
o->fb_width *= 2;
modifier = DRM_FORMAT_MOD_LINEAR;
- if (o->flags & TEST_FENCE_STRESS)
+ if (o->flags & TEST_FENCE_STRESS) {
+ igt_skip_on(!is_i915_device(drm_fd));
modifier = I915_FORMAT_MOD_X_TILED;
+ }
/* 256 MB is usually the maximum mappable aperture,
* (make it 4x times that to ensure failure) */
@@ -1557,9 +1561,10 @@ static int run_test(int duration, int flags)
struct test_output o;
int i, n, modes = 0;
- igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd));
+ igt_require((flags & TEST_HANG) == 0 ||
+ (is_i915_device(drm_fd) && !is_wedged(drm_fd)));
igt_require(!(flags & TEST_FENCE_STRESS) ||
- gem_available_fences(drm_fd));
+ (is_i915_device(drm_fd) && gem_available_fences(drm_fd)));
resources = drmModeGetResources(drm_fd);
igt_require(resources);
@@ -1626,9 +1631,10 @@ static int run_pair(int duration, int flags)
struct test_output o;
int i, j, m, n, modes = 0;
- igt_require((flags & TEST_HANG) == 0 || !is_wedged(drm_fd));
+ igt_require((flags & TEST_HANG) == 0 ||
+ (is_i915_device(drm_fd) && !is_wedged(drm_fd)));
igt_require(!(flags & TEST_FENCE_STRESS) ||
- gem_available_fences(drm_fd));
+ (is_i915_device(drm_fd) && gem_available_fences(drm_fd)));
resources = drmModeGetResources(drm_fd);
igt_require(resources);
@@ -1813,6 +1819,9 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
igt_install_exit_handler(kms_flip_exit_handler);
get_timestamp_format();
+ if (is_xe_device(drm_fd))
+ xe_device_get(drm_fd);
+
if (is_i915_device(drm_fd)) {
bops = buf_ops_create(drm_fd);
}
@@ -1878,6 +1887,10 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
}
igt_stop_signal_helper();
- igt_fixture
+ igt_fixture {
+ if (is_xe_device(drm_fd))
+ xe_device_put(drm_fd);
+
close(drm_fd);
+ }
}
--
2.40.0
More information about the Intel-gfx-trybot
mailing list