freedreno/drm: Consider allocation flags in bo-cache
authorRob Clark <robdclark@chromium.org>
Fri, 18 Jun 2021 16:58:11 +0000 (09:58 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Sep 2021 18:24:34 +0000 (18:24 +0000)
commit429986d5aaab0f7357a731523d703364647bb8a3
tree84bbb9f6e58c1ad5e68b9bb619685b432d561e30
parent83085a8f395fd0102ef0af2fee2c21bfd626f084
freedreno/drm: Consider allocation flags in bo-cache

It hasn't really mattered until now, as we keep a separate cache for
cmdstream (which is FD_BO_GPU_READONLY), and the only other flag so
far is FD_BO_SCANOUT (which the bo cache probably messes up, but it
does not matter on most hw, and on hw where it does the scanout buffer
will be imported (and therefore won't end up in the bo cache).

But when we add cached-coherent (or if we wanted to use GPU_READONLY
more) it starts to matter.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11176>
src/freedreno/drm/freedreno_bo.c
src/freedreno/drm/freedreno_bo_cache.c
src/freedreno/drm/freedreno_priv.h