From: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/i915/gem_ctx_shared: Use gem_mmap__device_coherent_sync api
Date: Tue, 18 Feb 2020 05:47:10 +0530 [thread overview]
Message-ID: <20200218001710.16537-3-sreedhar.telukuntla@intel.com> (raw)
In-Reply-To: <20200218001710.16537-1-sreedhar.telukuntla@intel.com>
Replace the existing gem_mmap__device_coherent and gem_set_domain
calls with the new api gem_mmap__device_coherent_sync which takes
care of setting the appropriate memory domain along with memory mapping
Signed-off-by: Sreedhar Telukuntla <sreedhar.telukuntla@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
tests/i915/gem_ctx_shared.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/tests/i915/gem_ctx_shared.c b/tests/i915/gem_ctx_shared.c
index 820b96c1..d7d86bc5 100644
--- a/tests/i915/gem_ctx_shared.c
+++ b/tests/i915/gem_ctx_shared.c
@@ -214,9 +214,8 @@ static void exec_shared_gtt(int i915, unsigned int ring)
gem_close(i915, scratch);
scratch = gem_create(i915, 4096);
- s = gem_mmap__wc(i915, scratch, 0, 4096, PROT_WRITE);
+ s = gem_mmap__device_coherent_sync(i915, scratch, 0, 4096, PROT_WRITE);
- gem_set_domain(i915, scratch, I915_GEM_DOMAIN_WC, I915_GEM_DOMAIN_WC);
s[0] = bbe;
s[64] = bbe;
@@ -605,9 +604,7 @@ static void independent(int i915, unsigned ring, unsigned flags)
for (int i = 0; i < ARRAY_SIZE(priorities); i++) {
uint32_t *ptr;
- ptr = gem_mmap__device_coherent(i915, handle[i], 0, 4096, PROT_READ);
- gem_set_domain(i915, handle[i], /* no write hazard lies! */
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ ptr = gem_mmap__device_coherent_sync(i915, handle[i], 0, 4096, PROT_READ);
gem_close(i915, handle[i]);
handle[i] = ptr[TIMESTAMP];
@@ -650,9 +647,7 @@ static void reorder(int i915, unsigned ring, unsigned flags)
gem_context_destroy(i915, ctx[LO]);
gem_context_destroy(i915, ctx[HI]);
- ptr = gem_mmap__device_coherent(i915, scratch, 0, 4096, PROT_READ);
- gem_set_domain(i915, scratch, /* no write hazard lies! */
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ ptr = gem_mmap__device_coherent_sync(i915, scratch, 0, 4096, PROT_READ);
gem_close(i915, scratch);
if (flags & EQUAL) /* equal priority, result will be fifo */
@@ -705,17 +700,13 @@ static void promotion(int i915, unsigned ring)
gem_context_destroy(i915, ctx[LO]);
gem_context_destroy(i915, ctx[HI]);
- ptr = gem_mmap__device_coherent(i915, dep, 0, 4096, PROT_READ);
- gem_set_domain(i915, dep, /* no write hazard lies! */
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ ptr = gem_mmap__device_coherent_sync(i915, dep, 0, 4096, PROT_READ);
gem_close(i915, dep);
igt_assert_eq_u32(ptr[0], ctx[HI]);
munmap(ptr, 4096);
- ptr = gem_mmap__device_coherent(i915, result, 0, 4096, PROT_READ);
- gem_set_domain(i915, result, /* no write hazard lies! */
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ ptr = gem_mmap__device_coherent_sync(i915, result, 0, 4096, PROT_READ);
gem_close(i915, result);
igt_assert_eq_u32(ptr[0], ctx[NOISE]);
@@ -768,9 +759,7 @@ static void smoketest(int i915, unsigned ring, unsigned timeout)
}
igt_waitchildren();
- ptr = gem_mmap__device_coherent(i915, scratch, 0, 4096, PROT_READ);
- gem_set_domain(i915, scratch, /* no write hazard lies! */
- I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
+ ptr = gem_mmap__device_coherent_sync(i915, scratch, 0, 4096, PROT_READ);
gem_close(i915, scratch);
for (unsigned n = 0; n < ncpus; n++) {
--
2.24.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-02-17 16:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-18 0:17 [igt-dev] [PATCH i-g-t 0/2] Introduce new apis for coherent mmap Sreedhar Telukuntla
2020-02-17 19:56 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-02-18 0:17 ` [igt-dev] [PATCH i-g-t 1/2] lib/i915/gem_mman: Add coherent mmap api support with set domain Sreedhar Telukuntla
2020-02-17 16:29 ` Chris Wilson
2020-02-18 3:53 ` Telukuntla, Sreedhar
2020-02-28 11:06 ` Tvrtko Ursulin
2020-02-18 0:17 ` Sreedhar Telukuntla [this message]
2020-02-19 11:02 ` [igt-dev] ✗ Fi.CI.IGT: failure for Introduce new apis for coherent mmap 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=20200218001710.16537-3-sreedhar.telukuntla@intel.com \
--to=sreedhar.telukuntla@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@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