assert(mod == &HAL_MODULE_INFO_SYM.common);
assert(strcmp(id, HWVULKAN_DEVICE_0) == 0);
- hwvulkan_device_t *hal_dev = malloc(sizeof(*hal_dev));
+ hwvulkan_device_t *hal_dev = (hwvulkan_device_t *) malloc(sizeof(*hal_dev));
if (!hal_dev)
return -1;
uint64_t *modifier)
{
- const gralloc_module_t *gralloc = device->gralloc;
+ const gralloc_module_t *gralloc = (const gralloc_module_t *) device->gralloc;
struct cros_gralloc0_buffer_info info;
int ret;
"Could not open gralloc\n");
}
- const gralloc_module_t *gralloc = device->gralloc;
+ const gralloc_module_t *gralloc = (const gralloc_module_t *) device->gralloc;
mesa_logi("opened gralloc module name: %s", gralloc->common.name);
struct tu_submission_data, node);
list_del(&submission_data->node);
} else {
- submission_data = calloc(1, sizeof(struct tu_submission_data));
+ submission_data = (struct tu_submission_data *) calloc(
+ 1, sizeof(struct tu_submission_data));
tu_cs_init(&submission_data->fence_cs, dev, TU_CS_MODE_GROW, 5, "autotune fence cs");
}
submission_data->fence = fence;
struct hash_entry *entry =
_mesa_hash_table_search(at->ht, &rp_key);
if (entry) {
- struct tu_renderpass_history *history = entry->data;
+ struct tu_renderpass_history *history =
+ (struct tu_renderpass_history *) entry->data;
if (history->num_results > 0) {
*avg_samples = p_atomic_read(&history->avg_samples);
has_history = true;
static struct tu_renderpass_result *
create_history_result(struct tu_autotune *at, uint64_t rp_key)
{
- struct tu_renderpass_result *result = calloc(1, sizeof(*result));
+ struct tu_renderpass_result *result =
+ (struct tu_renderpass_result *) calloc(1, sizeof(*result));
result->rp_key = rp_key;
return result;
list_for_each_entry_safe(struct tu_renderpass_result, result,
&cmdbuf->renderpass_autotune_results, node) {
/* TODO: copying each result isn't nice */
- struct tu_renderpass_result *copy = malloc(sizeof(*result));
+ struct tu_renderpass_result *copy =
+ (struct tu_renderpass_result *) malloc(sizeof(*result));
*copy = *result;
tu_bo_get_ref(copy->bo.bo);
list_addtail(©->node, &at->pending_results);
struct hash_entry *entry =
_mesa_hash_table_search(at->ht, &result->rp_key);
if (!entry) {
- history = calloc(1, sizeof(*history));
+ history =
+ (struct tu_renderpass_history *) calloc(1, sizeof(*history));
history->key = result->rp_key;
list_inithead(&history->results);
* command buffers, otherwise this table may grow big.
*/
hash_table_foreach(at->ht, entry) {
- struct tu_renderpass_history *history = entry->data;
+ struct tu_renderpass_history *history =
+ (struct tu_renderpass_history *) entry->data;
if (fence_before(gpu_fence, history->last_fence + MAX_HISTORY_LIFETIME))
continue;
}
hash_table_foreach(at->ht, entry) {
- struct tu_renderpass_history *history = entry->data;
+ struct tu_renderpass_history *history =
+ (struct tu_renderpass_history *) entry->data;
mesa_logi("%016"PRIx64" \tavg_passed=%u results=%u",
history->key, history->avg_samples, history->num_results);
mtx_lock(&dev->autotune_mutex);
hash_table_foreach(at->ht, entry) {
- struct tu_renderpass_history *history = entry->data;
+ struct tu_renderpass_history *history =
+ (struct tu_renderpass_history *) entry->data;
free_history(dev, history);
}
mtx_unlock(&dev->autotune_mutex);
uint64_t result_iova = autotune_result->bo.iova;
- autotune_result->samples = tu_suballoc_bo_map(&autotune_result->bo);
+ autotune_result->samples =
+ (struct tu_renderpass_samples *) tu_suballoc_bo_map(
+ &autotune_result->bo);
tu_cs_emit_regs(cs, A6XX_RB_SAMPLE_COUNT_CONTROL(.copy = true));
container_of(pool->base.device, struct tu_device, vk);
struct tu_cmd_buffer *cmd_buffer;
- cmd_buffer = vk_zalloc2(&device->vk.alloc, NULL, sizeof(*cmd_buffer), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ cmd_buffer = (struct tu_cmd_buffer *) vk_zalloc2(
+ &device->vk.alloc, NULL, sizeof(*cmd_buffer), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (cmd_buffer == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
- VkResult result = vk_command_buffer_init(pool, &cmd_buffer->vk,
- &tu_cmd_buffer_ops, 0);
+ VkResult result =
+ vk_command_buffer_init(pool, &cmd_buffer->vk, &tu_cmd_buffer_ops,
+ VK_COMMAND_BUFFER_LEVEL_PRIMARY);
if (result != VK_SUCCESS) {
vk_free2(&device->vk.alloc, NULL, cmd_buffer);
return result;
vk_foreach_struct_const(ext, pBeginInfo->pInheritanceInfo) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_CONDITIONAL_RENDERING_INFO_EXT: {
- const VkCommandBufferInheritanceConditionalRenderingInfoEXT *cond_rend = (void *) ext;
+ const VkCommandBufferInheritanceConditionalRenderingInfoEXT *cond_rend =
+ (VkCommandBufferInheritanceConditionalRenderingInfoEXT *) ext;
cmd_buffer->state.predication_active = cond_rend->conditionalRenderingEnable;
break;
default:
VK_QUERY_SCOPE_COMMAND_BUFFER_KHR);
if (!new_buf)
return VK_ERROR_OUT_OF_HOST_MEMORY;
- set->mapped_ptr = new_buf;
+ set->mapped_ptr = (uint32_t *) new_buf;
set->host_size = layout->size;
}
return VK_SUCCESS;
const void *pValues)
{
TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer);
- memcpy((void*) cmd->push_constants + offset, pValues, size);
+ memcpy((char *) cmd->push_constants + offset, pValues, size);
cmd->state.dirty |= TU_CMD_DIRTY_SHADER_CONSTS;
}
cmd->state.framebuffer = fb;
cmd->state.render_area = pRenderPassBegin->renderArea;
- cmd->state.attachments =
+ cmd->state.attachments = (const struct tu_image_view **)
vk_alloc(&cmd->vk.pool->alloc, pass->attachment_count *
sizeof(cmd->state.attachments[0]), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
tu_cs_init_suballoc(struct tu_cs *cs, struct tu_device *device,
struct tu_suballoc_bo *suballoc_bo)
{
- uint32_t *start = tu_suballoc_bo_map(suballoc_bo);
+ uint32_t *start = (uint32_t *) tu_suballoc_bo_map(suballoc_bo);
uint32_t *end = start + (suballoc_bo->size >> 2);
memset(cs, 0, sizeof(*cs));
/* grow cs->bos if needed */
if (cs->bo_count == cs->bo_capacity) {
uint32_t new_capacity = MAX2(4, 2 * cs->bo_capacity);
- struct tu_bo **new_bos =
+ struct tu_bo **new_bos = (struct tu_bo **)
realloc(cs->bos, new_capacity * sizeof(struct tu_bo *));
if (!new_bos)
return VK_ERROR_OUT_OF_HOST_MEMORY;
/* grow cs->entries if needed */
if (cs->entry_count == cs->entry_capacity) {
uint32_t new_capacity = MAX2(4, cs->entry_capacity * 2);
- struct tu_cs_entry *new_entries =
+ struct tu_cs_entry *new_entries = (struct tu_cs_entry *)
realloc(cs->entries, new_capacity * sizeof(struct tu_cs_entry));
if (!new_entries)
return VK_ERROR_OUT_OF_HOST_MEMORY;
struct tu_bo *bo = tu_cs_current_bo(cs);
size_t offset = align(tu_cs_get_offset(cs), size);
- memory->map = bo->map + offset * sizeof(uint32_t);
+ memory->map = (uint32_t *) bo->map + offset;
memory->iova = bo->iova + offset * sizeof(uint32_t);
cs->start = cs->cur = (uint32_t*) bo->map + offset + count * size;
return;
}
- struct breadcrumbs_context *ctx =
- malloc(sizeof(struct breadcrumbs_context));
+ struct breadcrumbs_context *ctx = (struct breadcrumbs_context *) malloc(
+ sizeof(struct breadcrumbs_context));
ctx->device = device;
ctx->breadcrumb_idx = 0;
ctx->thread_stop = false;
static inline uint8_t *
pool_base(struct tu_descriptor_pool *pool)
{
- return pool->host_bo ?: pool->bo->map;
+ return pool->host_bo ?: (uint8_t *) pool->bo->map;
}
static uint32_t
immutable_sampler_count * sizeof(struct tu_sampler) +
ycbcr_sampler_count * sizeof(struct tu_sampler_ycbcr_conversion);
- set_layout = vk_descriptor_set_layout_zalloc(&device->vk, size);
+ set_layout =
+ (struct tu_descriptor_set_layout *) vk_descriptor_set_layout_zalloc(
+ &device->vk, size);
if (!set_layout)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
set_layout->vk.destroy = tu_descriptor_set_layout_destroy;
/* We just allocate all the immutable samplers at the end of the struct */
- struct tu_sampler *samplers = (void*) &set_layout->binding[num_bindings];
+ struct tu_sampler *samplers =
+ (struct tu_sampler *) &set_layout->binding[num_bindings];
struct tu_sampler_ycbcr_conversion *ycbcr_samplers =
- (void*) &samplers[immutable_sampler_count];
+ (struct tu_sampler_ycbcr_conversion *) &samplers[immutable_sampler_count];
VkDescriptorSetLayoutBinding *bindings = NULL;
VkResult result = vk_create_sorted_bindings(
return vk_error(device, result);
}
- char *map = set_layout->embedded_samplers->map;
+ char *map = (char *) set_layout->embedded_samplers->map;
for (unsigned i = 0; i < set_layout->binding_count; i++) {
if (!set_layout->binding[i].immutable_samplers_offset)
continue;
assert(pCreateInfo->sType ==
VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO);
- layout = vk_object_alloc(&device->vk, pAllocator, sizeof(*layout),
- VK_OBJECT_TYPE_PIPELINE_LAYOUT);
+ layout = (struct tu_pipeline_layout *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*layout),
+ VK_OBJECT_TYPE_PIPELINE_LAYOUT);
if (layout == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
set = (struct tu_descriptor_set*)pool->host_memory_ptr;
pool->host_memory_ptr += mem_size;
} else {
- set = vk_alloc2(&device->vk.alloc, NULL, mem_size, 8,
- VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ set = (struct tu_descriptor_set *) vk_alloc2(
+ &device->vk.alloc, NULL, mem_size, 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!set)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
size += sizeof(struct tu_descriptor_pool_entry) * pCreateInfo->maxSets;
}
- pool = vk_object_zalloc(&device->vk, pAllocator, size,
- VK_OBJECT_TYPE_DESCRIPTOR_POOL);
+ pool = (struct tu_descriptor_pool *) vk_object_zalloc(
+ &device->vk, pAllocator, size, VK_OBJECT_TYPE_DESCRIPTOR_POOL);
if (!pool)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
if (ret)
goto fail_map;
} else {
- pool->host_bo = vk_alloc2(&device->vk.alloc, pAllocator, bo_size, 8,
- VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+ pool->host_bo =
+ (uint8_t *) vk_alloc2(&device->vk.alloc, pAllocator, bo_size, 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!pool->host_bo) {
ret = VK_ERROR_OUT_OF_HOST_MEMORY;
goto fail_alloc;
void *pDescriptor)
{
TU_FROM_HANDLE(tu_device, device, _device);
+ uint32_t *dest = (uint32_t *) pDescriptor;
switch (pDescriptorInfo->type) {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
- write_ubo_descriptor_addr(pDescriptor, pDescriptorInfo->data.pUniformBuffer);
+ write_ubo_descriptor_addr(dest, pDescriptorInfo->data.pUniformBuffer);
break;
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
- write_buffer_descriptor_addr(device, pDescriptor, pDescriptorInfo->data.pStorageBuffer);
+ write_buffer_descriptor_addr(device, dest, pDescriptorInfo->data.pStorageBuffer);
break;
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
- write_texel_buffer_descriptor_addr(pDescriptor, pDescriptorInfo->data.pUniformTexelBuffer);
+ write_texel_buffer_descriptor_addr(dest, pDescriptorInfo->data.pUniformTexelBuffer);
break;
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
- write_texel_buffer_descriptor_addr(pDescriptor, pDescriptorInfo->data.pStorageTexelBuffer);
+ write_texel_buffer_descriptor_addr(dest, pDescriptorInfo->data.pStorageTexelBuffer);
break;
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
- write_image_descriptor(pDescriptor, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
+ write_image_descriptor(dest, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
pDescriptorInfo->data.pSampledImage);
break;
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
- write_image_descriptor(pDescriptor, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
+ write_image_descriptor(dest, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
pDescriptorInfo->data.pStorageImage);
break;
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
- write_combined_image_sampler_descriptor(pDescriptor,
+ write_combined_image_sampler_descriptor(dest,
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
pDescriptorInfo->data.pCombinedImageSampler,
true);
break;
case VK_DESCRIPTOR_TYPE_SAMPLER:
- write_sampler_descriptor(pDescriptor, *pDescriptorInfo->data.pSampler);
+ write_sampler_descriptor(dest, *pDescriptorInfo->data.pSampler);
break;
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
/* nothing in descriptor set - framebuffer state is used instead */
if (TU_DEBUG(DYNAMIC)) {
- write_image_descriptor(pDescriptor, VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
+ write_image_descriptor(dest, VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT,
pDescriptorInfo->data.pInputAttachmentImage);
}
break;
vk_find_struct_const(writeset->pNext,
WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK);
uint32_t remaining = inline_write->dataSize;
- const uint8_t *src = inline_write->pData;
+ const uint8_t *src = (const uint8_t *) inline_write->pData;
uint32_t dst_offset = writeset->dstArrayElement;
do {
uint8_t *dst = (uint8_t *)(ptr) + dst_offset;
sizeof(struct tu_descriptor_update_template_entry) * dst_entry_count;
struct tu_descriptor_update_template *templ;
- templ = vk_object_alloc(&device->vk, pAllocator, size,
- VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE);
+ templ = (struct tu_descriptor_update_template *) vk_object_alloc(
+ &device->vk, pAllocator, size,
+ VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE);
if (!templ)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
switch(templ->entry[i].descriptor_type) {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: {
assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
- write_ubo_descriptor(set->dynamic_descriptors + dst_offset, src);
+ write_ubo_descriptor(set->dynamic_descriptors + dst_offset,
+ (const VkDescriptorBufferInfo *) src);
break;
}
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
- write_ubo_descriptor(ptr, src);
+ write_ubo_descriptor(ptr, (const VkDescriptorBufferInfo *) src);
break;
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: {
assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR));
- write_buffer_descriptor(device, set->dynamic_descriptors + dst_offset, src);
+ write_buffer_descriptor(device,
+ set->dynamic_descriptors + dst_offset,
+ (const VkDescriptorBufferInfo *) src);
break;
}
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
- write_buffer_descriptor(device, ptr, src);
+ write_buffer_descriptor(device, ptr,
+ (const VkDescriptorBufferInfo *) src);
break;
case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
break;
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: {
- write_image_descriptor(ptr, templ->entry[i].descriptor_type, src);
+ write_image_descriptor(ptr, templ->entry[i].descriptor_type,
+ (const VkDescriptorImageInfo *) src);
break;
}
case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
write_combined_image_sampler_descriptor(ptr,
templ->entry[i].descriptor_type,
- src,
+ (const VkDescriptorImageInfo *) src,
templ->entry[i].has_sampler);
if (samplers)
write_sampler_push(ptr + A6XX_TEX_CONST_DWORDS, &samplers[j]);
case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
/* nothing in descriptor set - framebuffer state is used instead */
if (TU_DEBUG(DYNAMIC))
- write_image_descriptor(ptr, templ->entry[i].descriptor_type, src);
+ write_image_descriptor(ptr, templ->entry[i].descriptor_type,
+ (const VkDescriptorImageInfo *) src);
break;
default:
unreachable("unimplemented descriptor type");
TU_FROM_HANDLE(tu_device, device, _device);
struct tu_sampler_ycbcr_conversion *conversion;
- conversion = vk_object_alloc(&device->vk, pAllocator, sizeof(*conversion),
- VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION);
+ conversion = (struct tu_sampler_ycbcr_conversion *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*conversion),
+ VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION);
if (!conversion)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
tu_immutable_samplers(const struct tu_descriptor_set_layout *set,
const struct tu_descriptor_set_binding_layout *binding)
{
- return (void *) ((const char *) set + binding->immutable_samplers_offset);
+ return (struct tu_sampler *) ((const char *) set +
+ binding->immutable_samplers_offset);
}
static inline const struct tu_sampler_ycbcr_conversion *
if (!binding->ycbcr_samplers_offset)
return NULL;
- return (void *) ((const char *) set + binding->ycbcr_samplers_offset);
+ return (
+ struct tu_sampler_ycbcr_conversion *) ((const char *) set +
+ binding->ycbcr_samplers_offset);
}
#endif /* TU_DESCRIPTOR_SET_H */
memset(uuid, 0, VK_UUID_SIZE);
_mesa_sha1_init(&ctx);
- if (!disk_cache_get_function_identifier(tu_device_get_cache_uuid, &ctx))
+ if (!disk_cache_get_function_identifier((void *)tu_device_get_cache_uuid, &ctx))
return -1;
_mesa_sha1_update(&ctx, &family, sizeof(family));
if (pAllocator == NULL)
pAllocator = vk_default_allocator();
- instance = vk_zalloc(pAllocator, sizeof(*instance), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+ instance = (struct tu_instance *) vk_zalloc(
+ pAllocator, sizeof(*instance), 8, VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!instance)
return vk_error(NULL, VK_ERROR_OUT_OF_HOST_MEMORY);
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: {
- VkPhysicalDevice4444FormatsFeaturesEXT *features = (void *)ext;
+ VkPhysicalDevice4444FormatsFeaturesEXT *features =
+ (VkPhysicalDevice4444FormatsFeaturesEXT *) ext;
features->formatA4R4G4B4 = true;
features->formatA4B4G4R4 = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT: {
- VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *features = (void *)ext;
+ VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *features =
+ (VkPhysicalDeviceBorderColorSwizzleFeaturesEXT *) ext;
features->borderColorSwizzle = true;
features->borderColorSwizzleFromImage = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
- VkPhysicalDeviceCustomBorderColorFeaturesEXT *features = (void *) ext;
+ VkPhysicalDeviceCustomBorderColorFeaturesEXT *features =
+ (VkPhysicalDeviceCustomBorderColorFeaturesEXT *) ext;
features->customBorderColors = true;
features->customBorderColorWithoutFormat = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT: {
- VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *features = (void *)ext;
+ VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *features =
+ (VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *) ext;
features->extendedDynamicState = true;
break;
}
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES: {
- VkPhysicalDeviceScalarBlockLayoutFeatures *features = (void *)ext;
+ VkPhysicalDeviceScalarBlockLayoutFeatures *features =
+ (VkPhysicalDeviceScalarBlockLayoutFeatures *) ext;
features->scalarBlockLayout = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
- VkPhysicalDeviceRobustness2FeaturesEXT *features = (void *)ext;
+ VkPhysicalDeviceRobustness2FeaturesEXT *features =
+ (VkPhysicalDeviceRobustness2FeaturesEXT *) ext;
features->robustBufferAccess2 = true;
features->robustImageAccess2 = true;
features->nullDescriptor = true;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT: {
- VkPhysicalDeviceCustomBorderColorPropertiesEXT *props = (void *)ext;
+ VkPhysicalDeviceCustomBorderColorPropertiesEXT *props =
+ (VkPhysicalDeviceCustomBorderColorPropertiesEXT *) ext;
props->maxCustomBorderColorSamplers = TU_BORDER_COLOR_COUNT;
break;
}
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_PROPERTIES_EXT: {
- VkPhysicalDeviceRobustness2PropertiesEXT *props = (void *)ext;
+ VkPhysicalDeviceRobustness2PropertiesEXT *props =
+ (VkPhysicalDeviceRobustness2PropertiesEXT *) ext;
/* see write_buffer_descriptor() */
props->robustStorageBufferAccessSizeAlignment = 4;
/* see write_ubo_descriptor() */
vk_foreach_struct(ext, p->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR: {
- VkQueueFamilyGlobalPriorityPropertiesKHR *props = (void *)ext;
+ VkQueueFamilyGlobalPriorityPropertiesKHR *props =
+ (VkQueueFamilyGlobalPriorityPropertiesKHR *) ext;
tu_physical_device_get_global_priority_properties(pdevice, props);
break;
}
{
struct tu_device *device =
container_of(utctx, struct tu_device, trace_context);
- struct tu_bo *bo = timestamps;
+ struct tu_bo *bo = (struct tu_bo *) timestamps;
tu_bo_finish(device, bo);
}
tu_trace_record_ts(struct u_trace *ut, void *cs, void *timestamps,
unsigned idx, bool end_of_pipe)
{
- struct tu_bo *bo = timestamps;
- struct tu_cs *ts_cs = cs;
+ struct tu_bo *bo = (struct tu_bo *) timestamps;
+ struct tu_cs *ts_cs = (struct tu_cs *) cs;
unsigned ts_offset = idx * sizeof(uint64_t);
tu_cs_emit_pkt7(ts_cs, CP_EVENT_WRITE, 4);
{
struct tu_device *device =
container_of(utctx, struct tu_device, trace_context);
- struct tu_bo *bo = timestamps;
- struct tu_u_trace_submission_data *submission_data = flush_data;
+ struct tu_bo *bo = (struct tu_bo *) timestamps;
+ struct tu_u_trace_submission_data *submission_data =
+ (struct tu_u_trace_submission_data *) flush_data;
/* Only need to stall on results for the first entry: */
if (idx == 0) {
return U_TRACE_NO_TIMESTAMP;
}
- uint64_t *ts = bo->map;
+ uint64_t *ts = (uint64_t *) bo->map;
/* Don't translate the no-timestamp marker: */
if (ts[idx] == U_TRACE_NO_TIMESTAMP)
{
struct tu_device *device =
container_of(utctx, struct tu_device, trace_context);
- struct tu_u_trace_submission_data *submission_data = flush_data;
+ struct tu_u_trace_submission_data *submission_data =
+ (struct tu_u_trace_submission_data *) flush_data;
tu_u_trace_submission_data_finish(device, submission_data);
}
void *ts_to, uint32_t to_offset,
uint32_t count)
{
- struct tu_cs *cs = cmdstream;
- struct tu_bo *bo_from = ts_from;
- struct tu_bo *bo_to = ts_to;
+ struct tu_cs *cs = (struct tu_cs *) cmdstream;
+ struct tu_bo *bo_from = (struct tu_bo *) ts_from;
+ struct tu_bo *bo_to = (struct tu_bo *) ts_to;
tu_cs_emit_pkt7(cs, CP_MEMCPY, 5);
tu_cs_emit(cs, count * sizeof(uint64_t) / sizeof(uint32_t));
tu_create_copy_timestamp_cs(struct tu_cmd_buffer *cmdbuf, struct tu_cs** cs,
struct u_trace **trace_copy)
{
- *cs = vk_zalloc(&cmdbuf->device->vk.alloc, sizeof(struct tu_cs), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ *cs = (struct tu_cs *) vk_zalloc(&cmdbuf->device->vk.alloc,
+ sizeof(struct tu_cs), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (*cs == NULL) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
tu_cs_emit_wfi(*cs);
tu_cs_emit_pkt7(*cs, CP_WAIT_FOR_ME, 0);
- *trace_copy = vk_zalloc(&cmdbuf->device->vk.alloc, sizeof(struct u_trace), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ *trace_copy = (struct u_trace *) vk_zalloc(
+ &cmdbuf->device->vk.alloc, sizeof(struct u_trace), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (*trace_copy == NULL) {
return VK_ERROR_OUT_OF_HOST_MEMORY;
uint32_t cmd_buffer_count,
struct tu_u_trace_submission_data **submission_data)
{
- *submission_data =
+ *submission_data = (struct tu_u_trace_submission_data *)
vk_zalloc(&device->vk.alloc,
sizeof(struct tu_u_trace_submission_data), 8,
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
struct tu_u_trace_submission_data *data = *submission_data;
- data->cmd_trace_data =
- vk_zalloc(&device->vk.alloc,
- cmd_buffer_count * sizeof(struct tu_u_trace_cmd_data), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ data->cmd_trace_data = (struct tu_u_trace_cmd_data *) vk_zalloc(
+ &device->vk.alloc,
+ cmd_buffer_count * sizeof(struct tu_u_trace_cmd_data), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!data->cmd_trace_data) {
goto fail;
tu_reg_stomper_options,
TU_DEBUG_REG_STOMP_CMDBUF);
- struct tu_cs *cmdbuf_cs = calloc(1, sizeof(struct tu_cs));
+ struct tu_cs *cmdbuf_cs = (struct tu_cs *) calloc(1, sizeof(struct tu_cs));
tu_cs_init(cmdbuf_cs, device, TU_CS_MODE_GROW, 4096,
"cmdbuf reg stomp cs");
tu_cs_begin(cmdbuf_cs);
- struct tu_cs *rp_cs = calloc(1, sizeof(struct tu_cs));
+ struct tu_cs *rp_cs = (struct tu_cs *) calloc(1, sizeof(struct tu_cs));
tu_cs_init(rp_cs, device, TU_CS_MODE_GROW, 4096, "rp reg stomp cs");
tu_cs_begin(rp_cs);
vk_foreach_struct_const(ext, pCreateInfo->pNext) {
switch (ext->sType) {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT: {
- const VkPhysicalDeviceCustomBorderColorFeaturesEXT *border_color_features = (const void *)ext;
+ const VkPhysicalDeviceCustomBorderColorFeaturesEXT
+ *border_color_features =
+ (const VkPhysicalDeviceCustomBorderColorFeaturesEXT *) ext;
custom_border_colors = border_color_features->customBorderColors;
border_color_without_format =
border_color_features->customBorderColorWithoutFormat;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
- VkPhysicalDeviceRobustness2FeaturesEXT *features = (void *)ext;
+ VkPhysicalDeviceRobustness2FeaturesEXT *features =
+ (VkPhysicalDeviceRobustness2FeaturesEXT *) ext;
robust_buffer_access2 = features->robustBufferAccess2;
break;
}
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR: {
- VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *features = (void *)ext;
+ VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *features =
+ (VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR *) ext;
global_priority_query = features->globalPriorityQuery;
break;
}
}
}
- device = vk_zalloc2(&physical_device->instance->vk.alloc, pAllocator,
- sizeof(*device), 8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ device = (struct tu_device *) vk_zalloc2(
+ &physical_device->instance->vk.alloc, pAllocator, sizeof(*device), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!device)
return vk_startup_errorf(physical_device->instance, VK_ERROR_OUT_OF_HOST_MEMORY, "OOM");
const VkDeviceQueueCreateInfo *queue_create =
&pCreateInfo->pQueueCreateInfos[i];
uint32_t qfi = queue_create->queueFamilyIndex;
- device->queues[qfi] = vk_alloc(
- &device->vk.alloc, queue_create->queueCount * sizeof(struct tu_queue),
- 8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ device->queues[qfi] = (struct tu_queue *) vk_alloc(
+ &device->vk.alloc,
+ queue_create->queueCount * sizeof(struct tu_queue), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!device->queues[qfi]) {
result = vk_startup_errorf(physical_device->instance,
VK_ERROR_OUT_OF_HOST_MEMORY,
goto fail_global_bo_map;
}
- global = device->global_bo->map;
+ global = (struct tu6_global *)device->global_bo->map;
tu_init_clear_blit_shaders(device);
global->predicate = 0;
global->vtx_stats_query_not_running = 1;
*/
struct tu_cs *cs;
- if (!(device->perfcntrs_pass_cs = calloc(1, sizeof(struct tu_cs)))) {
+ if (!(device->perfcntrs_pass_cs =
+ (struct tu_cs *) calloc(1, sizeof(struct tu_cs)))) {
result = vk_startup_errorf(device->instance,
VK_ERROR_OUT_OF_HOST_MEMORY, "OOM");
goto fail_perfcntrs_pass_alloc;
}
- device->perfcntrs_pass_cs_entries = calloc(32, sizeof(struct tu_cs_entry));
+ device->perfcntrs_pass_cs_entries =
+ (struct tu_cs_entry *) calloc(32, sizeof(struct tu_cs_entry));
if (!device->perfcntrs_pass_cs_entries) {
result = vk_startup_errorf(device->instance,
VK_ERROR_OUT_OF_HOST_MEMORY, "OOM");
if (mem_heap_used > mem_heap->size)
return vk_error(device, VK_ERROR_OUT_OF_DEVICE_MEMORY);
- mem = vk_object_alloc(&device->vk, pAllocator, sizeof(*mem),
- VK_OBJECT_TYPE_DEVICE_MEMORY);
+ mem = (struct tu_device_memory *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*mem), VK_OBJECT_TYPE_DEVICE_MEMORY);
if (mem == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
return result;
}
- *ppData = mem->bo->map + offset;
+ *ppData = (char *) mem->bo->map + offset;
return VK_SUCCESS;
}
{
TU_FROM_HANDLE(tu_device, device, _device);
- struct tu_event *event =
+ struct tu_event *event = (struct tu_event *)
vk_object_alloc(&device->vk, pAllocator, sizeof(*event),
VK_OBJECT_TYPE_EVENT);
if (!event)
TU_FROM_HANDLE(tu_device, device, _device);
struct tu_buffer *buffer;
- buffer = vk_buffer_create(&device->vk, pCreateInfo, pAllocator,
- sizeof(*buffer));
+ buffer = (struct tu_buffer *) vk_buffer_create(
+ &device->vk, pCreateInfo, pAllocator, sizeof(*buffer));
if (buffer == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
size_t size = sizeof(*framebuffer);
if (!imageless)
size += sizeof(struct tu_attachment_info) * pCreateInfo->attachmentCount;
- framebuffer = vk_object_alloc(&device->vk, pAllocator, size,
- VK_OBJECT_TYPE_FRAMEBUFFER);
+ framebuffer = (struct tu_framebuffer *) vk_object_alloc(
+ &device->vk, pAllocator, size, VK_OBJECT_TYPE_FRAMEBUFFER);
if (framebuffer == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO);
- sampler = vk_object_alloc(&device->vk, pAllocator, sizeof(*sampler),
- VK_OBJECT_TYPE_SAMPLER);
+ sampler = (struct tu_sampler *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*sampler), VK_OBJECT_TYPE_SAMPLER);
if (!sampler)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
struct tu_debug_bos_entry *debug_bos;
if (!entry) {
- debug_bos = calloc(1, sizeof(struct tu_debug_bos_entry));
+ debug_bos = (struct tu_debug_bos_entry *) calloc(
+ 1, sizeof(struct tu_debug_bos_entry));
debug_bos->name = strdup(name);
_mesa_hash_table_insert(dev->bo_sizes, debug_bos->name, debug_bos);
} else {
- debug_bos = entry->data;
+ debug_bos = (struct tu_debug_bos_entry *) entry->data;
}
debug_bos->count++;
/* If we're finishing the BO, it should have been added already */
assert(entry);
- struct tu_debug_bos_entry *debug_bos = entry->data;
+ struct tu_debug_bos_entry *debug_bos =
+ (struct tu_debug_bos_entry *) entry->data;
debug_bos->count--;
debug_bos->size -= align(bo->size, 4096);
if (!debug_bos->count) {
uint32_t count = 0;
hash_table_foreach(dev->bo_sizes, entry)
{
- struct tu_debug_bos_entry *debug_bos = (void *) entry->data;
+ struct tu_debug_bos_entry *debug_bos =
+ (struct tu_debug_bos_entry *) entry->data;
util_dynarray_append(&dyn, struct tu_debug_bos_entry *, debug_bos);
size += debug_bos->size / 1024;
count += debug_bos->count;
* shrinking the array of pending entries.
*/
struct dynamic_rendering_entry *new_entry =
- util_dynarray_begin(&dev->dynamic_rendering_pending);
+ (struct dynamic_rendering_entry *) util_dynarray_begin(
+ &dev->dynamic_rendering_pending);
uint32_t entries = 0;
util_dynarray_foreach(&dev->dynamic_rendering_pending,
struct dynamic_rendering_entry, entry) {
}
}
- struct tu_cmd_buffer **new_cmds =
+ struct tu_cmd_buffer **new_cmds = (struct tu_cmd_buffer **)
vk_alloc(&dev->vk.alloc, cmds.size, alignof(struct tu_cmd_buffer *),
VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!new_cmds)
{
switch (s->sType) {
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
- external_info = (const void *) s;
+ external_info = (const VkPhysicalDeviceExternalImageFormatInfo *) s;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT:
- image_view_info = (const void *) s;
+ image_view_info = (const VkPhysicalDeviceImageViewImageFormatInfoEXT *) s;
break;
default:
break;
{
switch (s->sType) {
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
- external_props = (void *) s;
+ external_props = (VkExternalImageFormatProperties *) s;
break;
case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT:
- cubic_props = (void *) s;
+ cubic_props = (VkFilterCubicImageViewImageFormatPropertiesEXT *) s;
break;
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES:
- ycbcr_props = (void *) s;
+ ycbcr_props = (VkSamplerYcbcrConversionImageFormatProperties *) s;
break;
default:
break;
const VkSubresourceLayout *plane_layouts = NULL;
TU_FROM_HANDLE(tu_device, device, _device);
- struct tu_image *image =
+ struct tu_image *image = (struct tu_image *)
vk_object_zalloc(&device->vk, alloc, sizeof(*image), VK_OBJECT_TYPE_IMAGE);
if (!image)
TU_FROM_HANDLE(tu_device, device, _device);
struct tu_image_view *view;
- view = vk_object_alloc(&device->vk, pAllocator, sizeof(*view),
- VK_OBJECT_TYPE_IMAGE_VIEW);
+ view = (struct tu_image_view *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*view), VK_OBJECT_TYPE_IMAGE_VIEW);
if (view == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
TU_FROM_HANDLE(tu_device, device, _device);
struct tu_buffer_view *view;
- view = vk_object_alloc(&device->vk, pAllocator, sizeof(*view),
- VK_OBJECT_TYPE_BUFFER_VIEW);
+ view = (struct tu_buffer_view *) vk_object_alloc(
+ &device->vk, pAllocator, sizeof(*view), VK_OBJECT_TYPE_BUFFER_VIEW);
if (!view)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
/* grow the bo list if needed */
if (idx >= dev->bo_list_size) {
uint32_t new_len = idx + 64;
- struct drm_msm_gem_submit_bo *new_ptr =
+ struct drm_msm_gem_submit_bo *new_ptr = (struct drm_msm_gem_submit_bo *)
vk_realloc(&dev->vk.alloc, dev->bo_list, new_len * sizeof(*dev->bo_list),
8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (!new_ptr) {
memset(new_submit, 0, sizeof(struct tu_queue_submit));
- new_submit->cmd_buffers = (void *)vk_cmd_buffers;
+ new_submit->cmd_buffers = (struct tu_cmd_buffer **) vk_cmd_buffers;
new_submit->nr_cmd_buffers = vk_submit->command_buffer_count;
tu_insert_dynamic_cmdbufs(queue->device, &new_submit->cmd_buffers,
&new_submit->nr_cmd_buffers);
if (new_submit->autotune_fence)
entry_count++;
- new_submit->cmds = vk_zalloc(&queue->device->vk.alloc,
- entry_count * sizeof(*new_submit->cmds), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ new_submit->cmds = (struct drm_msm_gem_submit_cmd *) vk_zalloc(
+ &queue->device->vk.alloc, entry_count * sizeof(*new_submit->cmds), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (new_submit->cmds == NULL) {
result = vk_error(queue, VK_ERROR_OUT_OF_HOST_MEMORY);
}
/* Allocate without wait timeline semaphores */
- new_submit->in_syncobjs = vk_zalloc(&queue->device->vk.alloc,
- nr_in_syncobjs * sizeof(*new_submit->in_syncobjs), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ new_submit->in_syncobjs = (struct drm_msm_gem_submit_syncobj *) vk_zalloc(
+ &queue->device->vk.alloc,
+ nr_in_syncobjs * sizeof(*new_submit->in_syncobjs), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (new_submit->in_syncobjs == NULL) {
result = vk_error(queue, VK_ERROR_OUT_OF_HOST_MEMORY);
}
/* Allocate with signal timeline semaphores considered */
- new_submit->out_syncobjs = vk_zalloc(&queue->device->vk.alloc,
- nr_out_syncobjs * sizeof(*new_submit->out_syncobjs), 8,
- VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
+ new_submit->out_syncobjs = (struct drm_msm_gem_submit_syncobj *) vk_zalloc(
+ &queue->device->vk.alloc,
+ nr_out_syncobjs * sizeof(*new_submit->out_syncobjs), 8,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
if (new_submit->out_syncobjs == NULL) {
result = vk_error(queue, VK_ERROR_OUT_OF_HOST_MEMORY);
submit->u_trace_submission_data;
submission_data->submission_id = queue->device->submit_count;
/* We have to allocate it here since it is different between drm/kgsl */
- submission_data->syncobj =
+ submission_data->syncobj = (struct tu_u_trace_syncobj *)
vk_alloc(&queue->device->vk.alloc, sizeof(struct tu_u_trace_syncobj),
8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE);
submission_data->syncobj->fence = req.fence;
return result;
}
- struct tu_physical_device *device =
+ struct tu_physical_device *device = (struct tu_physical_device *)
vk_zalloc(&instance->vk.alloc, sizeof(*device), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!device) {
if (convert_ts_to_fd) {
kgsl_syncobj_foreach_state(syncobjs, KGSL_SYNCOBJ_STATE_TS) {
- struct pollfd *poll_fd = u_vector_add(&poll_fds);
+ struct pollfd *poll_fd = (struct pollfd *) u_vector_add(&poll_fds);
poll_fd->fd = timestamp_to_fd(sync->queue, sync->timestamp);
poll_fd->events = POLLIN;
}
}
if (num_fds) {
- struct pollfd *poll_fd = u_vector_add(&poll_fds);
+ struct pollfd *poll_fd = (struct pollfd *) u_vector_add(&poll_fds);
poll_fd->fd = timestamp_to_fd(queue, lowest_timestamp);
poll_fd->events = POLLIN;
}
if (num_fds) {
kgsl_syncobj_foreach_state(syncobjs, KGSL_SYNCOBJ_STATE_FD) {
- struct pollfd *poll_fd = u_vector_add(&poll_fds);
+ struct pollfd *poll_fd = (struct pollfd *) u_vector_add(&poll_fds);
poll_fd->fd = sync->fd;
poll_fd->events = POLLIN;
}
} else {
int ret, i;
- struct pollfd *fds = poll_fds.data;
+ struct pollfd *fds = (struct pollfd *) poll_fds.data;
uint32_t fds_count = u_vector_length(&poll_fds);
do {
ret = poll(fds, fds_count, get_relative_ms(abs_timeout_ns));
if (tu_autotune_submit_requires_fence(cmd_buffers, cmdbuf_count))
entry_count++;
- struct kgsl_command_object *cmds =
+ struct kgsl_command_object *cmds = (struct kgsl_command_object *)
vk_alloc(&queue->device->vk.alloc, sizeof(*cmds) * entry_count,
alignof(*cmds), VK_SYSTEM_ALLOCATION_SCOPE_COMMAND);
if (cmds == NULL) {
"I can't KHR_display");
}
- struct tu_physical_device *device =
+ struct tu_physical_device *device = (struct tu_physical_device *)
vk_zalloc(&instance->vk.alloc, sizeof(*device), 8,
VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
if (!device) {
attachments_offset = size;
size += pCreateInfo->attachmentCount * sizeof(pass->attachments[0]);
- pass = vk_object_zalloc(&device->vk, pAllocator, size,
- VK_OBJECT_TYPE_RENDER_PASS);
+ pass = (struct tu_render_pass *) vk_object_zalloc(
+ &device->vk, pAllocator, size, VK_OBJECT_TYPE_RENDER_PASS);
if (pass == NULL)
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
pass->attachment_count = pCreateInfo->attachmentCount;
pass->subpass_count = pCreateInfo->subpassCount;
- pass->attachments = (void *) pass + attachments_offset;
+ pass->attachments =
+ (struct tu_render_pass_attachment *) ((char *) pass +
+ attachments_offset);
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; i++) {
struct tu_render_pass_attachment *att = &pass->attachments[i];
}
if (subpass_attachment_count) {
- pass->subpass_attachments = vk_alloc2(
+ pass->subpass_attachments = (struct tu_subpass_attachment *) vk_alloc2(
&device->vk.alloc, pAllocator,
subpass_attachment_count * sizeof(struct tu_subpass_attachment), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
{
VkResult result;
- *pipeline = vk_object_zalloc(&builder->device->vk, builder->alloc,
- sizeof(**pipeline), VK_OBJECT_TYPE_PIPELINE);
+ *pipeline = (struct tu_pipeline *) vk_object_zalloc(
+ &builder->device->vk, builder->alloc, sizeof(**pipeline),
+ VK_OBJECT_TYPE_PIPELINE);
if (!*pipeline)
return VK_ERROR_OUT_OF_HOST_MEMORY;
int64_t pipeline_start = os_time_get_nano();
- pipeline = vk_object_zalloc(&dev->vk, pAllocator, sizeof(*pipeline),
- VK_OBJECT_TYPE_PIPELINE);
+ pipeline = (struct tu_pipeline *) vk_object_zalloc(
+ &dev->vk, pAllocator, sizeof(*pipeline), VK_OBJECT_TYPE_PIPELINE);
if (!pipeline)
return VK_ERROR_OUT_OF_HOST_MEMORY;
return true;
}
- strncpy(ir->pData, data, ir->dataSize);
+ strncpy((char *) ir->pData, data, ir->dataSize);
if (ir->dataSize < data_len)
return false;
pool->bo->iova + pool->stride * (query) + \
sizeof(struct query_slot) + sizeof(type) * (i)
-#define query_result_addr(pool, query, type, i) \
- pool->bo->map + pool->stride * (query) + \
- sizeof(struct query_slot) + sizeof(type) * (i)
+#define query_result_addr(pool, query, type, i) \
+ (uint64_t *) ((char *) pool->bo->map + pool->stride * (query) + \
+ sizeof(struct query_slot) + sizeof(type) * (i))
#define query_is_available(slot) slot->available
/*
* Returns a pointer to a given slot in a query pool.
*/
-static void* slot_address(struct tu_query_pool *pool, uint32_t query)
+static struct query_slot *
+slot_address(struct tu_query_pool *pool, uint32_t query)
{
- return (char*)pool->bo->map + query * pool->stride;
+ return (struct query_slot *) ((char *) pool->bo->map +
+ query * pool->stride);
}
static void
unreachable("Invalid query type");
}
- struct tu_query_pool *pool =
+ struct tu_query_pool *pool = (struct tu_query_pool *)
vk_object_alloc(&device->vk, pAllocator, pool_size,
VK_OBJECT_TYPE_QUERY_POOL);
if (!pool)
{
assert(dataSize >= stride * queryCount);
- char *result_base = pData;
+ char *result_base = (char *) pData;
VkResult result = VK_SUCCESS;
for (uint32_t i = 0; i < queryCount; i++) {
uint32_t query = firstQuery + i;
static bool
lower_instr(nir_builder *b, nir_instr *instr, void *cb_data)
{
- struct lower_instr_params *params = cb_data;
+ struct lower_instr_params *params = (struct lower_instr_params *) cb_data;
b->cursor = nir_before_instr(instr);
switch (instr->type) {
case nir_instr_type_tex:
if (intrin->intrinsic != nir_intrinsic_load_ubo)
return false;
- struct lower_instr_params *params = cb_data;
+ struct lower_instr_params *params = (struct lower_instr_params *) cb_data;
struct tu_shader *shader = params->shader;
const struct tu_pipeline_layout *layout = params->layout;
void *
tu_suballoc_bo_map(struct tu_suballoc_bo *bo)
{
- return bo->bo->map + (bo->iova - bo->bo->iova);
+ return (char *)bo->bo->map + (bo->iova - bo->bo->iova);
}