diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-02-15 00:28:46 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-18 05:10:33 +0000 |
commit | a94463732af9e483045abe8b48555fd9211b827e (patch) | |
tree | 98f927e295e59e1470a7165df46209dfe589eda8 | |
parent | 4a4ed53c012c39c3a0781c7944f9449e258ada1d (diff) |
panfrost: Swap order of tiled texture (de)alloc
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 26f4782a4ad..ce603dfac92 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -414,12 +414,6 @@ panfrost_tile_texture(struct panfrost_screen *screen, struct panfrost_resource * int swizzled_sz = panfrost_swizzled_size(width, height, bytes_per_pixel); - /* Allocate the transfer given that known size but do not copy */ - struct pb_slab_entry *entry = pb_slab_alloc(&screen->slabs, swizzled_sz, HEAP_TEXTURE); - struct panfrost_memory_entry *p_entry = (struct panfrost_memory_entry *) entry; - struct panfrost_memory *backing = (struct panfrost_memory *) entry->slab; - uint8_t *swizzled = backing->cpu + p_entry->offset; - /* Save the entry. But if there was already an entry here (from a * previous upload of the resource), free that one so we don't leak */ @@ -428,6 +422,12 @@ panfrost_tile_texture(struct panfrost_screen *screen, struct panfrost_resource * pb_slab_free(&screen->slabs, &bo->entry[level]->base); } + /* Allocate the transfer given that known size but do not copy */ + struct pb_slab_entry *entry = pb_slab_alloc(&screen->slabs, swizzled_sz, HEAP_TEXTURE); + struct panfrost_memory_entry *p_entry = (struct panfrost_memory_entry *) entry; + struct panfrost_memory *backing = (struct panfrost_memory *) entry->slab; + uint8_t *swizzled = backing->cpu + p_entry->offset; + bo->entry[level] = p_entry; bo->gpu[level] = backing->gpu + p_entry->offset; |