[Mesa-dev] [PATCH] vc4: Mark BOs as purgeable when they enter the BO cache

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 27 13:50:10 UTC 2017


Quoting Boris Brezillon (2017-09-27 14:45:17)
>  static struct vc4_bo *
>  vc4_bo_from_cache(struct vc4_screen *screen, uint32_t size, const char *name)
>  {
> @@ -111,6 +121,11 @@ vc4_bo_from_cache(struct vc4_screen *screen, uint32_t size, const char *name)
>                          return NULL;
>                  }
>  
> +                if (vc4_bo_purgeable(bo, false)) {
> +                        mtx_unlock(&cache->lock);
> +                        return NULL;

So this would just mean that the bo was purged in the meantime. Why not
just try to use the next one in the cache or allocate afresh? Not sure
how way allocation failures are handled up the stack, but anyway this is
not necessarily -ENOMEM.
-Chris


More information about the mesa-dev mailing list