virgl: Return immediately when finding a compatible resource in the cache
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Thu, 13 Jun 2019 14:31:50 +0000 (17:31 +0300)
committerAlexandros Frantzis <alexandros.frantzis@collabora.com>
Fri, 14 Jun 2019 09:59:51 +0000 (12:59 +0300)
commit83829abe0345406cc8f5f5d4f795b9c80ccdb249
tree648675408b7f58f36d0dfebe1b7ae0f8a50badfc
parent801753d4b34f41625487c24a5c6ddaa912ef607a
virgl: Return immediately when finding a compatible resource in the cache

When searching for resources in the cache, we previously released all
expired resources even after having found a compatible resource.

This commit changes this behavior to return immediately when finding a
compatible resource, so that the operation finishes more quickly.  This
moves more of the burden of releasing expired resources to cache
addition, which, since it happens at resource destruction time, it's
less time critical.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/winsys/virgl/common/virgl_resource_cache.c