From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 19/20] tests/i915/perf: Use engine_id in gen12_test_mi_rpc for xe
Date: Mon, 7 Aug 2023 18:00:16 -0700 [thread overview]
Message-ID: <20230808010017.37819-20-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20230808010017.37819-1-ashutosh.dixit@intel.com>
xe uapi needs an engine_id, not a gem context id.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
tests/i915/perf.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index cd1087b2e954..193b903799ce 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -45,6 +45,7 @@
#include "igt_perf.h"
#include "igt_sysfs.h"
#include "drm.h"
+#include "xe/xe_ioctl.h"
#include "xe/xe_query.h"
/**
@@ -3593,6 +3594,7 @@ gen12_test_mi_rpc(const struct intel_execution_engine2 *e)
struct intel_buf *buf;
#define INVALID_CTX_ID 0xffffffff
uint32_t ctx_id = INVALID_CTX_ID;
+ uint32_t vm = 0;
uint32_t *report32;
size_t format_size_32;
struct oa_format format = get_oa_format(fmt);
@@ -3601,11 +3603,16 @@ gen12_test_mi_rpc(const struct intel_execution_engine2 *e)
write_u64_file(i9xe.sysctl_path_paranoid, 1);
bops = buf_ops_create(drm_fd);
- ctx_id = gem_context_create(drm_fd);
+ if (is_xe_device(drm_fd)) {
+ vm = xe_vm_create(drm_fd, DRM_XE_VM_CREATE_ASYNC_BIND_OPS, 0);
+ ctx_id = xe_exec_queue_create(drm_fd, vm, xe_hw_engine(drm_fd, 0), 0);
+ } else {
+ ctx_id = gem_context_create(drm_fd);
+ }
igt_assert_neq(ctx_id, INVALID_CTX_ID);
properties[1] = ctx_id;
- ibb = intel_bb_create_with_context(drm_fd, ctx_id, 0, NULL, BATCH_SZ);
+ ibb = intel_bb_create_with_context(drm_fd, ctx_id, vm, NULL, BATCH_SZ);
buf = intel_buf_create(bops, 4096, 1, 8, 64,
I915_TILING_NONE, I915_COMPRESSION_NONE);
@@ -3650,7 +3657,12 @@ gen12_test_mi_rpc(const struct intel_execution_engine2 *e)
intel_buf_unmap(buf);
intel_buf_destroy(buf);
intel_bb_destroy(ibb);
- gem_context_destroy(drm_fd, ctx_id);
+ if (is_xe_device(drm_fd)) {
+ xe_exec_queue_destroy(drm_fd, ctx_id);
+ xe_vm_destroy(drm_fd, vm);
+ } else {
+ gem_context_destroy(drm_fd, ctx_id);
+ }
buf_ops_destroy(bops);
__perf_close(stream_fd);
}
--
2.41.0
next prev parent reply other threads:[~2023-08-08 1:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 0:59 [igt-dev] [PATCH i-g-t 00/20] Extend i915/perf for testing Xe OA Ashutosh Dixit
2023-08-08 0:59 ` [igt-dev] [PATCH i-g-t 01/20] drm-uapi/xe_drm: OA changes Ashutosh Dixit
2023-08-08 0:59 ` [igt-dev] [PATCH i-g-t 02/20] lib/xe/xe_query: Add xe_gts interface Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 03/20] lib/i915/perf: Add xe_perf_for_fd Ashutosh Dixit
2023-08-08 6:20 ` Zbigniew Kempczyński
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 04/20] lib/i915/perf: Derive topology info for xe devices Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 05/20] tests/i915/perf: Track variables across i915 and xe Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 06/20] tests/i915/perf: Skip not ready tests for xe Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 07/20] tests/i915/perf: Fix i915_perf_revision for use with xe Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 08/20] tests/i915/perf: Fix sysfs functions for xe Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 09/20] tests/i915/perf: Fix test_i915_ref_count " Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 10/20] tests/i915/perf: Support only default_engine_group " Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 11/20] tests/i915/perf: Only iterate over render engines " Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 12/20] tests/i915/perf: Don't load module Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 13/20] tests/i915/perf: Move test_sysctl_defaults after the fixture Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 14/20] tests/i915/perf: Fix has_class_instance for xe Ashutosh Dixit
2023-08-08 6:35 ` Zbigniew Kempczyński
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 15/20] tests/i915/perf: Temporarily skip render_copy " Ashutosh Dixit
2023-08-08 6:30 ` Zbigniew Kempczyński
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 16/20] tests/i915/perf: Skip intel_ctx_create_all_physical " Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 17/20] tests/i915/perf: Skip __for_each_render_engine " Ashutosh Dixit
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 18/20] tests/i915/perf: Fix buf_map " Ashutosh Dixit
2023-08-08 6:26 ` Zbigniew Kempczyński
2023-08-08 1:00 ` Ashutosh Dixit [this message]
2023-08-08 1:00 ` [igt-dev] [PATCH i-g-t 20/20] HAX: Add OA tests to xe-fast-feedback.testlist Ashutosh Dixit
2023-08-08 2:00 ` [igt-dev] ✓ Fi.CI.BAT: success for Extend i915/perf for testing Xe OA (rev2) Patchwork
2023-08-08 2:02 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-08 9:12 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2023-07-20 23:17 [igt-dev] [PATCH i-g-t 00/20] Extend i915/perf for testing Xe OA Ashutosh Dixit
2023-07-20 23:17 ` [igt-dev] [PATCH i-g-t 19/20] tests/i915/perf: Use engine_id in gen12_test_mi_rpc for xe Ashutosh Dixit
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=20230808010017.37819-20-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@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