Module: Mesa Branch: main Commit: 2e1c9b68dfe7502347a749529b8adbc13b5c6b2c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e1c9b68dfe7502347a749529b8adbc13b5c6b2c
Author: Yiwei Zhang <zzyi...@chromium.org> Date: Mon Dec 18 00:24:13 2023 -0800 venus: clang format fixes work around vk_outarray_append_typed till a better solution fits Signed-off-by: Yiwei Zhang <zzyi...@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26751> --- src/virtio/vulkan/.clang-format | 3 +++ src/virtio/vulkan/vn_android.c | 4 ++-- src/virtio/vulkan/vn_common.h | 17 ++++++++++------- src/virtio/vulkan/vn_cs.h | 5 ++++- src/virtio/vulkan/vn_device_memory.c | 2 +- src/virtio/vulkan/vn_icd.c | 3 ++- src/virtio/vulkan/vn_image.c | 6 +++--- src/virtio/vulkan/vn_pipeline.c | 3 ++- src/virtio/vulkan/vn_renderer_virtgpu.c | 4 ++-- src/virtio/vulkan/vn_wsi.c | 5 ++++- 10 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/virtio/vulkan/.clang-format b/src/virtio/vulkan/.clang-format index 4fa27125b6a..7cc1349ccc3 100644 --- a/src/virtio/vulkan/.clang-format +++ b/src/virtio/vulkan/.clang-format @@ -22,4 +22,7 @@ IncludeCategories: - Regex: '.*' Priority: 1 +ForEachMacros: + - vk_outarray_append_typed + SpaceBeforeParens: ControlStatementsExceptForEachMacros diff --git a/src/virtio/vulkan/vn_android.c b/src/virtio/vulkan/vn_android.c index de7c4b61810..3c1478103af 100644 --- a/src/virtio/vulkan/vn_android.c +++ b/src/virtio/vulkan/vn_android.c @@ -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 { diff --git a/src/virtio/vulkan/vn_common.h b/src/virtio/vulkan/vn_common.h index 8c92be469b8..f2e860e18de 100644 --- a/src/virtio/vulkan/vn_common.h +++ b/src/virtio/vulkan/vn_common.h @@ -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; } diff --git a/src/virtio/vulkan/vn_cs.h b/src/virtio/vulkan/vn_cs.h index 69d5ec83290..2916434d9e6 100644 --- a/src/virtio/vulkan/vn_cs.h +++ b/src/virtio/vulkan/vn_cs.h @@ -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) \ diff --git a/src/virtio/vulkan/vn_device_memory.c b/src/virtio/vulkan/vn_device_memory.c index 4df271695b7..6a9e34d36e6 100644 --- a/src/virtio/vulkan/vn_device_memory.c +++ b/src/virtio/vulkan/vn_device_memory.c @@ -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 = diff --git a/src/virtio/vulkan/vn_icd.c b/src/virtio/vulkan/vn_icd.c index 4a5dabdb9bb..aef6cce2b4d 100644 --- a/src/virtio/vulkan/vn_icd.c +++ b/src/virtio/vulkan/vn_icd.c @@ -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; } diff --git a/src/virtio/vulkan/vn_image.c b/src/virtio/vulkan/vn_image.c index ee2806f6e0b..265e2927d59 100644 --- a/src/virtio/vulkan/vn_image.c +++ b/src/virtio/vulkan/vn_image.c @@ -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 diff --git a/src/virtio/vulkan/vn_pipeline.c b/src/virtio/vulkan/vn_pipeline.c index 11e7d323f58..c99b85aade6 100644 --- a/src/virtio/vulkan/vn_pipeline.c +++ b/src/virtio/vulkan/vn_pipeline.c @@ -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; } diff --git a/src/virtio/vulkan/vn_renderer_virtgpu.c b/src/virtio/vulkan/vn_renderer_virtgpu.c index 57be16888b1..be057fe042d 100644 --- a/src/virtio/vulkan/vn_renderer_virtgpu.c +++ b/src/virtio/vulkan/vn_renderer_virtgpu.c @@ -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 diff --git a/src/virtio/vulkan/vn_wsi.c b/src/virtio/vulkan/vn_wsi.c index f46627984bf..7ff7210cefa 100644 --- a/src/virtio/vulkan/vn_wsi.c +++ b/src/virtio/vulkan/vn_wsi.c @@ -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;