From: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Upadhyay <tejas.upadhyay@intel.com>
Subject: [igt-dev] [PATCH i-g-t v9 4/4] tests/xe/xe_sysfs_tile: adds new test to verify per tile vram addr_range
Date: Mon, 10 Jul 2023 10:13:30 +0530 [thread overview]
Message-ID: <20230710044330.770948-5-himal.prasad.ghimiray@intel.com> (raw)
In-Reply-To: <20230710044330.770948-1-himal.prasad.ghimiray@intel.com>
For each tile the test reads the sysfs entry physical_vram_size_bytes
and compares the value with vram size exposed from query ioctl.
v2:
- Change sysfs entry name. (Tejas)
- Change test name to xe_sysfs_tile_prop. (Rahul)
v3:
- Rectify assertion condition.
v4:
- use igt_assert_lt_u64 instead of igt_assert_lt
for comparing u64.
v5:
- update xe_for_each_tile call.
v6:
- Rename testcase to xe_sysfs_tile
- Pass tilefd and use it in igt_sysfs_scanf. (Ashutosh)
v7:
- Use for_each_sysfs_tile_dirfd instead of xe_for_each_tile.
Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com>
Cc: Upadhyay <tejas.upadhyay@intel.com>
Cc: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
---
tests/meson.build | 1 +
tests/xe/xe_sysfs_tile.c | 55 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+)
create mode 100644 tests/xe/xe_sysfs_tile.c
diff --git a/tests/meson.build b/tests/meson.build
index ee066b849..0567449bf 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -268,6 +268,7 @@ xe_progs = [
'xe_pm',
'xe_prime_self_import',
'xe_query',
+ 'xe_sysfs_tile',
'xe_vm',
'xe_waitfence',
'xe_spin_batch',
diff --git a/tests/xe/xe_sysfs_tile.c b/tests/xe/xe_sysfs_tile.c
new file mode 100644
index 000000000..c4c3f5446
--- /dev/null
+++ b/tests/xe/xe_sysfs_tile.c
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+
+/**
+ * TEST: Verify physical_vram_size_bytes of each tiles
+ * SUBTEST: physical_vram_size_bytes
+ * Description:
+ * Read sysfs entry for physical_vram_size_bytes and compare with
+ * vram size. physical_vram_size_bytes should be more than vram size.
+ */
+
+#include <string.h>
+#include <sys/time.h>
+
+#include "igt.h"
+#include "igt_sysfs.h"
+
+#include "xe_drm.h"
+#include "xe/xe_ioctl.h"
+#include "xe/xe_query.h"
+
+static void test_vram_physical_vram_size_bytes(int tile_fd, int tile_num, u64 vram_size)
+{
+ u64 physical_vram_size_bytes;
+
+ igt_assert(igt_sysfs_scanf(tile_fd, "physical_vram_size_bytes",
+ "%lx", &physical_vram_size_bytes) > 0);
+ igt_assert_lt_u64(vram_size, physical_vram_size_bytes);
+}
+
+igt_main
+{
+ int fd, tilefd, tile;
+ u64 vram_size;
+
+ igt_fixture {
+ fd = drm_open_driver(DRIVER_XE);
+ xe_device_get(fd);
+ }
+
+ igt_subtest("physical_vram_size_bytes") {
+ igt_require(xe_has_vram(fd));
+ for_each_sysfs_tile_dirfd(fd, tilefd, tile) {
+ vram_size = xe_vram_size(fd, tile);
+ test_vram_physical_vram_size_bytes(tilefd, tile, vram_size);
+ }
+ }
+
+ igt_fixture {
+ xe_device_put(fd);
+ close(fd);
+ }
+}
--
2.25.1
next prev parent reply other threads:[~2023-07-10 4:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 4:43 [igt-dev] [PATCH i-g-t v9 0/4] Handle GT and tile seperation in IGT Himal Prasad Ghimiray
2023-07-10 4:43 ` [igt-dev] [PATCH i-g-t v9 1/4] lib/igt_sysfs: Add support to query number of tiles Himal Prasad Ghimiray
2023-07-10 6:34 ` Dixit, Ashutosh
2023-07-10 4:43 ` [igt-dev] [PATCH i-g-t v9 2/4] lib/igt_sysfs: Handling gt related sysfs uapi changes Himal Prasad Ghimiray
2023-07-10 6:35 ` Dixit, Ashutosh
2023-07-10 4:43 ` [igt-dev] [PATCH i-g-t v9 3/4] tests/xe/xe_guc_pc: Change the sysfs paths Himal Prasad Ghimiray
2023-07-10 6:36 ` Dixit, Ashutosh
2023-07-10 4:43 ` Himal Prasad Ghimiray [this message]
2023-07-10 6:38 ` [igt-dev] [PATCH i-g-t v9 4/4] tests/xe/xe_sysfs_tile: adds new test to verify per tile vram addr_range Dixit, Ashutosh
2023-07-10 5:38 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle GT and tile seperation in IGT (rev8) Patchwork
2023-07-10 5:45 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-10 6:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-10 13:36 ` Kamil Konieczny
2023-07-11 7:40 ` Yedireswarapu, SaiX Nandan
2023-07-11 6:55 ` Patchwork
2023-07-11 7:29 ` [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=20230710044330.770948-5-himal.prasad.ghimiray@intel.com \
--to=himal.prasad.ghimiray@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=tejas.upadhyay@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