Mesa (main): asahi: Allow specifying an encoder ID
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Jul 11 18:58:29 UTC 2021
Module: Mesa
Branch: main
Commit: 87c4a1855c7355a0c35fbb3dfe8e4fb073e36b53
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=87c4a1855c7355a0c35fbb3dfe8e4fb073e36b53
Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date: Sun Jul 11 13:17:30 2021 -0400
asahi: Allow specifying an encoder ID
Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11815>
---
src/gallium/drivers/asahi/agx_pipe.c | 6 +++++-
src/gallium/drivers/asahi/magic.c | 3 ++-
src/gallium/drivers/asahi/magic.h | 1 +
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c
index 304763114a9..b53a6eabf26 100644
--- a/src/gallium/drivers/asahi/agx_pipe.c
+++ b/src/gallium/drivers/asahi/agx_pipe.c
@@ -510,10 +510,14 @@ agx_flush(struct pipe_context *pctx,
/* Size calculation should've been exact */
assert(handle_i == handle_count);
+ unsigned cmdbuf_id = 0xDEADBEEF;
+ unsigned encoder_id = 0xCAFECAFE;
+
unsigned cmdbuf_size = demo_cmdbuf(dev->cmdbuf.ptr.cpu,
dev->cmdbuf.size,
&ctx->batch->pool,
ctx->batch->encoder->ptr.gpu,
+ encoder_id,
ctx->batch->scissor.bo->ptr.gpu,
ctx->batch->width,
ctx->batch->height,
@@ -525,7 +529,7 @@ agx_flush(struct pipe_context *pctx,
/* Generate the mapping table from the BO list */
demo_mem_map(dev->memmap.ptr.cpu, dev->memmap.size, handles, handle_count,
- 0xDEADBEEF, 0xCAFECAFE, cmdbuf_size);
+ cmdbuf_id, encoder_id, cmdbuf_size);
free(handles);
diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c
index 6d4b75f7bf8..91300cd6e35 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -79,6 +79,7 @@ unsigned
demo_cmdbuf(uint64_t *buf, size_t size,
struct agx_pool *pool,
uint64_t encoder_ptr,
+ uint64_t encoder_id,
uint64_t scissor_ptr,
unsigned width, unsigned height,
uint32_t pipeline_null,
@@ -186,7 +187,7 @@ demo_cmdbuf(uint64_t *buf, size_t size,
/* Compare compute case ,which has a bit of reordering, but we can swap */
EMIT32(cmdbuf, 0x1c); // 0x5a0
EMIT32(cmdbuf, 0);
- EMIT64(cmdbuf, 0xCAFECAFE); // encoder ID XXX: don't fix
+ EMIT64(cmdbuf, encoder_id);
EMIT32(cmdbuf, 0);
EMIT32(cmdbuf, 0xffffffff);
diff --git a/src/gallium/drivers/asahi/magic.h b/src/gallium/drivers/asahi/magic.h
index 429e7e232da..98215d367c9 100644
--- a/src/gallium/drivers/asahi/magic.h
+++ b/src/gallium/drivers/asahi/magic.h
@@ -28,6 +28,7 @@ unsigned
demo_cmdbuf(uint64_t *buf, size_t size,
struct agx_pool *pool,
uint64_t encoder_ptr,
+ uint64_t encoder_id,
uint64_t scissor_ptr,
unsigned width, unsigned height,
uint32_t pipeline_null,
More information about the mesa-commit
mailing list