Thread (102 messages) 102 messages, 3 authors, 2021-08-06

Re: [igt-dev] [PATCH i-g-t v3 24/52] tests/gem_exec_parallel: Adopt to use alloctor

From: Dixit, Ashutosh <hidden>
Date: 2021-08-06 04:56:52

On Mon, 26 Jul 2021 12:59:58 -0700, Zbigniew Kempczyński wrote:
Reviewed-by: Ashutosh Dixit <redacted>

A couple of comments below.
quoted hunk ↗ jump to hunk
@@ -112,7 +116,7 @@ static void *thread(void *data)
reloc.delta = 4*t->id;
obj[1].handle = gem_create(fd, 4096);
obj[1].relocs_ptr = to_user_pointer(&reloc);
-	obj[1].relocation_count = 1;
+	obj[1].relocation_count = !t->ahnd ? 1 : 0;
gem_write(fd, obj[1].handle, 0, batch, sizeof(batch));

memset(&execbuf, 0, sizeof(execbuf));
@@ -140,6 +144,18 @@ static void *thread(void *data)
	if (t->flags & FDS)
		obj[0].handle = gem_open(fd, obj[0].handle);

+		if (t->ahnd) {
+			offset = t->offsets[x];
+			i = 0;
+			batch[++i] = offset + 4*t->id;
+			batch[++i] = offset >> 32;
+			obj[0].offset = offset;
+			obj[0].flags |= EXEC_OBJECT_PINNED | EXEC_OBJECT_WRITE;
+			obj[1].offset = get_offset(t->ahnd, obj[1].handle, 4096, 0);
+			obj[1].flags |= EXEC_OBJECT_PINNED;
+			gem_write(fd, obj[1].handle, 0, batch, sizeof(batch));
It was probably cleaner to eliminate the previous gem_write() above for
batch initialization, but I guess this works too.
quoted hunk ↗ jump to hunk
@@ -213,6 +229,7 @@ static void all(int fd, const intel_ctx_t *ctx,
void *arg[NUMOBJ];
int go;
int i;
+	uint64_t ahnd = get_reloc_ahnd(fd, 0), offsets[NUMOBJ];

if (flags & CONTEXTS)
When CONTEXTS flag is set it ahnd should probably be tied to the
context but here we have it tied to context 0, which is probably not
exactly correct but works?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help