venus: clang format fixes

work around vk_outarray_append_typed till a better solution fits

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751>
This commit is contained in:
Yiwei Zhang 2023-12-18 00:24:13 -08:00 committed by Marge Bot
parent 18abdb8596
commit 2e1c9b68df
10 changed files with 33 additions and 19 deletions

View file

@ -22,4 +22,7 @@ IncludeCategories:
- Regex: '.*'
Priority: 1
ForEachMacros:
- vk_outarray_append_typed
SpaceBeforeParens: ControlStatementsExceptForEachMacros

View file

@ -28,8 +28,8 @@
#include "vn_queue.h"
/* perform options supported by CrOS Gralloc */
#define CROS_GRALLOC_DRM_GET_BUFFER_INFO 4
#define CROS_GRALLOC_DRM_GET_USAGE 5
#define CROS_GRALLOC_DRM_GET_BUFFER_INFO 4
#define CROS_GRALLOC_DRM_GET_USAGE 5
#define CROS_GRALLOC_DRM_GET_USAGE_FRONT_RENDERING_BIT 0x1
struct vn_android_gralloc {

View file

@ -49,11 +49,11 @@
#include "vn_entrypoints.h"
#define VN_DEFAULT_ALIGN 8
#define VN_DEFAULT_ALIGN 8
#define VN_WATCHDOG_REPORT_PERIOD_US 3000000
#define VN_DEBUG(category) (unlikely(vn_env.debug & VN_DEBUG_##category))
#define VN_PERF(category) (unlikely(vn_env.perf & VN_PERF_##category))
#define VN_PERF(category) (unlikely(vn_env.perf & VN_PERF_##category))
#define vn_error(instance, error) \
(VN_DEBUG(RESULT) ? vn_log_result((instance), (error), __func__) : (error))
@ -61,7 +61,7 @@
((result) >= VK_SUCCESS ? (result) : vn_error((instance), (result)))
#define VN_TRACE_SCOPE(name) MESA_TRACE_SCOPE(name)
#define VN_TRACE_FUNC() MESA_TRACE_SCOPE(__func__)
#define VN_TRACE_FUNC() MESA_TRACE_SCOPE(__func__)
struct vn_instance;
struct vn_physical_device;
@ -235,7 +235,10 @@ vn_log_result(struct vn_instance *instance,
const char *where);
#define VN_REFCOUNT_INIT(val) \
(struct vn_refcount) { .count = (val), }
(struct vn_refcount) \
{ \
.count = (val), \
}
static inline int
vn_refcount_load_relaxed(const struct vn_refcount *ref)
@ -354,9 +357,9 @@ vn_physical_device_base_init(
const struct vk_device_extension_table *supported_extensions,
const struct vk_physical_device_dispatch_table *dispatch_table)
{
VkResult result =
vk_physical_device_init(&physical_dev->base, &instance->base,
supported_extensions, NULL, NULL, dispatch_table);
VkResult result = vk_physical_device_init(
&physical_dev->base, &instance->base, supported_extensions, NULL, NULL,
dispatch_table);
physical_dev->id = (uintptr_t)physical_dev;
return result;
}

View file

@ -11,7 +11,10 @@
#include "venus-protocol/vn_protocol_driver_info.h"
#define VN_CS_ENCODER_BUFFER_INITIALIZER(storage) \
(struct vn_cs_encoder_buffer) { .base = storage, }
(struct vn_cs_encoder_buffer) \
{ \
.base = storage, \
}
/* note that buffers points to an unamed local variable */
#define VN_CS_ENCODER_INITIALIZER_LOCAL(storage, size) \

View file

@ -486,7 +486,7 @@ vn_device_memory_alloc(struct vn_device *dev,
{
struct vk_device_memory *mem_vk = &mem->base.base;
const VkMemoryType *mem_type = &dev->physical_device->memory_properties
.memoryTypes[mem_vk->memory_type_index];
.memoryTypes[mem_vk->memory_type_index];
const bool has_guest_vram = dev->renderer->info.has_guest_vram;
const bool host_visible =

View file

@ -21,5 +21,6 @@ vk_icdGetInstanceProcAddr(VkInstance instance, const char *pName)
bool
vn_icd_supports_api_version(uint32_t api_version)
{
return vk_get_negotiated_icd_version() >= 5 || api_version < VK_API_VERSION_1_1;
return vk_get_negotiated_icd_version() >= 5 ||
api_version < VK_API_VERSION_1_1;
}

View file

@ -519,9 +519,9 @@ vn_GetImageSparseMemoryRequirements2(
}
/* TODO local or per-device cache */
vn_call_vkGetImageSparseMemoryRequirements2(dev->primary_ring, device, pInfo,
pSparseMemoryRequirementCount,
pSparseMemoryRequirements);
vn_call_vkGetImageSparseMemoryRequirements2(
dev->primary_ring, device, pInfo, pSparseMemoryRequirementCount,
pSparseMemoryRequirements);
}
static void

View file

@ -1305,7 +1305,8 @@ vn_fix_graphics_pipeline_create_infos(
if (fix_descs[i].erase.multisample_state_sample_mask) {
/* Swap original pMultisampleState with temporary state. */
fix_tmp->multisample_state_infos[i] = *infos[i].pMultisampleState;
fix_tmp->infos[i].pMultisampleState = &fix_tmp->multisample_state_infos[i];
fix_tmp->infos[i].pMultisampleState =
&fix_tmp->multisample_state_infos[i];
fix_tmp->multisample_state_infos[i].pSampleMask = NULL;
}

View file

@ -37,8 +37,8 @@
/* XXX comment these out to really use kernel uapi */
#define SIMULATE_BO_SIZE_FIX 1
#define SIMULATE_SYNCOBJ 1
#define SIMULATE_SUBMIT 1
#define SIMULATE_SYNCOBJ 1
#define SIMULATE_SUBMIT 1
#define VIRTGPU_PCI_VENDOR_ID 0x1af4
#define VIRTGPU_PCI_DEVICE_ID 0x1050

View file

@ -80,7 +80,10 @@ vn_wsi_init(struct vn_physical_device *physical_dev)
VkResult result = wsi_device_init(
&physical_dev->wsi_device, vn_physical_device_to_handle(physical_dev),
vn_wsi_proc_addr, alloc, -1, &physical_dev->instance->dri_options,
&(struct wsi_device_options){.sw_device = false, .extra_xwayland_image = true});
&(struct wsi_device_options){
.sw_device = false,
.extra_xwayland_image = true,
});
if (result != VK_SUCCESS)
return result;