From: "José Roberto de Souza" <jose.souza@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "José Roberto de Souza" <jose.souza@intel.com>
Subject: [PATCH i-g-t 2/2] tests/i915: Add test for DRM_I915_QUERY_GUC_SUBMISSION_VERSION
Date: Wed, 14 Feb 2024 09:13:19 -0800 [thread overview]
Message-ID: <20240214171319.148482-2-jose.souza@intel.com> (raw)
In-Reply-To: <20240214171319.148482-1-jose.souza@intel.com>
Test the new query uAPI to fetch GUC submission version.
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
tests/intel/i915_query.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tests/intel/i915_query.c b/tests/intel/i915_query.c
index e9cc49597..17671dd02 100644
--- a/tests/intel/i915_query.c
+++ b/tests/intel/i915_query.c
@@ -121,6 +121,10 @@
* SUBTEST: test-query-geometry-subslices
* Description: Test DRM_I915_QUERY_GEOMETRY_SUBSLICES query
* Feature: gem_core
+ *
+ * SUBTEST: guc_submission_version
+ * Description: Test DRM_I915_QUERY_GUC_SUBMISSION_VERSION query"
+ * Feature: gem_core
*/
IGT_TEST_DESCRIPTION("Testing the i915 query uAPI.");
@@ -1473,6 +1477,28 @@ static void query_parse_and_validate_hwconfig_table(int i915)
free(data);
}
+static void
+query_guc_submission_version(int fd)
+{
+ struct drm_i915_query_guc_submission_version *guc_submission_ver;
+ struct drm_i915_query_item item = {};
+
+ item.query_id = DRM_I915_QUERY_GUC_SUBMISSION_VERSION;
+ i915_query_items(fd, &item, 1);
+ if (item.length < 0) {
+ igt_skip_on_f(item.length == -ENODEV, "GuC submission not enabled\n");
+ igt_skip_on_f(item.length == -EINVAL, "Query not supported by this i915 version\n");
+ }
+
+ guc_submission_ver = calloc(1, item.length);
+ igt_assert(guc_submission_ver);
+ item.data_ptr = to_user_pointer(guc_submission_ver);
+ i915_query_items(fd, &item, 1);
+
+ igt_assert(guc_submission_ver->major > 0 || guc_submission_ver->branch > 0);
+ free(guc_submission_ver);
+}
+
igt_main
{
int fd = -1;
@@ -1570,6 +1596,10 @@ igt_main
igt_subtest("hwconfig_table")
query_parse_and_validate_hwconfig_table(fd);
+ igt_describe("Test DRM_I915_QUERY_GUC_SUBMISSION_VERSION query");
+ igt_subtest("guc_submission_version")
+ query_guc_submission_version(fd);
+
igt_fixture {
drm_close_driver(fd);
}
--
2.43.1
next prev parent reply other threads:[~2024-02-14 17:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 17:13 [PATCH i-g-t 1/2] drm-uapi/i915_drm: sync with drm-intel-gt-next José Roberto de Souza
2024-02-14 17:13 ` José Roberto de Souza [this message]
2024-02-14 17:49 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] " Patchwork
2024-02-14 18:05 ` ✓ Fi.CI.BAT: " Patchwork
2024-02-15 0:25 ` ✗ 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=20240214171319.148482-2-jose.souza@intel.com \
--to=jose.souza@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