From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [i-g-t V4 13/20] tests/i915/kms_ccs: Add XE support
Date: Wed, 16 Aug 2023 22:01:59 +0530 [thread overview]
Message-ID: <20230816163206.402705-14-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230816163206.402705-1-bhanuprakash.modem@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)
V2: - Update XE blocklist
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
tests/i915/kms_ccs.c | 42 ++++++++++++++++++++-------------
tests/intel-ci/xe.blocklist.txt | 1 -
2 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/tests/i915/kms_ccs.c b/tests/i915/kms_ccs.c
index 976aedb06..4a0f024dd 100644
--- a/tests/i915/kms_ccs.c
+++ b/tests/i915/kms_ccs.c
@@ -32,6 +32,7 @@
#include "igt.h"
#include "i915/gem_create.h"
+#include "xe/xe_ioctl.h"
/**
* SUBTEST: %s-%s-%s
@@ -313,17 +314,19 @@ static void check_ccs_plane(int drm_fd, igt_fb_t *fb, int plane)
ccs_size = fb->strides[plane] * fb->plane_height[plane];
igt_assert(ccs_size);
- gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, 0);
-
- map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_READ);
-
+ if (is_i915_device(drm_fd)) {
+ gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, 0);
+ map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_READ);
+ } else {
+ map = xe_bo_mmap_ext(drm_fd, fb->gem_handle, fb->size, PROT_READ);
+ }
ccs_size = fb->strides[plane] * fb->plane_height[plane];
ccs_p = map + fb->offsets[plane];
for (i = 0; i < ccs_size; i += sizeof(uint32_t))
if (*(uint32_t *)(ccs_p + i))
break;
- munmap(map, fb->size);
+ igt_assert(gem_munmap(map, fb->size) == 0);
igt_assert_f(i < ccs_size,
"CCS plane %d (for main plane %d) lacks compression meta-data\n",
@@ -339,9 +342,12 @@ static void check_ccs_cc_plane(int drm_fd, igt_fb_t *fb, int plane, const float
void *map;
uint32_t native_color;
- gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, 0);
-
- map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_READ);
+ if (is_i915_device(drm_fd)) {
+ gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, 0);
+ map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_READ);
+ } else {
+ map = xe_bo_mmap_ext(drm_fd, fb->gem_handle, fb->size, PROT_READ);
+ }
cc_p = map + fb->offsets[plane];
igt_assert(cc_color[0] == cc_p[0].f &&
@@ -356,7 +362,7 @@ static void check_ccs_cc_plane(int drm_fd, igt_fb_t *fb, int plane, const float
igt_assert(native_color == cc_p[4].d);
- munmap(map, fb->size);
+ igt_assert(gem_munmap(map, fb->size) == 0);
};
static void check_all_ccs_planes(int drm_fd, igt_fb_t *fb, const float *cc_color, bool check_cc_plane)
@@ -378,14 +384,17 @@ static void fill_fb_random(int drm_fd, igt_fb_t *fb)
uint8_t *p;
int i;
- gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
-
- p = map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_WRITE);
+ if (is_i915_device(drm_fd)) {
+ gem_set_domain(drm_fd, fb->gem_handle, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
+ p = map = gem_mmap__cpu(drm_fd, fb->gem_handle, 0, fb->size, PROT_WRITE);
+ } else {
+ p = map = xe_bo_mmap_ext(drm_fd, fb->gem_handle, fb->size, PROT_READ | PROT_WRITE);
+ }
for (i = 0; i < fb->size; i++)
p[i] = rand();
- munmap(map, fb->size);
+ igt_assert(gem_munmap(map, fb->size) == 0);
}
static void test_bad_ccs_plane(data_t *data, int width, int height, int ccs_plane,
@@ -493,8 +502,9 @@ static void fast_clear_fb(int drm_fd, struct igt_fb *fb, const float *cc_color)
struct buf_ops *bops = buf_ops_create(drm_fd);
struct intel_buf *dst = igt_fb_create_intel_buf(drm_fd, bops, fb, "fast clear dst");
- gem_set_domain(drm_fd, fb->gem_handle,
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ if (is_i915_device(drm_fd))
+ gem_set_domain(drm_fd, fb->gem_handle,
+ I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
fast_clear(ibb, dst, 0, 0, fb->width, fb->height, cc_color);
@@ -814,7 +824,7 @@ igt_main_args("cs:", NULL, help_str, opt_handler, &data)
enum pipe pipe;
igt_fixture {
- data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
+ data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
igt_require(intel_display_ver(intel_get_drm_devid(data.drm_fd)) >= 9);
kmstest_set_vt_graphics_mode();
diff --git a/tests/intel-ci/xe.blocklist.txt b/tests/intel-ci/xe.blocklist.txt
index ffba73e02..81599c778 100644
--- a/tests/intel-ci/xe.blocklist.txt
+++ b/tests/intel-ci/xe.blocklist.txt
@@ -56,7 +56,6 @@ igt@kms_bw@.*-(5|6|7|8)-displays-.*
igt@kms_draw_crc@draw-method-(mmap-cpu|mmap-gtt|pwrite)
igt@kms_pipe_b_c_ivb@.*
igt@kms_pwrite_crc
-igt@kms_ccs@.*
igt@kms_frontbuffer_tracking@.*
igt@kms_fbcon_fbt@(fbc|psr)(-suspend)
igt@kms_fence_pin_leak
--
2.40.0
next prev parent reply other threads:[~2023-08-16 16:40 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 16:31 [igt-dev] [i-g-t V4 00/20] Add XE suppor for display tests Bhanuprakash Modem
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 01/20] lib: Add tiling support for XE Bhanuprakash Modem
2023-08-23 13:54 ` [igt-dev] [i-g-t,V4,01/20] " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 02/20] tests/kms_cursor_edge_walk: Fix intel specific checks Bhanuprakash Modem
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 03/20] tests/kms_getfb: Extended ccs tests to support XE Bhanuprakash Modem
2023-08-17 8:29 ` Kamil Konieczny
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 04/20] tests/kms_addfb_basic: Add tiling support for XE Bhanuprakash Modem
2023-08-23 13:51 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 05/20] tests/kms_plane: " Bhanuprakash Modem
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 06/20] tests/kms_plane_lowres: " Bhanuprakash Modem
2023-08-18 8:27 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 07/20] tests/kms_plane_scaling: " Bhanuprakash Modem
2023-08-18 8:29 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 08/20] tests/kms_rotation_crc: " Bhanuprakash Modem
2023-08-18 8:32 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 09/20] tests/i915/kms_big_fb: " Bhanuprakash Modem
2023-08-18 8:33 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 10/20] tests/i915/kms_draw_crc: " Bhanuprakash Modem
2023-08-18 8:38 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 11/20] tests/i915/kms_flip_scaled_crc: " Bhanuprakash Modem
2023-08-18 8:40 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` [igt-dev] [i-g-t V4 12/20] tests/i915/kms_flip_tiling: " Bhanuprakash Modem
2023-08-18 8:41 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:31 ` Bhanuprakash Modem [this message]
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 14/20] tests/i915/kms_fb_coherancy: Add XE support Bhanuprakash Modem
2023-08-23 16:12 ` Kamil Konieczny
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 15/20] tests/i915/kms_fbcon_fbt: " Bhanuprakash Modem
2023-08-18 8:43 ` [igt-dev] [i-g-t, V4, " Joshi, Kunal1
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 16/20] tests/kms_async_flips: " Bhanuprakash Modem
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 17/20] tests/kms_prime: " Bhanuprakash Modem
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 18/20] tests/intel-ci: Update Xe ffb testlist & blocklist for kms_frontbuffer_tracking Bhanuprakash Modem
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 19/20] tests/intel-ci: Drop tiling tests from xe blocklist Bhanuprakash Modem
2023-08-16 16:32 ` [igt-dev] [i-g-t V4 20/20] HAX: Run tiling tests in XE fast-feedback Bhanuprakash Modem
2023-08-16 19:05 ` [igt-dev] ✓ Fi.CI.BAT: success for Add XE suppor for display tests (rev5) Patchwork
2023-08-16 20:12 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-17 3:28 ` [igt-dev] ✓ Fi.CI.IGT: 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=20230816163206.402705-14-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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