Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v5 5/6] tests/xe/query: extend for CPU visible accounting
Date: Mon, 24 Jul 2023 15:16:01 +0100	[thread overview]
Message-ID: <20230724141602.47733-6-matthew.auld@intel.com> (raw)
In-Reply-To: <20230724141602.47733-1-matthew.auld@intel.com>

Print the visible size and how much is used. Also sanity check the
values.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
---
 tests/xe/xe_query.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/xe/xe_query.c b/tests/xe/xe_query.c
index beee12ef9..47aa98a8f 100644
--- a/tests/xe/xe_query.c
+++ b/tests/xe/xe_query.c
@@ -230,6 +230,23 @@ test_query_mem_usage(int fd)
 		igt_info("min_page_size=0x%x, max_page_size=0x%x\n",
 		       mem_usage->regions[i].min_page_size,
 		       mem_usage->regions[i].max_page_size);
+
+		igt_info("visible size=%lluMiB\n",
+			 mem_usage->regions[i].cpu_visible_size >> 20);
+		igt_info("visible used=%lluMiB\n",
+			 mem_usage->regions[i].cpu_visible_used >> 20);
+
+		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_size,
+				   mem_usage->regions[i].total_size);
+		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_used,
+				   mem_usage->regions[i].cpu_visible_size);
+		igt_assert_lte_u64(mem_usage->regions[i].cpu_visible_used,
+				   mem_usage->regions[i].used);
+		igt_assert_lte_u64(mem_usage->regions[i].used,
+				   mem_usage->regions[i].total_size);
+		igt_assert_lte_u64(mem_usage->regions[i].used -
+				   mem_usage->regions[i].cpu_visible_used,
+				   mem_usage->regions[i].total_size);
 	}
 	dump_hex_debug(mem_usage, query.size);
 	free(mem_usage);
-- 
2.41.0

  parent reply	other threads:[~2023-07-24 14:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 14:15 [igt-dev] [PATCH i-g-t v5 0/6] IGT bits for small-bar Matthew Auld
2023-07-24 14:15 ` [igt-dev] [PATCH i-g-t v5 1/6] xe: sync small-bar uapi Matthew Auld
2023-07-24 14:15 ` [igt-dev] [PATCH i-g-t v5 2/6] lib/xe: add visible vram helpers Matthew Auld
2023-07-24 14:15 ` [igt-dev] [PATCH i-g-t v5 3/6] lib/xe: handle small-bar systems Matthew Auld
2023-07-24 14:16 ` [igt-dev] [PATCH i-g-t v5 4/6] tests/xe: " Matthew Auld
2023-07-24 14:16 ` Matthew Auld [this message]
2023-07-24 14:16 ` [igt-dev] [PATCH i-g-t v5 6/6] tests/xe/mmap: sanity check small-bar Matthew Auld
2023-07-24 15:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for IGT bits for small-bar (rev8) Patchwork
2023-07-25 10:37 ` [igt-dev] ✗ Fi.CI.BAT: failure for IGT bits for small-bar (rev9) Patchwork
2023-07-25 16:49 ` [igt-dev] ✓ Fi.CI.BAT: success for IGT bits for small-bar (rev10) Patchwork
2023-07-25 23:00 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20230724141602.47733-6-matthew.auld@intel.com \
    --to=matthew.auld@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