vc4: replace opencoded slab_zalloc

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-03-08 11:47:17 +01:00
parent ff1744ee27
commit af7117df71

View File

@@ -153,14 +153,12 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
rsc->initialized_buffers = ~0;
}
trans = slab_alloc(&vc4->transfer_pool);
trans = slab_zalloc(&vc4->transfer_pool);
if (!trans)
return NULL;
/* XXX: Handle DONTBLOCK, DISCARD_RANGE, PERSISTENT, COHERENT. */
/* slab_alloc_st() doesn't zero: */
memset(trans, 0, sizeof(*trans));
ptrans = &trans->base;
pipe_resource_reference(&ptrans->resource, prsc);