summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_threaded_context.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-04-28 17:19:43 -0400
committerMarge Bot <eric+marge@anholt.net>2021-05-05 05:17:25 +0000
commit954f59f2af4a135f2af2d2b6e341b4332ad3cccd (patch)
tree08448673ed782d83feee5674814f7ebb9eafc1ce /src/gallium/auxiliary/util/u_threaded_context.c
parent20538b50c71c9c4fecd1a4c736a8d726411366ce (diff)
Revert "gallium/u_threaded: align batches and call slots to 16 bytes"
This reverts commit 3b1ce49bc1e5aff87805b0bab255885c84bf5052. It will be completely rewritten, but let's revert this first. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer@amd.com> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>
Diffstat (limited to 'src/gallium/auxiliary/util/u_threaded_context.c')
-rw-r--r--src/gallium/auxiliary/util/u_threaded_context.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index 73d45a6c909..2474fb11ddd 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -3217,7 +3217,7 @@ tc_destroy(struct pipe_context *_pipe)
slab_destroy_child(&tc->pool_transfers);
assert(tc->batch_slots[tc->next].num_total_call_slots == 0);
pipe->destroy(pipe);
- os_free_aligned(tc);
+ FREE(tc);
}
static const tc_execute execute_func[TC_NUM_CALLS] = {
@@ -3258,22 +3258,14 @@ threaded_context_create(struct pipe_context *pipe,
if (!debug_get_bool_option("GALLIUM_THREAD", util_get_cpu_caps()->nr_cpus > 1))
return pipe;
- tc = os_malloc_aligned(sizeof(struct threaded_context), 16);
+ tc = CALLOC_STRUCT(threaded_context);
if (!tc) {
pipe->destroy(pipe);
return NULL;
}
- memset(tc, 0, sizeof(*tc));
pipe = trace_context_create_threaded(pipe->screen, pipe);
- assert((uintptr_t)tc % 16 == 0);
- /* These should be static asserts, but they don't work with MSVC */
- assert(offsetof(struct threaded_context, batch_slots) % 16 == 0);
- assert(offsetof(struct threaded_context, batch_slots[0].call) % 16 == 0);
- assert(offsetof(struct threaded_context, batch_slots[0].call[1]) % 16 == 0);
- assert(offsetof(struct threaded_context, batch_slots[1].call) % 16 == 0);
-
/* The driver context isn't wrapped, so set its "priv" to NULL. */
pipe->priv = NULL;