Mesa (master): etnaviv: cosmetic etna_resource_alloc fixes
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 30 13:46:36 UTC 2020
Module: Mesa
Branch: master
Commit: 181790117bdfa98021890e9e9fa2f85a1b1e5a60
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=181790117bdfa98021890e9e9fa2f85a1b1e5a60
Author: Lucas Stach <l.stach at pengutronix.de>
Date: Thu Oct 29 16:55:17 2020 +0100
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 <l.stach at pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
---
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);
More information about the mesa-commit
mailing list