public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t 04/11] gem_wsim: Move BO allocation to a helper
Date: Thu, 18 Jun 2020 11:47:40 +0100	[thread overview]
Message-ID: <20200618104747.24005-4-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20200618104747.24005-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 dd0b2e260a5a..23b81d181df3 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -1490,6 +1490,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)
 {
@@ -1501,7 +1506,7 @@ alloc_step_batch(struct workload *wrk, struct w_step *w)
 	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);
@@ -1546,7 +1551,8 @@ alloc_step_batch(struct workload *wrk, struct w_step *w)
 	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);
 	w->obj[j].relocation_count = terminate_bb(w);
 
@@ -1703,7 +1709,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__); })
@@ -2339,7 +2345,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

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2020-06-18 10:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 10:47 [igt-dev] [PATCH i-g-t 01/11] gem_wsim: Rip out userspace balancing Tvrtko Ursulin
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 02/11] gem_wsim: Buffer objects working sets and complex dependencies Tvrtko Ursulin
2020-06-18 11:10   ` Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 03/11] gem_wsim: Show workload timing stats Tvrtko Ursulin
2020-06-18 11:11   ` Chris Wilson
2020-06-18 10:47 ` Tvrtko Ursulin [this message]
2020-06-18 11:11   ` [igt-dev] [PATCH i-g-t 04/11] gem_wsim: Move BO allocation to a helper Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 05/11] gem_wsim: Support random buffer sizes Tvrtko Ursulin
2020-06-18 11:12   ` [Intel-gfx] " Chris Wilson
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 06/11] gem_wsim: Support scaling workload batch durations Tvrtko Ursulin
2020-06-18 11:13   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 07/11] gem_wsim: Log max and active working set sizes in verbose mode Tvrtko Ursulin
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 08/11] gem_wsim: Snippet of a workload extracted from carchase Tvrtko Ursulin
2020-06-18 11:13   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 09/11] gem_wsim: Implement device selection Tvrtko Ursulin
2020-06-18 10:47 ` [Intel-gfx] [PATCH i-g-t 10/11] gem_wsim: Fix calibration handling Tvrtko Ursulin
2020-06-18 11:15   ` [igt-dev] " Chris Wilson
2020-06-18 10:47 ` [igt-dev] [PATCH i-g-t 11/11] gem_wsim: Do not keep batch mapped unless needed Tvrtko Ursulin
2020-06-18 10:56 ` [igt-dev] ✗ Fi.CI.BUILD: failure for series starting with [i-g-t,01/11] gem_wsim: Rip out userspace balancing Patchwork
2020-06-18 11:09 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 01/11] " Chris Wilson

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=20200618104747.24005-4-tvrtko.ursulin@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --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