panvk: Mask off BO_FLAG_WB_MMAP in adjust_bo_flags()

This makes it easier to say we want WB maps various places.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36385>
This commit is contained in:
Faith Ekstrand
2025-07-28 16:54:14 -04:00
committed by Boris Brezillon
parent aebd71cc8d
commit a670956b7a

View File

@@ -147,6 +147,23 @@ static inline uint32_t
panvk_device_adjust_bo_flags(const struct panvk_device *device,
uint32_t bo_flags)
{
struct panvk_physical_device *pdev =
to_panvk_physical_device(device->vk.physical);
/* Dumping of GPU buffers messes up with CPU caches by loading buffers
* into cachelines which are sometimes assumed to be invalidated by the
* rest of the code. We could explicitly invalidate after a dump, but
* this is simpler to just disable cached-mappings when PANVK_DEBUG="dump".
* Tracing has the same fundamental issue, but we'll take care of that
* at the desc/CS pools level.
*/
const bool allow_wb_mmap =
(pdev->kmod.dev->props.supported_bo_flags & PAN_KMOD_BO_FLAG_WB_MMAP) &&
!PANVK_DEBUG(DUMP);
if (!allow_wb_mmap)
bo_flags &= ~PAN_KMOD_BO_FLAG_WB_MMAP;
if (PANVK_DEBUG(DUMP) || PANVK_DEBUG(TRACE))
bo_flags &= ~PAN_KMOD_BO_FLAG_NO_MMAP;