panvk: Transition panvk_descriptor_set to panvk_priv_bo

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-11 15:14:26 +01:00
committed by Marge Bot
parent 86109da54e
commit 57ea8e4a46
3 changed files with 7 additions and 10 deletions

View File

@@ -36,8 +36,6 @@
#include "vk_descriptors.h"
#include "vk_util.h"
#include "pan_bo.h"
/* FIXME: make sure those values are correct */
#define PANVK_MAX_TEXTURES (1 << 16)
#define PANVK_MAX_IMAGES (1 << 8)
@@ -301,7 +299,7 @@ panvk_descriptor_set_destroy(struct panvk_device *device,
vk_free(&device->vk.alloc, set->img_fmts);
vk_free(&device->vk.alloc, set->img_attrib_bufs);
if (set->desc_bo)
panfrost_bo_unreference(set->desc_bo);
panvk_priv_bo_destroy(set->desc_bo, NULL);
vk_object_free(&device->vk, NULL, set);
}

View File

@@ -371,7 +371,7 @@ struct panvk_descriptor_set {
void *img_attrib_bufs;
uint32_t *img_fmts;
struct panfrost_bo *desc_bo;
struct panvk_priv_bo *desc_bo;
};
#define MAX_SETS 4

View File

@@ -40,7 +40,6 @@
#include "vk_descriptors.h"
#include "vk_util.h"
#include "pan_bo.h"
#include "panvk_cs.h"
#define PANVK_DESCRIPTOR_ALIGN 8
@@ -303,14 +302,14 @@ panvk_per_arch(descriptor_set_create)(
if (layout->desc_ubo_size) {
set->desc_bo =
panfrost_bo_create(&device->pdev,
layout->desc_ubo_size, 0, "Descriptor set");
panvk_priv_bo_create(device, layout->desc_ubo_size, 0, NULL,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!set->desc_bo)
goto err_free_set;
struct mali_uniform_buffer_packed *ubos = set->ubos;
panvk_per_arch(emit_ubo)(set->desc_bo->ptr.gpu, layout->desc_ubo_size,
panvk_per_arch(emit_ubo)(set->desc_bo->addr.dev, layout->desc_ubo_size,
&ubos[layout->desc_ubo_index]);
}
@@ -337,7 +336,7 @@ err_free_set:
vk_free(&device->vk.alloc, set->img_fmts);
vk_free(&device->vk.alloc, set->img_attrib_bufs);
if (set->desc_bo)
panfrost_bo_unreference(set->desc_bo);
panvk_priv_bo_destroy(set->desc_bo, NULL);
vk_object_free(&device->vk, NULL, set);
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
}
@@ -383,7 +382,7 @@ panvk_desc_ubo_data(struct panvk_descriptor_set *set, uint32_t binding,
const struct panvk_descriptor_set_binding_layout *binding_layout =
&set->layout->bindings[binding];
return (char *)set->desc_bo->ptr.cpu + binding_layout->desc_ubo_offset +
return (char *)set->desc_bo->addr.host + binding_layout->desc_ubo_offset +
elem * binding_layout->desc_ubo_stride;
}