mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
zink: don't print error messages when failing an implicit driver load
Acked-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28139>
This commit is contained in:
parent
b53a402edc
commit
e3ea55fef2
4 changed files with 66 additions and 32 deletions
|
|
@ -471,14 +471,16 @@ zink_get_physical_device_info(struct zink_screen *screen)
|
|||
// enumerate device supported extensions
|
||||
VkResult result = screen->vk.EnumerateDeviceExtensionProperties(screen->pdev, NULL, &num_extensions, NULL);
|
||||
if (result != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateDeviceExtensionProperties failed (%s)", vk_Result_to_str(result));
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateDeviceExtensionProperties failed (%s)", vk_Result_to_str(result));
|
||||
} else {
|
||||
if (num_extensions > 0) {
|
||||
VkExtensionProperties *extensions = MALLOC(sizeof(VkExtensionProperties) * num_extensions);
|
||||
if (!extensions) goto fail;
|
||||
result = screen->vk.EnumerateDeviceExtensionProperties(screen->pdev, NULL, &num_extensions, extensions);
|
||||
if (result != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateDeviceExtensionProperties failed (%s)", vk_Result_to_str(result));
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateDeviceExtensionProperties failed (%s)", vk_Result_to_str(result));
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < num_extensions; ++i) {
|
||||
|
|
|
|||
|
|
@ -163,12 +163,14 @@ zink_create_instance(struct zink_screen *screen, bool display_dev)
|
|||
// Build up the extensions from the reported ones but only for the unnamed layer
|
||||
uint32_t extension_count = 0;
|
||||
if (vk_EnumerateInstanceExtensionProperties(NULL, &extension_count, NULL) != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateInstanceExtensionProperties failed");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateInstanceExtensionProperties failed");
|
||||
} else {
|
||||
VkExtensionProperties *extension_props = malloc(extension_count * sizeof(VkExtensionProperties));
|
||||
if (extension_props) {
|
||||
if (vk_EnumerateInstanceExtensionProperties(NULL, &extension_count, extension_props) != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateInstanceExtensionProperties failed");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateInstanceExtensionProperties failed");
|
||||
} else {
|
||||
for (uint32_t i = 0; i < extension_count; i++) {
|
||||
%for ext in extensions:
|
||||
|
|
@ -186,12 +188,14 @@ zink_create_instance(struct zink_screen *screen, bool display_dev)
|
|||
uint32_t layer_count = 0;
|
||||
|
||||
if (vk_EnumerateInstanceLayerProperties(&layer_count, NULL) != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateInstanceLayerProperties failed");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateInstanceLayerProperties failed");
|
||||
} else {
|
||||
VkLayerProperties *layer_props = malloc(layer_count * sizeof(VkLayerProperties));
|
||||
if (layer_props) {
|
||||
if (vk_EnumerateInstanceLayerProperties(&layer_count, layer_props) != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumerateInstanceLayerProperties failed");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumerateInstanceLayerProperties failed");
|
||||
} else {
|
||||
for (uint32_t i = 0; i < layer_count; i++) {
|
||||
%for layer in layers:
|
||||
|
|
@ -266,7 +270,8 @@ zink_create_instance(struct zink_screen *screen, bool display_dev)
|
|||
|
||||
VkResult err = vk_CreateInstance(&ici, NULL, &screen->instance);
|
||||
if (err != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkCreateInstance failed (%s)", vk_Result_to_str(err));
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkCreateInstance failed (%s)", vk_Result_to_str(err));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1701,7 +1701,8 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor)
|
|||
VkPhysicalDevice *pdevs;
|
||||
VkResult result = VKSCR(EnumeratePhysicalDevices)(screen->instance, &pdev_count, NULL);
|
||||
if (result != VK_SUCCESS) {
|
||||
mesa_loge("ZINK: vkEnumeratePhysicalDevices failed (%s)", vk_Result_to_str(result));
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumeratePhysicalDevices failed (%s)", vk_Result_to_str(result));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1709,7 +1710,8 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor)
|
|||
|
||||
pdevs = malloc(sizeof(*pdevs) * pdev_count);
|
||||
if (!pdevs) {
|
||||
mesa_loge("ZINK: failed to allocate pdevs!");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to allocate pdevs!");
|
||||
return;
|
||||
}
|
||||
result = VKSCR(EnumeratePhysicalDevices)(screen->instance, &pdev_count, pdevs);
|
||||
|
|
@ -1736,7 +1738,8 @@ choose_pdev(struct zink_screen *screen, int64_t dev_major, int64_t dev_minor)
|
|||
unsigned pdev_count = 1;
|
||||
VkResult result = VKSCR(EnumeratePhysicalDevices)(screen->instance, &pdev_count, &pdev);
|
||||
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
|
||||
mesa_loge("ZINK: vkEnumeratePhysicalDevices failed (%s)", vk_Result_to_str(result));
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: vkEnumeratePhysicalDevices failed (%s)", vk_Result_to_str(result));
|
||||
return;
|
||||
}
|
||||
screen->pdev = pdev;
|
||||
|
|
@ -3264,10 +3267,12 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
|
||||
struct zink_screen *screen = rzalloc(NULL, struct zink_screen);
|
||||
if (!screen) {
|
||||
mesa_loge("ZINK: failed to allocate screen");
|
||||
if (!config->implicit_driver_load)
|
||||
mesa_loge("ZINK: failed to allocate screen");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
screen->implicitly_loaded = config->implicit_driver_load;
|
||||
screen->drm_fd = -1;
|
||||
|
||||
glsl_type_singleton_init_or_ref();
|
||||
|
|
@ -3287,7 +3292,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
|
||||
screen->loader_lib = util_dl_open(VK_LIBNAME);
|
||||
if (!screen->loader_lib) {
|
||||
mesa_loge("ZINK: failed to load "VK_LIBNAME);
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to load "VK_LIBNAME);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -3295,7 +3301,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
screen->vk_GetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)util_dl_get_proc_address(screen->loader_lib, "vkGetDeviceProcAddr");
|
||||
if (!screen->vk_GetInstanceProcAddr ||
|
||||
!screen->vk_GetDeviceProcAddr) {
|
||||
mesa_loge("ZINK: failed to get proc address");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to get proc address");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -3315,7 +3322,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
if (zink_debug & ZINK_DEBUG_VALIDATION) {
|
||||
if (!screen->instance_info.have_layer_KHRONOS_validation &&
|
||||
!screen->instance_info.have_layer_LUNARG_standard_validation) {
|
||||
mesa_loge("Failed to load validation layer");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Failed to load validation layer");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
|
@ -3330,12 +3338,15 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
zink_verify_instance_extensions(screen);
|
||||
|
||||
if (screen->instance_info.have_EXT_debug_utils &&
|
||||
(zink_debug & ZINK_DEBUG_VALIDATION) && !create_debug(screen))
|
||||
debug_printf("ZINK: failed to setup debug utils\n");
|
||||
(zink_debug & ZINK_DEBUG_VALIDATION) && !create_debug(screen)) {
|
||||
if (!screen->implicitly_loaded)
|
||||
debug_printf("ZINK: failed to setup debug utils\n");
|
||||
}
|
||||
|
||||
choose_pdev(screen, dev_major, dev_minor);
|
||||
if (screen->pdev == VK_NULL_HANDLE) {
|
||||
mesa_loge("ZINK: failed to choose pdev");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to choose pdev");
|
||||
goto fail;
|
||||
}
|
||||
screen->is_cpu = screen->info.props.deviceType == VK_PHYSICAL_DEVICE_TYPE_CPU;
|
||||
|
|
@ -3350,7 +3361,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
VK_FORMAT_D32_SFLOAT_S8_UINT);
|
||||
|
||||
if (!zink_get_physical_device_info(screen)) {
|
||||
debug_printf("ZINK: failed to detect features\n");
|
||||
if (!screen->implicitly_loaded)
|
||||
debug_printf("ZINK: failed to detect features\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -3393,18 +3405,21 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
|
||||
setup_renderdoc(screen);
|
||||
if (screen->threaded_submit && !util_queue_init(&screen->flush_queue, "zfq", 8, 1, UTIL_QUEUE_INIT_RESIZE_IF_FULL, screen)) {
|
||||
mesa_loge("zink: Failed to create flush queue.\n");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("zink: Failed to create flush queue.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
zink_internal_setup_moltenvk(screen);
|
||||
if (!screen->info.have_KHR_timeline_semaphore && !screen->info.feats12.timelineSemaphore) {
|
||||
mesa_loge("zink: KHR_timeline_semaphore is required");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("zink: KHR_timeline_semaphore is required");
|
||||
goto fail;
|
||||
}
|
||||
if (zink_debug & ZINK_DEBUG_DGC) {
|
||||
if (!screen->info.have_NV_device_generated_commands) {
|
||||
mesa_loge("zink: can't use DGC without NV_device_generated_commands");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("zink: can't use DGC without NV_device_generated_commands");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
|
@ -3523,7 +3538,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
if (!zink_screen_resource_init(&screen->base))
|
||||
goto fail;
|
||||
if (!zink_bo_init(screen)) {
|
||||
mesa_loge("ZINK: failed to initialize suballocator");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to initialize suballocator");
|
||||
goto fail;
|
||||
}
|
||||
zink_screen_fence_init(&screen->base);
|
||||
|
|
@ -3532,7 +3548,8 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
screen->driver_workarounds.io_opt = true;
|
||||
zink_screen_init_compiler(screen);
|
||||
if (!disk_cache_init(screen)) {
|
||||
mesa_loge("ZINK: failed to initialize disk cache");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to initialize disk cache");
|
||||
goto fail;
|
||||
}
|
||||
if (!util_queue_init(&screen->cache_get_thread, "zcfq", 8, 4,
|
||||
|
|
@ -3548,12 +3565,14 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
screen->total_video_mem = get_video_mem(screen);
|
||||
screen->clamp_video_mem = screen->total_video_mem * 0.8;
|
||||
if (!os_get_total_physical_memory(&screen->total_mem)) {
|
||||
mesa_loge("ZINK: failed to get total physical memory");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to get total physical memory");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!zink_screen_init_semaphore(screen)) {
|
||||
mesa_loge("zink: failed to create timeline semaphore");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("zink: failed to create timeline semaphore");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
@ -3561,35 +3580,40 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
{
|
||||
if (!screen->info.have_EXT_descriptor_buffer) {
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
|
||||
mesa_loge("Cannot use db descriptor mode without EXT_descriptor_buffer");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Cannot use db descriptor mode without EXT_descriptor_buffer");
|
||||
goto fail;
|
||||
}
|
||||
can_db = false;
|
||||
}
|
||||
if (!screen->resizable_bar) {
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
|
||||
mesa_loge("Cannot use db descriptor mode without resizable bar");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Cannot use db descriptor mode without resizable bar");
|
||||
goto fail;
|
||||
}
|
||||
can_db = false;
|
||||
}
|
||||
if (!screen->info.have_EXT_non_seamless_cube_map) {
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
|
||||
mesa_loge("Cannot use db descriptor mode without EXT_non_seamless_cube_map");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Cannot use db descriptor mode without EXT_non_seamless_cube_map");
|
||||
goto fail;
|
||||
}
|
||||
can_db = false;
|
||||
}
|
||||
if (!screen->info.rb2_feats.nullDescriptor) {
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
|
||||
mesa_loge("Cannot use db descriptor mode without robustness2.nullDescriptor");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Cannot use db descriptor mode without robustness2.nullDescriptor");
|
||||
goto fail;
|
||||
}
|
||||
can_db = false;
|
||||
}
|
||||
if (ZINK_FBFETCH_DESCRIPTOR_SIZE < screen->info.db_props.inputAttachmentDescriptorSize) {
|
||||
if (zink_descriptor_mode == ZINK_DESCRIPTOR_MODE_DB) {
|
||||
mesa_loge("Cannot use db descriptor mode with inputAttachmentDescriptorSize(%u) > %u", (unsigned)screen->info.db_props.inputAttachmentDescriptorSize, ZINK_FBFETCH_DESCRIPTOR_SIZE);
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("Cannot use db descriptor mode with inputAttachmentDescriptorSize(%u) > %u", (unsigned)screen->info.db_props.inputAttachmentDescriptorSize, ZINK_FBFETCH_DESCRIPTOR_SIZE);
|
||||
goto fail;
|
||||
}
|
||||
mesa_logw("zink: bug detected: inputAttachmentDescriptorSize(%u) > %u", (unsigned)screen->info.db_props.inputAttachmentDescriptorSize, ZINK_FBFETCH_DESCRIPTOR_SIZE);
|
||||
|
|
@ -3648,12 +3672,14 @@ zink_internal_create_screen(const struct pipe_screen_config *config, int64_t dev
|
|||
zink_init_screen_pipeline_libs(screen);
|
||||
|
||||
if (!init_layouts(screen)) {
|
||||
mesa_loge("ZINK: failed to initialize layouts");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to initialize layouts");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!zink_descriptor_layouts_init(screen)) {
|
||||
mesa_loge("ZINK: failed to initialize descriptor layouts");
|
||||
if (!screen->implicitly_loaded)
|
||||
mesa_loge("ZINK: failed to initialize descriptor layouts");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1415,6 +1415,7 @@ struct zink_screen {
|
|||
bool is_cpu;
|
||||
bool abort_on_hang;
|
||||
bool frame_marker_emitted;
|
||||
bool implicitly_loaded;
|
||||
uint64_t curr_batch; //the current batch id
|
||||
uint32_t last_finished;
|
||||
VkSemaphore sem;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue