uint32_t max_avail_coeff_regs =
dev_runtime_info->cdm_max_local_mem_size_regs;
uint32_t localstore_chunks_count =
- DIV_ROUND_UP(coeff_regs_count << 2,
+ DIV_ROUND_UP(PVR_DW_TO_BYTES(coeff_regs_count),
PVRX(CDMCTRL_KERNEL0_USC_COMMON_SIZE_UNIT_SIZE));
/* Ensure that we cannot have more workgroups in a slot than the available
struct pvr_compute_kernel_info info = {
.indirect_buffer_addr = PVR_DEV_ADDR_INVALID,
.global_offsets_present = false,
- .usc_common_size =
- DIV_ROUND_UP(cmd_buffer->device->idfwdf_state.usc_shareds << 2,
- PVRX(CDMCTRL_KERNEL0_USC_COMMON_SIZE_UNIT_SIZE)),
+ .usc_common_size = DIV_ROUND_UP(
+ PVR_DW_TO_BYTES(cmd_buffer->device->idfwdf_state.usc_shareds),
+ PVRX(CDMCTRL_KERNEL0_USC_COMMON_SIZE_UNIT_SIZE)),
.usc_unified_size = 0U,
.pds_temp_size = 0U,
.pds_data_size =
}
info.usc_common_size =
- DIV_ROUND_UP(coeff_regs << 2U,
+ DIV_ROUND_UP(PVR_DW_TO_BYTES(coeff_regs),
PVRX(CDMCTRL_KERNEL0_USC_COMMON_SIZE_UNIT_SIZE));
/* Use a whole slot per workgroup. */
}
info.usc_common_size =
- DIV_ROUND_UP(coeff_regs << 2U,
+ DIV_ROUND_UP(PVR_DW_TO_BYTES(coeff_regs),
PVRX(CDMCTRL_KERNEL0_USC_COMMON_SIZE_UNIT_SIZE));
/* Use a whole slot per workgroup. */
pipeline.unified_store_regs_count = shader_factory_info->input_regs;
pipeline.const_shared_regs_count = shader_factory_info->const_shared_regs;
- const_buffer = vk_alloc(&cmd_buffer->vk.pool->alloc,
- shader_factory_info->const_shared_regs << 2,
- 8,
- VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
+ const_buffer =
+ vk_alloc(&cmd_buffer->vk.pool->alloc,
+ PVR_DW_TO_BYTES(shader_factory_info->const_shared_regs),
+ 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
if (!const_buffer) {
return vk_command_buffer_set_error(&cmd_buffer->vk,
VK_ERROR_OUT_OF_HOST_MEMORY);
const_buffer[load->dst_idx] = load->value;
}
- result =
- pvr_cmd_buffer_upload_general(cmd_buffer,
- const_buffer,
- shader_factory_info->const_shared_regs << 2,
- &pvr_bo);
+ result = pvr_cmd_buffer_upload_general(
+ cmd_buffer,
+ const_buffer,
+ PVR_DW_TO_BYTES(shader_factory_info->const_shared_regs),
+ &pvr_bo);
if (result != VK_SUCCESS) {
vk_free(&cmd_buffer->vk.pool->alloc, const_buffer);
assert(spm_load_program_idx < ARRAY_SIZE(spm_load_collection));
info = spm_load_collection[spm_load_program_idx].info;
- consts_buffer_size = info->const_shared_regs * sizeof(uint32_t);
+ consts_buffer_size = PVR_DW_TO_BYTES(info->const_shared_regs);
/* TODO: Remove this check, along with the pvr_finishme(), once the zeroed
* shaders are replaced by the real shaders.