iris: Replace no_gpu flag with PIPE_MAP_DIRECTLY
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 13 May 2021 05:19:42 +0000 (22:19 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 2 Jun 2021 21:18:00 +0000 (21:18 +0000)
commited55f52b399cc420cb264c0535d3c71b2a60c740
treec8050c6f3d7763cab43f6fc882b0a22f03096c3e
parent3a3eb63d6f94469c12d470a032320e4e9c363652
iris: Replace no_gpu flag with PIPE_MAP_DIRECTLY

Here, we're deciding when to map the buffer directly, rather than using
the GPU to blit to/from a temporary.  There is already a flag for that,
PIPE_MAP_DIRECTLY, which has the added benefit of not being a negative
(such as "no_gpu").

Currently, we intend to map directly if:

1. Direct mappings were requested explicitly
2. Persistent or coherent mappings were requested (and so we must)
3. ASTC textures (we currently can't blit those correctly)
4. There is no need for a temporary (there's no image compression that
   the CPU wouldn't understand, and we don't need to avoid stalls due
   to the buffer being busy on the GPU)

Expressing "please memory map this directly" is easier to follow than
"please don't use the GPU as part of mapping this".

Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10941>
src/gallium/drivers/iris/iris_resource.c