vulkan: fix random tabs to spaces
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Only the vk_time_max_deviation tab usage requires a manual fix to make
sense. Others are boring replacements.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35011>
This commit is contained in:
Yiwei Zhang 2025-05-15 17:17:08 -07:00 committed by Marge Bot
parent 360d252888
commit cc4fd7cc9d
11 changed files with 62 additions and 58 deletions

View file

@ -519,6 +519,11 @@ vn_physical_device_sanitize_properties(struct vn_physical_device *physical_dev)
}
memcpy(props->deviceName, device_name, device_name_len + 1);
/* force prime blit on NV proprietary driver */
if (props->driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY) {
physical_dev->base.vk.supported_extensions.EXT_image_drm_format_modifier = false;
}
/* store renderer VkDriverId for implementation specific workarounds */
physical_dev->renderer_driver_id = props->driverID;
props->driverID = VK_DRIVER_ID_MESA_VENUS;

View file

@ -66,7 +66,7 @@ device_select_init_instances(void)
simple_mtx_lock(&device_select_mutex);
if (!device_select_instance_ht)
device_select_instance_ht = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
_mesa_key_pointer_equal);
simple_mtx_unlock(&device_select_mutex);
}
@ -76,8 +76,8 @@ device_select_try_free_ht(void)
simple_mtx_lock(&device_select_mutex);
if (device_select_instance_ht) {
if (_mesa_hash_table_num_entries(device_select_instance_ht) == 0) {
_mesa_hash_table_destroy(device_select_instance_ht, NULL);
device_select_instance_ht = NULL;
_mesa_hash_table_destroy(device_select_instance_ht, NULL);
device_select_instance_ht = NULL;
}
}
simple_mtx_unlock(&device_select_mutex);
@ -115,8 +115,8 @@ device_select_layer_remove_instance(VkInstance instance)
}
static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkInstance *pInstance)
const VkAllocationCallbacks *pAllocator,
VkInstance *pInstance)
{
VkLayerInstanceCreateInfo *chain_info;
for(chain_info = (VkLayerInstanceCreateInfo*)pCreateInfo->pNext; chain_info; chain_info = (VkLayerInstanceCreateInfo*)chain_info->pNext)
@ -550,8 +550,8 @@ static uint32_t get_default_device(const struct instance_info *info,
}
static VkResult device_select_EnumeratePhysicalDevices(VkInstance instance,
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice *pPhysicalDevices)
uint32_t* pPhysicalDeviceCount,
VkPhysicalDevice *pPhysicalDevices)
{
struct instance_info *info = device_select_layer_get_instance(instance);
uint32_t physical_device_count = 0;
@ -582,14 +582,14 @@ static VkResult device_select_EnumeratePhysicalDevices(VkInstance instance,
uint32_t count;
info->EnumerateDeviceExtensionProperties(physical_devices[i], NULL, &count, NULL);
if (count > 0) {
VkExtensionProperties *extensions = calloc(count, sizeof(VkExtensionProperties));
VkExtensionProperties *extensions = calloc(count, sizeof(VkExtensionProperties));
if (info->EnumerateDeviceExtensionProperties(physical_devices[i], NULL, &count, extensions) == VK_SUCCESS) {
for (unsigned j = 0; j < count; j++) {
for (unsigned j = 0; j < count; j++) {
if (!strcmp(extensions[j].extensionName, VK_EXT_PCI_BUS_INFO_EXTENSION_NAME))
info->has_pci_bus = true;
}
}
free(extensions);
free(extensions);
}
}
if (should_debug_device_selection() || (selection && strcmp(selection, "list") == 0)) {

View file

@ -156,7 +156,7 @@ static const struct zwp_linux_dmabuf_feedback_v1_listener dmabuf_feedback_listen
static void
device_select_registry_global(void *data, struct wl_registry *registry, uint32_t name,
const char *interface, uint32_t version)
const char *interface, uint32_t version)
{
struct device_select_wayland_info *info = data;
if (strcmp(interface, wl_drm_interface.name) == 0) {
@ -176,7 +176,7 @@ device_select_registry_global(void *data, struct wl_registry *registry, uint32_t
static void
device_select_registry_global_remove_cb(void *data, struct wl_registry *registry,
uint32_t name)
uint32_t name)
{
}
@ -216,19 +216,19 @@ int device_select_find_wayland_pci_default(struct device_pci_info *devices, uint
for (unsigned i = 0; i < device_count; i++) {
if (devices[i].has_bus_info) {
if (target->businfo.pci->domain == devices[i].bus_info.domain &&
target->businfo.pci->bus == devices[i].bus_info.bus &&
target->businfo.pci->dev == devices[i].bus_info.dev &&
target->businfo.pci->func == devices[i].bus_info.func) {
default_idx = i;
break;
}
if (target->businfo.pci->domain == devices[i].bus_info.domain &&
target->businfo.pci->bus == devices[i].bus_info.bus &&
target->businfo.pci->dev == devices[i].bus_info.dev &&
target->businfo.pci->func == devices[i].bus_info.func) {
default_idx = i;
break;
}
} else {
if (target->deviceinfo.pci->vendor_id == devices[i].dev_info.vendor_id &&
target->deviceinfo.pci->device_id == devices[i].dev_info.device_id) {
default_idx = i;
break;
}
if (target->deviceinfo.pci->vendor_id == devices[i].dev_info.vendor_id &&
target->deviceinfo.pci->device_id == devices[i].dev_info.device_id) {
default_idx = i;
break;
}
}
}

View file

@ -33,8 +33,8 @@
#include "device_select.h"
static int
ds_dri3_open(xcb_connection_t *conn,
xcb_window_t root,
uint32_t provider)
xcb_window_t root,
uint32_t provider)
{
xcb_dri3_open_cookie_t cookie;
xcb_dri3_open_reply_t *reply;
@ -104,15 +104,15 @@ int device_select_find_xcb_pci_default(struct device_pci_info *devices, uint32_t
for (unsigned i = 0; i < device_count; i++) {
if (devices[i].has_bus_info) {
if (xdev->businfo.pci->domain == devices[i].bus_info.domain &&
xdev->businfo.pci->bus == devices[i].bus_info.bus &&
xdev->businfo.pci->dev == devices[i].bus_info.dev &&
xdev->businfo.pci->func == devices[i].bus_info.func) {
default_idx = i;
xdev->businfo.pci->bus == devices[i].bus_info.bus &&
xdev->businfo.pci->dev == devices[i].bus_info.dev &&
xdev->businfo.pci->func == devices[i].bus_info.func) {
default_idx = i;
}
} else {
if (xdev->deviceinfo.pci->vendor_id == devices[i].dev_info.vendor_id &&
xdev->deviceinfo.pci->device_id == devices[i].dev_info.device_id)
default_idx = i;
xdev->deviceinfo.pci->device_id == devices[i].dev_info.device_id)
default_idx = i;
}
if (default_idx != -1)
break;

View file

@ -111,9 +111,9 @@ vk_device_memory_report_init(struct vk_device *device,
vk_foreach_struct_const(pnext, pCreateInfo->pNext) {
if (pnext->sType == VK_STRUCTURE_TYPE_DEVICE_DEVICE_MEMORY_REPORT_CREATE_INFO_EXT) {
const struct VkDeviceDeviceMemoryReportCreateInfoEXT *report = (void *)pnext;
mem_reports[count].callback = report->pfnUserCallback;
mem_reports[count].data = report->pUserData;
count++;
mem_reports[count].callback = report->pfnUserCallback;
mem_reports[count].data = report->pUserData;
count++;
}
}

View file

@ -455,24 +455,24 @@ vk_time_max_deviation(uint64_t begin, uint64_t end, uint64_t max_clock_period)
* period and that the application is sampling GPU and monotonic:
*
* s e
* w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e f
* Raw -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
* w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e f
* Raw -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
*
* g
* 0 1 2 3
* GPU -----_____-----_____-----_____-----_____
* 0 1 2 3
* GPU -----_____-----_____-----_____-----_____
*
* m
* x y z 0 1 2 3 4 5 6 7 8 9 a b c
* Monotonic -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
* x y z 0 1 2 3 4 5 6 7 8 9 a b c
* Monotonic -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
*
* Interval <----------------->
* Deviation <-------------------------->
* Interval <----------------->
* Deviation <-------------------------->
*
* s = read(raw) 2
* g = read(GPU) 1
* m = read(monotonic) 2
* e = read(raw) b
* s = read(raw) 2
* g = read(GPU) 1
* m = read(monotonic) 2
* e = read(raw) b
*
* We round the sample interval up by one tick to cover sampling error
* in the interval clock

View file

@ -2035,14 +2035,14 @@ copy_image_prepare_gfx_push_const(struct vk_command_buffer *cmd,
struct vk_meta_copy_image_fs_info info = {
.dst_to_src_offs = {
/* The subtraction may lead to negative values, but that's fine
* because the shader does the mirror operation thus guaranteeing
* a src_coords >= 0. */
* because the shader does the mirror operation thus guaranteeing
* a src_coords >= 0. */
.x = src_img_offs.x - region->dstOffset.x,
.y = src_img_offs.y - region->dstOffset.y,
/* Render image view only contains the layers needed for rendering,
* so we consider the coordinate containing the layer to always be
* zero.
*/
*/
.z = src_img_offs.z,
},
};

View file

@ -40,6 +40,6 @@ vk_meta_object_list_add_handle(struct vk_meta_object_list *mol,
}
void vk_meta_destroy_object(struct vk_device *device,
struct vk_object_base *obj);
struct vk_object_base *obj);
#endif

View file

@ -1565,8 +1565,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
}
if (wsi->sw)
wsi->WaitForFences(device, 1, &swapchain->fences[image_index],
true, ~0ull);
wsi->WaitForFences(device, 1, &swapchain->fences[image_index], true, ~0ull);
const VkPresentRegionKHR *region = NULL;
if (regions && regions->pRegions)

View file

@ -1856,7 +1856,7 @@ wsi_wl_surface_get_capabilities2(VkIcdSurfaceBase *surface,
static VkResult
wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface,
struct wsi_device *wsi_device,
struct wsi_device *wsi_device,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormatKHR* pSurfaceFormats)
{
@ -1900,7 +1900,7 @@ wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface,
static VkResult
wsi_wl_surface_get_formats2(VkIcdSurfaceBase *icd_surface,
struct wsi_device *wsi_device,
struct wsi_device *wsi_device,
const void *info_next,
uint32_t* pSurfaceFormatCount,
VkSurfaceFormat2KHR* pSurfaceFormats)

View file

@ -110,8 +110,8 @@ struct wsi_x11_vk_surface {
*/
static int
wsi_dri3_open(xcb_connection_t *conn,
xcb_window_t root,
uint32_t provider)
xcb_window_t root,
uint32_t provider)
{
xcb_dri3_open_cookie_t cookie;
xcb_dri3_open_reply_t *reply;
@ -2324,7 +2324,7 @@ wsi_x11_get_dri3_modifiers(struct wsi_x11_connection *wsi_conn,
counts[n] * sizeof(uint64_t),
8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (!modifiers[n]) {
if (n > 0)
if (n > 0)
vk_free(pAllocator, modifiers[0]);
free(mod_reply);
goto out;