panvk: Move panvk_debug_adjust_bo_flags() to panvk_device.h

We will need it for the CSF backend.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30736>
This commit is contained in:
Boris Brezillon 2024-06-28 11:52:22 +02:00 committed by Marge Bot
parent b1db49d078
commit b7e0f14959
2 changed files with 15 additions and 15 deletions

View file

@ -48,19 +48,6 @@
#include "vk_descriptor_update_template.h"
#include "vk_format.h"
static uint32_t
panvk_debug_adjust_bo_flags(const struct panvk_device *device,
uint32_t bo_flags)
{
struct panvk_instance *instance =
to_panvk_instance(device->vk.physical->instance);
if (instance->debug_flags & PANVK_DEBUG_DUMP)
bo_flags &= ~PAN_KMOD_BO_FLAG_NO_MMAP;
return bo_flags;
}
static void
panvk_cmd_prepare_fragment_job(struct panvk_cmd_buffer *cmdbuf, mali_ptr fbd)
{
@ -401,7 +388,7 @@ panvk_create_cmdbuf(struct vk_command_pool *vk_pool, VkCommandBufferLevel level,
struct panvk_pool_properties tls_pool_props = {
.create_flags =
panvk_debug_adjust_bo_flags(device, PAN_KMOD_BO_FLAG_NO_MMAP),
panvk_device_adjust_bo_flags(device, PAN_KMOD_BO_FLAG_NO_MMAP),
.slab_size = 64 * 1024,
.label = "TLS pool",
.prealloc = false,
@ -413,7 +400,7 @@ panvk_create_cmdbuf(struct vk_command_pool *vk_pool, VkCommandBufferLevel level,
struct panvk_pool_properties var_pool_props = {
.create_flags =
panvk_debug_adjust_bo_flags(device, PAN_KMOD_BO_FLAG_NO_MMAP),
panvk_device_adjust_bo_flags(device, PAN_KMOD_BO_FLAG_NO_MMAP),
.slab_size = 64 * 1024,
.label = "TLS pool",
.prealloc = false,

View file

@ -86,6 +86,19 @@ to_panvk_device(struct vk_device *dev)
return container_of(dev, struct panvk_device, vk);
}
static inline uint32_t
panvk_device_adjust_bo_flags(const struct panvk_device *device,
uint32_t bo_flags)
{
struct panvk_instance *instance =
to_panvk_instance(device->vk.physical->instance);
if (instance->debug_flags & PANVK_DEBUG_DUMP)
bo_flags &= ~PAN_KMOD_BO_FLAG_NO_MMAP;
return bo_flags;
}
#if PAN_ARCH
VkResult
panvk_per_arch(create_device)(struct panvk_physical_device *physical_device,