pvr: fixup assert in pvr_cmd_buffer_alloc_mem

Stop explicitly passing PVR_BO_ALLOC_FLAG_CPU_MAPPED to
pvr_cmd_buffer_alloc_mem(). This is redundant for sub-allocations,
as they are always unconditionally mapped to the CPU.

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23463>
This commit is contained in:
Luigi Santivetti
2023-05-16 14:36:24 +01:00
committed by Marge Bot
parent 4dc82b4473
commit 9396ba3be1
5 changed files with 5 additions and 26 deletions
-2
View File
@@ -1506,7 +1506,6 @@ static VkResult pvr_clear_color_attachment_static_create_consts_buffer(
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
device->heaps.general_heap,
shader_info->const_shared_regs,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&const_shareds_buffer);
if (result != VK_SUCCESS)
return result;
@@ -1649,7 +1648,6 @@ static VkResult pvr_clear_color_attachment_static(
cmd_buffer,
device->heaps.pds_heap,
clear_attachment_program->texture_program_data_size,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pds_texture_program_bo);
if (result != VK_SUCCESS) {
list_del(&const_shareds_buffer->link);
+5 -17
View File
@@ -1175,7 +1175,6 @@ pvr_sub_cmd_gfx_align_ds_subtiles(struct pvr_cmd_buffer *const cmd_buffer,
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.general_heap,
buffer_size,
0,
&buffer);
if (result != VK_SUCCESS)
return result;
@@ -2315,7 +2314,6 @@ VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer,
struct pvr_winsys_heap *heap,
uint64_t size,
uint32_t flags,
struct pvr_suballoc_bo **const pvr_bo_out)
{
const uint32_t cache_line_size =
@@ -2324,9 +2322,6 @@ VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer,
struct pvr_suballocator *allocator;
VkResult result;
/* We assume users to always request bo(s) to be CPU mapped */
assert(flags & PVR_BO_ALLOC_FLAG_CPU_MAPPED);
if (heap == cmd_buffer->device->heaps.general_heap)
allocator = &cmd_buffer->device->suballoc_general;
else if (heap == cmd_buffer->device->heaps.pds_heap)
@@ -3233,7 +3228,6 @@ pvr_setup_vertex_buffers(struct pvr_cmd_buffer *cmd_buffer,
pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
PVR_DW_TO_BYTES(pds_info->data_size_in_dwords),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -3442,7 +3436,6 @@ static VkResult pvr_setup_descriptor_mappings_old(
pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
PVR_DW_TO_BYTES(pds_info->data_size_in_dwords),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -3765,7 +3758,6 @@ static VkResult pvr_cmd_buffer_upload_patched_desc_set(
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.general_heap,
normal_desc_set_size + dynamic_descs_size,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&patched_desc_set_bo);
if (result != VK_SUCCESS)
return result;
@@ -4038,11 +4030,11 @@ static VkResult pvr_setup_descriptor_mappings_new(
if (!pds_info->data_size_in_dwords)
return VK_SUCCESS;
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
PVR_DW_TO_BYTES(pds_info->data_size_in_dwords),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
result =
pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
PVR_DW_TO_BYTES(pds_info->data_size_in_dwords),
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -4092,7 +4084,6 @@ static VkResult pvr_setup_descriptor_mappings_new(
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
device->heaps.general_heap,
addr_literal_buffer_entry->size,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&addr_literal_buffer_bo);
if (result != VK_SUCCESS)
return result;
@@ -5752,7 +5743,6 @@ static VkResult pvr_emit_ppp_state(struct pvr_cmd_buffer *const cmd_buffer,
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.general_heap,
PVR_DW_TO_BYTES(ppp_state_words_count),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -6392,7 +6382,6 @@ pvr_write_draw_indirect_vdm_stream(struct pvr_cmd_buffer *cmd_buffer,
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.general_heap,
DUMMY_VDM_CONTROL_STREAM_BLOCK_SIZE,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&dummy_bo);
if (result != VK_SUCCESS)
return result;
@@ -6418,7 +6407,6 @@ pvr_write_draw_indirect_vdm_stream(struct pvr_cmd_buffer *cmd_buffer,
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
pds_size,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pds_bo);
if (result != VK_SUCCESS)
return result;
@@ -2106,7 +2106,6 @@ pvr_pds_unitex(const struct pvr_device_info *dev_info,
pvr_cmd_buffer_alloc_mem(transfer_cmd->cmd_buffer,
ctx->device->heaps.pds_heap,
PVR_DW_TO_BYTES(state->tex_state_data_size),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -2812,7 +2811,6 @@ static VkResult pvr_3d_copy_blit_core(struct pvr_transfer_ctx *ctx,
result = pvr_cmd_buffer_alloc_mem(transfer_cmd->cmd_buffer,
device->heaps.general_heap,
PVR_DW_TO_BYTES(tex_state_dma_size_dw),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -3000,7 +2998,6 @@ pvr_pds_coeff_task(struct pvr_transfer_ctx *ctx,
transfer_cmd->cmd_buffer,
ctx->device->heaps.pds_heap,
PVR_DW_TO_BYTES(program.data_size + program.code_size),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
@@ -3999,7 +3996,6 @@ static VkResult pvr_isp_ctrl_stream(const struct pvr_device_info *dev_info,
result = pvr_cmd_buffer_alloc_mem(transfer_cmd->cmd_buffer,
ctx->device->heaps.transfer_3d_heap,
total_stream_size,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_cs_bo);
if (result != VK_SUCCESS)
return result;
@@ -4164,7 +4160,6 @@ static VkResult pvr_isp_ctrl_stream(const struct pvr_device_info *dev_info,
result = pvr_cmd_buffer_alloc_mem(transfer_cmd->cmd_buffer,
ctx->device->heaps.general_heap,
tex_state_dma_size << 2U,
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;
-1
View File
@@ -1246,7 +1246,6 @@ VkResult pvr_cmd_buffer_add_transfer_cmd(struct pvr_cmd_buffer *cmd_buffer,
VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer,
struct pvr_winsys_heap *heap,
uint64_t size,
uint32_t flags,
struct pvr_suballoc_bo **const pvr_bo_out);
void pvr_calculate_vertex_cam_size(const struct pvr_device_info *dev_info,
@@ -209,7 +209,6 @@ static VkResult pvr_write_compute_query_pds_data_section(
result = pvr_cmd_buffer_alloc_mem(cmd_buffer,
cmd_buffer->device->heaps.pds_heap,
PVR_DW_TO_BYTES(info->data_size_in_dwords),
PVR_BO_ALLOC_FLAG_CPU_MAPPED,
&pvr_bo);
if (result != VK_SUCCESS)
return result;