From: "Jouni Högander" <jouni.hogander@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Subject: [igt-dev] [PATCH i-g-t v6 3/4] lib/xe/xe_spin: Handle spinner timer for Xe as well
Date: Thu, 22 Jun 2023 08:45:42 +0300 [thread overview]
Message-ID: <20230622054543.3360732-4-jouni.hogander@intel.com> (raw)
In-Reply-To: <20230622054543.3360732-1-jouni.hogander@intel.com>
Current spinner implementation for Xe doesn't support setting
timeout. Fix this by handling timers same way as for i915 as well.
Cc: Sai Gowtham Ch <sai.gowtham.ch@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
lib/xe/xe_spin.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
index 9f511e14f..d8c665f39 100644
--- a/lib/xe/xe_spin.c
+++ b/lib/xe/xe_spin.c
@@ -115,6 +115,7 @@ xe_spin_create(int fd, const struct igt_spin_factory *opt)
spin->syncobj = syncobj_create(fd, 0);
spin->vm = opt->vm;
spin->engine = opt->engine;
+ spin->timerfd = -1;
if (!spin->vm)
spin->vm = xe_vm_create(fd, 0, 0);
@@ -163,6 +164,13 @@ void xe_spin_sync_wait(int fd, struct igt_spin *spin)
void xe_spin_free(int fd, struct igt_spin *spin)
{
igt_assert(spin->driver == INTEL_DRIVER_XE);
+
+ if (spin->timerfd >= 0) {
+ pthread_cancel(spin->timer_thread);
+ igt_assert(pthread_join(spin->timer_thread, NULL) == 0);
+ close(spin->timerfd);
+ }
+
xe_spin_end(spin->xe_spin);
xe_spin_sync_wait(fd, spin);
xe_vm_unbind_sync(fd, spin->vm, 0, spin->address, spin->bo_size);
--
2.34.1
next prev parent reply other threads:[~2023-06-22 5:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 5:45 [igt-dev] [PATCH i-g-t v6 0/4] Testcases for dirtyfb ioctl Jouni Högander
2023-06-22 5:45 ` [igt-dev] [PATCH i-g-t v6 1/4] tests/i915/kms_frontbuffer_tracking: Split fbc into library Jouni Högander
2023-07-31 14:32 ` [igt-dev] [i-g-t, v6, " Joshi, Kunal1
2023-06-22 5:45 ` [igt-dev] [PATCH i-g-t v6 2/4] tests/i915/kms_frontbuffer_tracking: Split drrs " Jouni Högander
2023-07-31 14:34 ` [igt-dev] [i-g-t, v6, " Joshi, Kunal1
2023-06-22 5:45 ` Jouni Högander [this message]
2023-07-28 10:09 ` [igt-dev] [PATCH i-g-t v6 3/4] lib/xe/xe_spin: Handle spinner timer for Xe as well Ch, Sai Gowtham
2023-06-22 5:45 ` [igt-dev] [PATCH i-g-t v6 4/4] tests/kms_dirtyfb: Add new test for dirtyfb ioctl Jouni Högander
2023-08-07 8:13 ` [igt-dev] [i-g-t, v6, " Joshi, Kunal1
2023-06-22 6:36 ` [igt-dev] ✓ Fi.CI.BAT: success for Testcases for dirtyfb ioctl (rev8) Patchwork
2023-06-22 14:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-08 10:36 ` [igt-dev] [PATCH i-g-t v6 0/4] Testcases for dirtyfb ioctl Hogander, Jouni
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=20230622054543.3360732-4-jouni.hogander@intel.com \
--to=jouni.hogander@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sai.gowtham.ch@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