Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: janga.rahul.kumar@intel.com
To: igt-dev@lists.freedesktop.org, ramadevi.gandi@intel.com,
	janga.rahul.kumar@intel.com
Subject: [igt-dev] [PATCH i-g-t] tests/intel/xe_vm : Validate tile mask
Date: Thu, 14 Sep 2023 15:51:56 +0530	[thread overview]
Message-ID: <20230914102156.412238-1-janga.rahul.kumar@intel.com> (raw)

From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>

Tile mask should be always less than or equal to tile count.

Cc: Stuart Summers <stuart.summers@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
---
 tests/intel/xe_vm.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index 4952ea786..3b11b8a68 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -10,6 +10,7 @@
  */
 
 #include "igt.h"
+#include "igt_sysfs.h"
 #include "lib/igt_syncobj.h"
 #include "lib/intel_reg.h"
 #include "xe_drm.h"
@@ -905,10 +906,11 @@ test_bind_array(int fd, struct drm_xe_engine_class_instance *eci, int n_execs,
 		uint64_t pad;
 		uint32_t data;
 	} *data;
-	int i, b;
+	int i, b, tile_count;
 
 	igt_assert(n_execs <= BIND_ARRAY_MAX_N_EXEC);
 
+	tile_count = xe_sysfs_get_num_tiles(fd);
 	vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
 	bo_size = sizeof(*data) * n_execs;
 	bo_size = ALIGN(bo_size + xe_cs_prefetch_size(fd),
@@ -928,6 +930,10 @@ test_bind_array(int fd, struct drm_xe_engine_class_instance *eci, int n_execs,
 		bind_ops[i].range = bo_size;
 		bind_ops[i].addr = addr;
 		bind_ops[i].tile_mask = 0x1 << eci->gt_id;
+
+		if (bind_ops[i].tile_mask >= tile_count)
+			bind_ops[i].tile_mask = tile_count - 1;
+
 		bind_ops[i].op = XE_VM_BIND_OP_MAP | XE_VM_BIND_FLAG_ASYNC;
 		bind_ops[i].region = 0;
 		bind_ops[i].reserved[0] = 0;
-- 
2.25.1

             reply	other threads:[~2023-09-14 10:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 10:21 janga.rahul.kumar [this message]
2023-09-14 13:31 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/intel/xe_vm : Validate tile mask Patchwork
2023-09-14 13:56 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-09-14 13:59 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-09-14 17:58 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-14 20:27 ` [igt-dev] [PATCH i-g-t] " Matt Roper
2023-09-15 14:11   ` Kumar, Janga Rahul

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=20230914102156.412238-1-janga.rahul.kumar@intel.com \
    --to=janga.rahul.kumar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=ramadevi.gandi@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