Module: Mesa
Branch: main
Commit: f8cbbaff5fae160b2a3609d48ca2e4c8e301b931
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8cbbaff5fae160b2a3609d48ca2e4c8e301b931

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Tue Mar  8 11:56:00 2022 +0100

freedreno: replace opencoded slab_zalloc

Reviewed-by: Rob Clark <[email protected]>
Acked-by: Emma Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15277>

---

 src/gallium/drivers/freedreno/freedreno_resource.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c 
b/src/gallium/drivers/freedreno/freedreno_resource.c
index e1ba6b21c89..92e691b6db7 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.c
+++ b/src/gallium/drivers/freedreno/freedreno_resource.c
@@ -956,17 +956,15 @@ fd_resource_transfer_map(struct pipe_context *pctx, 
struct pipe_resource *prsc,
    }
 
    if (usage & TC_TRANSFER_MAP_THREADED_UNSYNC) {
-      ptrans = slab_alloc(&ctx->transfer_pool_unsync);
+      ptrans = slab_zalloc(&ctx->transfer_pool_unsync);
    } else {
-      ptrans = slab_alloc(&ctx->transfer_pool);
+      ptrans = slab_zalloc(&ctx->transfer_pool);
    }
 
    if (!ptrans)
       return NULL;
 
-   /* slab_alloc_st() doesn't zero: */
    trans = fd_transfer(ptrans);
-   memset(trans, 0, sizeof(*trans));
 
    usage = improve_transfer_map_usage(ctx, rsc, usage, box);
 

Reply via email to