Mesa (main): asahi: Remove silly magic numbers
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Nov 18 23:46:49 UTC 2021
Module: Mesa
Branch: main
Commit: a28775046c1e9436303a5ff1a864e19dc6561fa0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a28775046c1e9436303a5ff1a864e19dc6561fa0
Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date: Sat Nov 13 14:25:47 2021 -0500
asahi: Remove silly magic numbers
These are unnecessary now that the structure of agx_map_* is better
understood.
Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13784>
---
src/gallium/drivers/asahi/magic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/asahi/magic.c b/src/gallium/drivers/asahi/magic.c
index feef9b3eaad..ed3ee08bd95 100644
--- a/src/gallium/drivers/asahi/magic.c
+++ b/src/gallium/drivers/asahi/magic.c
@@ -190,14 +190,14 @@ demo_mem_map(void *map, size_t size, unsigned *handles, unsigned count,
struct agx_map_entry *end = (struct agx_map_entry *) (((uint8_t *) map) + size);
/* Header precedes the entry */
- *header = demo_map_header(cmdbuf_id, encoder_id, cmdbuf_size, count + 1);
+ *header = demo_map_header(cmdbuf_id, encoder_id, cmdbuf_size, count);
/* Add an entry for each BO mapped */
- for (unsigned i = 0; i < count + 1; ++i) {
+ for (unsigned i = 0; i < count; ++i) {
assert((entries + i) < end);
entries[i] = (struct agx_map_entry) {
- .indices = {(i == 0) ? 0x0b : handles[i - 1]},
- .unkAAA = i == count ? 0x40 : 0x20,
+ .indices = {handles[i]},
+ .unkAAA = 0x20,
.unkBBB = 0x1,
.unka = 0x1ffff,
};
More information about the mesa-commit
mailing list