[Mesa-dev] [PATCH 3/3] panfrost: Swap order of tiled texture (de)alloc

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 15 18:23:50 UTC 2019


On Fri, 15 Feb 2019 at 08:50, Alyssa Rosenzweig <alyssa at rosenzweig.io> wrote:
>
> Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
> ---
>  src/gallium/drivers/panfrost/pan_resource.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
> index b13461013f5..4be371ba32e 100644
> --- a/src/gallium/drivers/panfrost/pan_resource.c
> +++ b/src/gallium/drivers/panfrost/pan_resource.c
> @@ -415,12 +415,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 */
>
> @@ -429,6 +423,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;
> +
Am I reading this correctly, that now we free a slab [for a tiled
texture] before allocating new one? The commit message seems rather
cryptic.

HTH
Emil


More information about the mesa-dev mailing list