Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t 04/10] gem_wsim: Move BO allocation to a helper
Date: Wed, 17 Jun 2020 17:01:14 +0100	[thread overview]
Message-ID: <20200617160120.16555-5-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20200617160120.16555-1-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_wsim.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 60982cb73ba7..5893de38a98e 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -1472,6 +1472,11 @@ get_ctxid(struct workload *wrk, struct w_step *w)
 	return wrk->ctx_list[w->context].id;
 }
 
+static uint32_t alloc_bo(int i915, unsigned long size)
+{
+	return gem_create(i915, size);
+}
+
 static void
 alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags)
 {
@@ -1483,7 +1488,7 @@ alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags)
 	w->obj = calloc(nr_obj, sizeof(*w->obj));
 	igt_assert(w->obj);
 
-	w->obj[j].handle = gem_create(fd, 4096);
+	w->obj[j].handle = alloc_bo(fd, 4096);
 	w->obj[j].flags = EXEC_OBJECT_WRITE;
 	j++;
 	igt_assert(j < nr_obj);
@@ -1528,7 +1533,8 @@ alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags)
 	else
 		w->bb_sz = get_bb_sz(w, w->duration.max);
 
-	w->bb_handle = w->obj[j].handle = gem_create(fd, w->bb_sz + (w->unbound_duration ? 4096 : 0));
+	w->bb_handle = w->obj[j].handle =
+		alloc_bo(fd, w->bb_sz + (w->unbound_duration ? 4096 : 0));
 	init_bb(w, flags);
 	w->obj[j].relocation_count = terminate_bb(w, flags);
 
@@ -1685,7 +1691,7 @@ static void allocate_working_set(struct working_set *set)
 	igt_assert(set->handles);
 
 	for (i = 0; i < set->nr; i++)
-		set->handles[i] = gem_create(fd, set->sizes[i]);
+		set->handles[i] = alloc_bo(fd, set->sizes[i]);
 }
 
 #define alloca0(sz) ({ size_t sz__ = (sz); memset(alloca(sz__), 0, sz__); })
@@ -2323,7 +2329,7 @@ static unsigned long calibrate_nop(unsigned int tolerance_pct, struct intel_exec
 	do {
 		struct timespec t_start;
 
-		obj.handle = gem_create(fd, size);
+		obj.handle = alloc_bo(fd, size);
 		gem_write(fd, obj.handle, size - sizeof(bbe), &bbe,
 			  sizeof(bbe));
 		gem_execbuf(fd, &eb);
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-06-17 16:01 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17 16:01 [Intel-gfx] [PATCH i-g-t 00/10] gem_wsim improvements Tvrtko Ursulin
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 01/10] gem_wsim: Rip out userspace balancing Tvrtko Ursulin
2020-06-17 16:07   ` Chris Wilson
2020-06-18  7:14   ` Chris Wilson
2020-06-18  7:40     ` Tvrtko Ursulin
2020-06-18  7:55       ` Chris Wilson
2020-06-18 10:03         ` Tvrtko Ursulin
2020-06-18 10:05           ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 02/10] gem_wsim: Buffer objects working sets and complex dependencies Tvrtko Ursulin
2020-06-17 16:57   ` Chris Wilson
2020-06-18  9:05     ` Tvrtko Ursulin
2020-06-18  9:22       ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 03/10] gem_wsim: Show workload timing stats Tvrtko Ursulin
2020-06-17 16:58   ` Chris Wilson
2020-06-18  7:46     ` Tvrtko Ursulin
2020-06-18  7:57       ` Chris Wilson
2020-06-17 16:01 ` Tvrtko Ursulin [this message]
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 05/10] gem_wsim: Support random buffer sizes Tvrtko Ursulin
2020-06-17 16:31   ` Chris Wilson
2020-06-18  8:06     ` Tvrtko Ursulin
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 06/10] gem_wsim: Support scaling workload batch durations Tvrtko Ursulin
2020-06-17 16:22   ` Chris Wilson
2020-06-18  8:01     ` Tvrtko Ursulin
2020-06-18  8:07       ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 07/10] gem_wsim: Log max and active working set sizes in verbose mode Tvrtko Ursulin
2020-06-17 17:07   ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 08/10] gem_wsim: Snippet of a workload extracted from carchase Tvrtko Ursulin
2020-06-17 17:45   ` Chris Wilson
2020-06-18  7:53     ` Tvrtko Ursulin
2020-06-18  8:02       ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 09/10] gem_wsim: Implement device selection Tvrtko Ursulin
2020-06-17 17:09   ` Chris Wilson
2020-06-17 16:01 ` [Intel-gfx] [PATCH i-g-t 10/10] gem_wsim: Fix calibration handling Tvrtko Ursulin

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=20200617160120.16555-5-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@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