Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 01/17] tests/api_intel_allocator: Don't use allocator ahnd aliasing api
Date: Tue, 11 Jul 2023 13:19:53 +0200	[thread overview]
Message-ID: <20230711112009.122482-2-zbigniew.kempczynski@intel.com> (raw)
In-Reply-To: <20230711112009.122482-1-zbigniew.kempczynski@intel.com>

There's no tests (apart this one) which are using aliasing ahnd
- intel_allocator_open_vm_as(). Additionally it is problematic
on adopting allocator to xe where I need to track allocations
to support easy vm binding. Let's adopt "open-vm" to not to use
this api.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Reviewed-by: Karolina Stolarek <karolina.stolarek@intel.com>
---
 tests/i915/api_intel_allocator.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/tests/i915/api_intel_allocator.c b/tests/i915/api_intel_allocator.c
index b7e3efb87f..77c2d25e83 100644
--- a/tests/i915/api_intel_allocator.c
+++ b/tests/i915/api_intel_allocator.c
@@ -612,32 +612,27 @@ static void reopen_fork(int fd)
 
 static void open_vm(int fd)
 {
-	uint64_t ahnd[4], offset[4], size = 0x1000;
+	uint64_t ahnd[3], offset[3], size = 0x1000;
 	int i, n = ARRAY_SIZE(ahnd);
 
 	ahnd[0] = intel_allocator_open_vm(fd, 1, INTEL_ALLOCATOR_SIMPLE);
 	ahnd[1] = intel_allocator_open_vm(fd, 1, INTEL_ALLOCATOR_SIMPLE);
-	ahnd[2] = intel_allocator_open_vm_as(ahnd[1], 2);
-	ahnd[3] = intel_allocator_open(fd, 3, INTEL_ALLOCATOR_SIMPLE);
+	ahnd[2] = intel_allocator_open(fd, 2, INTEL_ALLOCATOR_SIMPLE);
 
 	offset[0] = intel_allocator_alloc(ahnd[0], 1, size, 0);
 	offset[1] = intel_allocator_alloc(ahnd[1], 2, size, 0);
 	igt_assert(offset[0] != offset[1]);
 
-	offset[2] = intel_allocator_alloc(ahnd[2], 3, size, 0);
-	igt_assert(offset[0] != offset[2] && offset[1] != offset[2]);
-
-	offset[3] = intel_allocator_alloc(ahnd[3], 1, size, 0);
-	igt_assert(offset[0] == offset[3]);
+	offset[2] = intel_allocator_alloc(ahnd[2], 1, size, 0);
+	igt_assert(offset[0] == offset[2]);
 
 	/*
-	 * As ahnd[0-2] lead to same allocator check can we free all handles
+	 * As ahnd[0-1] lead to same allocator check we can free all handles
 	 * using selected ahnd.
 	 */
-	intel_allocator_free(ahnd[0], 1);
-	intel_allocator_free(ahnd[0], 2);
-	intel_allocator_free(ahnd[0], 3);
-	intel_allocator_free(ahnd[3], 1);
+	igt_assert_eq(intel_allocator_free(ahnd[0], 1), true);
+	igt_assert_eq(intel_allocator_free(ahnd[1], 2), true);
+	igt_assert_eq(intel_allocator_free(ahnd[2], 1), true);
 
 	for (i = 0; i < n - 1; i++)
 		igt_assert_eq(intel_allocator_close(ahnd[i]), (i == n - 2));
-- 
2.34.1

  reply	other threads:[~2023-07-11 11:20 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 11:19 [igt-dev] [PATCH i-g-t v3 00/17] Extend intel_blt to work on Xe Zbigniew Kempczyński
2023-07-11 11:19 ` Zbigniew Kempczyński [this message]
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 02/17] lib/intel_allocator: Drop aliasing allocator handle api Zbigniew Kempczyński
2023-07-12  7:27   ` Karolina Stolarek
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 03/17] lib/intel_allocator: Remove extensive debugging Zbigniew Kempczyński
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 04/17] lib/xe_ioctl: Export non-assert xe_exec function Zbigniew Kempczyński
2023-07-12  7:33   ` Karolina Stolarek
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 05/17] lib/xe_query: Use vramN when returning string region name Zbigniew Kempczyński
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 06/17] lib/xe_query: Add xe_region_class() helper Zbigniew Kempczyński
2023-07-11 11:19 ` [igt-dev] [PATCH i-g-t v3 07/17] lib/drmtest: Add get_intel_driver() helper Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 08/17] lib/xe_util: Return dynamic subtest name for Xe Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 09/17] lib/xe_util: Add vm bind/unbind helper " Zbigniew Kempczyński
2023-07-12  8:00   ` Karolina Stolarek
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 10/17] lib/intel_allocator: Add intel_allocator_bind() Zbigniew Kempczyński
2023-07-12  9:13   ` Karolina Stolarek
2023-07-12  9:33     ` Zbigniew Kempczyński
2023-07-12 10:39       ` Karolina Stolarek
2023-07-12 17:03         ` Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 11/17] lib/intel_ctx: Add xe context information Zbigniew Kempczyński
2023-07-12  9:14   ` Karolina Stolarek
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 12/17] lib/intel_blt: Introduce blt_copy_init() helper to cache driver Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 13/17] lib/intel_blt: Extend blitter library to support xe driver Zbigniew Kempczyński
2023-07-12  9:22   ` Karolina Stolarek
2023-07-12  9:43     ` Zbigniew Kempczyński
2023-07-12 10:22       ` Karolina Stolarek
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 14/17] tests/xe_ccs: Check if flatccs is working with block-copy for Xe Zbigniew Kempczyński
2023-07-12 10:02   ` Karolina Stolarek
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 15/17] tests/xe_exercise_blt: Check blitter library fast-copy " Zbigniew Kempczyński
2023-07-12 10:18   ` Karolina Stolarek
2023-07-12 17:05     ` Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 16/17] tests/api-intel-allocator: Adopt to exercise allocator to Xe Zbigniew Kempczyński
2023-07-11 11:20 ` [igt-dev] [PATCH i-g-t v3 17/17] tests/gem_ccs: Avoid writing png twice Zbigniew Kempczyński
2023-07-12  9:24   ` Karolina Stolarek
2023-07-11 11:40 ` [igt-dev] ✗ GitLab.Pipeline: warning for Extend intel_blt to work on Xe (rev3) Patchwork
2023-07-11 12:09 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-11 12:10 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-07-11 14:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-12  8:14   ` Zbigniew Kempczyński
2023-07-14  4:56     ` Yedireswarapu, SaiX Nandan
2023-07-14  4:48 ` [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=20230711112009.122482-2-zbigniew.kempczynski@intel.com \
    --to=zbigniew.kempczynski@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