From 181790117bdfa98021890e9e9fa2f85a1b1e5a60 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Thu, 29 Oct 2020 16:55:17 +0100 Subject: [PATCH] etnaviv: cosmetic etna_resource_alloc fixes Get rid if the local bo variable, we can just assign it to the pointer in the etna_resource struct. Get rid of superfluous clearing of the TS bo pointer, the struct is already zero initialized. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_resource.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c index e2ef97f286f..bfb470c4bfb 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c @@ -307,15 +307,13 @@ etna_resource_alloc(struct pipe_screen *pscreen, unsigned layout, uint32_t flags = DRM_ETNA_GEM_CACHE_WC; if (templat->bind & PIPE_BIND_VERTEX_BUFFER) flags |= DRM_ETNA_GEM_FORCE_MMU; - struct etna_bo *bo = etna_bo_new(screen->dev, size, flags); - if (unlikely(bo == NULL)) { + + rsc->bo = etna_bo_new(screen->dev, size, flags); + if (unlikely(!rsc->bo)) { BUG("Problem allocating video memory for resource"); goto free_rsc; } - rsc->bo = bo; - rsc->ts_bo = 0; /* TS is only created when first bound to surface */ - if (DBG_ENABLED(ETNA_DBG_ZERO)) { void *map = etna_bo_map(bo); memset(map, 0, size);