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
Cc: lucas.demarchi@intel.com
Subject: [igt-dev] [PATCH i-g-t] tests/intel/xe_vm: Correct stride to avoid address range collision
Date: Thu,  9 Nov 2023 13:46:16 +0530	[thread overview]
Message-ID: <20231109081616.912332-1-janga.rahul.kumar@intel.com> (raw)

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

For XE2, the minimum page size for both VRAM and system memory is only 4K.

Minimum page size was used as the address stride, which is 4K.
When attempting to bind a 4K range, consecutive VM BIND IOCTL calls
resulted in a range collision. Update stride based on bo size.

v2: Address review comments (Karolina)

Cc: Karolina Stolarek <karolina.stolarek@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
---
 tests/intel/xe_vm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
index eeb49122a..f1ccd6c21 100644
--- a/tests/intel/xe_vm.c
+++ b/tests/intel/xe_vm.c
@@ -417,6 +417,9 @@ shared_pte_page(int fd, struct drm_xe_engine_class_instance *eci, int n_bo,
 	bo_size = ALIGN(bo_size + xe_cs_prefetch_size(fd),
 			xe_get_default_alignment(fd));
 
+	if (addr_stride <= bo_size)
+		addr_stride = addr_stride + bo_size;
+
 	for (i = 0; i < n_bo; ++i) {
 		bo[i] = xe_bo_create_flags(fd, vm, bo_size,
 					   visible_vram_if_possible(fd, eci->gt_id));
-- 
2.25.1

             reply	other threads:[~2023-11-09  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-09  8:16 janga.rahul.kumar [this message]
2023-11-09  8:58 ` [igt-dev] [PATCH i-g-t] tests/intel/xe_vm: Correct stride to avoid address range collision Karolina Stolarek
2023-11-09  8:59 ` [igt-dev] ✓ CI.xeBAT: success for tests/intel/xe_vm: Correct stride to avoid address range collision (rev2) Patchwork
2023-11-09  9:04 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-11-09 17:26 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-11-07  8:30 [igt-dev] [PATCH i-g-t] tests/intel/xe_vm: Correct stride to avoid address range collision janga.rahul.kumar
2023-11-07 10:30 ` Karolina Stolarek
2023-11-09  8:15   ` 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=20231109081616.912332-1-janga.rahul.kumar@intel.com \
    --to=janga.rahul.kumar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --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