iris: Don't mark protected bo as reusable
authorJosé Roberto de Souza <jose.souza@intel.com>
Thu, 9 Mar 2023 19:00:10 +0000 (11:00 -0800)
committerMarge Bot <emma+marge@anholt.net>
Fri, 10 Mar 2023 18:59:59 +0000 (18:59 +0000)
commit266d961fdc91514d6425e33d43fc1bd4e571bd35
tree26ca8cf33edecfe7afad121480d198b22efd917c
parente61d6540e63b7866812b89264e4329e1ad3a9664
iris: Don't mark protected bo as reusable

The check in alloc_bo_from_cache() was skiping any try to get a bo
from cache but after use a protected bo was still being put in some
cache bucket and could be used for cases that don't require a
protected bo.

Using a protected bo in cases that don't require it can have
performance implications.

So here returning NULL when trying to get a cache bucket for a
protected bo, this will cause bo->real.reusable to be set to false
avoiding the bo to be reused.

Fixes: 9402ac8023a0 ("iris: handle protected BO creation")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21824>
src/gallium/drivers/iris/iris_bufmgr.c