From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org,
Andrzej Hajda <andrzej.hajda@intel.com>,
Nirmoy Das <nirmoy.das@intel.com>
Subject: [Intel-gfx] [PATCH i-g-t 3/4] tests/i915/query: sanity check reported GTT alignment
Date: Mon, 3 Oct 2022 18:24:55 +0100 [thread overview]
Message-ID: <20221003172456.97522-3-matthew.auld@intel.com> (raw)
In-Reply-To: <20221003172456.97522-1-matthew.auld@intel.com>
Ensure the kernel is reporting "normal" values here, based on our
current expectations.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
---
tests/i915/i915_query.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/i915/i915_query.c b/tests/i915/i915_query.c
index b92d7593..bff073d2 100644
--- a/tests/i915/i915_query.c
+++ b/tests/i915/i915_query.c
@@ -581,8 +581,6 @@ static void test_query_regions_garbage_items(int fd)
struct drm_i915_memory_region_info info = regions->regions[i];
int j;
- igt_assert_eq_u32(info.rsvd0, 0);
-
/*
* rsvd1[0] : probed_cpu_visible_size
* rsvd1[1] : unallocated_cpu_visible_size
@@ -640,6 +638,8 @@ static void upload(int fd, struct igt_list_head *handles, uint32_t num_handles)
free(exec);
}
+/** XXX: remove once we sync the uapi header */
+#define gtt_alignment rsvd0
static void test_query_regions_sanity_check(int fd)
{
struct drm_i915_query_memory_regions *regions;
@@ -666,6 +666,11 @@ static void test_query_regions_sanity_check(int fd)
struct drm_i915_gem_memory_class_instance r1 = info.region;
int j;
+ if (info.gtt_alignment) {
+ igt_assert_lte_u64(4096, info.gtt_alignment);
+ igt_assert(is_power_of_two(info.gtt_alignment));
+ }
+
if (r1.memory_class == I915_MEMORY_CLASS_SYSTEM) {
igt_assert_eq(r1.memory_instance, 0);
found_system = true;
@@ -676,6 +681,9 @@ static void test_query_regions_sanity_check(int fd)
igt_assert(info.unallocated_cpu_visible_size == 0 ||
info.unallocated_cpu_visible_size ==
info.unallocated_size);
+
+ igt_assert(info.gtt_alignment == 0 ||
+ info.gtt_alignment == 4096);
} else {
igt_assert(info.probed_cpu_visible_size <= info.probed_size);
igt_assert(info.unallocated_size <= info.probed_size);
--
2.37.3
next prev parent reply other threads:[~2022-10-03 17:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 17:24 [Intel-gfx] [PATCH i-g-t 1/4] i915_drm.h sync Matthew Auld
2022-10-03 17:24 ` [Intel-gfx] [PATCH i-g-t 2/4] tests/i915/query: fix igt_assert_eq_u32 Matthew Auld
2022-10-03 17:24 ` Matthew Auld [this message]
2022-10-04 10:51 ` [Intel-gfx] [PATCH i-g-t 3/4] tests/i915/query: sanity check reported GTT alignment Das, Nirmoy
2022-10-03 17:24 ` [Intel-gfx] [PATCH i-g-t 4/4] tests/i915/gem_create: add some basic testing for " Matthew Auld
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=20221003172456.97522-3-matthew.auld@intel.com \
--to=matthew.auld@intel.com \
--cc=andrzej.hajda@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=nirmoy.das@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