Hi Boris,

On Sat, 31 Aug 2019 at 11:47, Boris Brezillon
<boris.brezil...@collabora.com> wrote:
> Right now, the transient memory allocator implements its own BO caching
> mechanism, which is not really needed since we already have a generic
> BO cache. Let's simplify things a bit.
>
> [...]
>
>          bool fits_in_current = (batch->transient_offset + sz) < 
> TRANSIENT_SLAB_SIZE;
>
> +        if (likely(batch->transient_bo && fits_in_current)) {
> +                /* We can reuse the current BO, so get it */
> +                [...]
>          } else {
> -                /* Create a new BO and reference it */
> -                bo = panfrost_drm_create_bo(screen, ALIGN_POT(sz, 4096), 0);
> +                size_t bo_sz = sz < TRANSIENT_SLAB_SIZE ?
> +                               TRANSIENT_SLAB_SIZE : ALIGN_POT(sz, 4096);

Should we record the size of the allocated transient BO here, so we
can use the whole BO for transients when we allocate more than the
slab size?

Cheers,
Daniel
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to