From f58e5a560c88b4850065c11e32dda8795b4884cb Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Wed, 15 Feb 2017 11:27:38 -0800 Subject: [PATCH] vulkan: change DRI3 not detected message to not ask to report to vendor remove "Note: Buggy applications may crash, if they do please report to vendor" message added check for DRI2 assuming that if DRI2 is supported, you should be able to enable DRI3 in xorg.conf Signed-off-by: Jacob Lifshay --- src/vulkan/wsi/wsi_common_x11.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 64ba921..9c1b46a 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -48,6 +48,7 @@ struct wsi_x11_connection { bool has_dri3; + bool has_dri2; bool has_present; }; @@ -63,8 +64,8 @@ static struct wsi_x11_connection * wsi_x11_connection_create(const VkAllocationCallbacks *alloc, xcb_connection_t *conn) { - xcb_query_extension_cookie_t dri3_cookie, pres_cookie; - xcb_query_extension_reply_t *dri3_reply, *pres_reply; + xcb_query_extension_cookie_t dri3_cookie, dri2_cookie, pres_cookie; + xcb_query_extension_reply_t *dri3_reply, *dri2_reply, *pres_reply; struct wsi_x11_connection *wsi_conn = vk_alloc(alloc, sizeof(*wsi_conn), 8, @@ -73,21 +74,26 @@ wsi_x11_connection_create(const VkAllocationCallbacks *alloc, return NULL; dri3_cookie = xcb_query_extension(conn, 4, "DRI3"); + dri2_cookie = xcb_query_extension(conn, 4, "DRI2"); pres_cookie = xcb_query_extension(conn, 7, "PRESENT"); dri3_reply = xcb_query_extension_reply(conn, dri3_cookie, NULL); + dri2_reply = xcb_query_extension_reply(conn, dri2_cookie, NULL); pres_reply = xcb_query_extension_reply(conn, pres_cookie, NULL); - if (dri3_reply == NULL || pres_reply == NULL) { + if (dri3_reply == NULL || dri2_reply == NULL || pres_reply == NULL) { free(dri3_reply); + free(dri2_reply); free(pres_reply); vk_free(alloc, wsi_conn); return NULL; } wsi_conn->has_dri3 = dri3_reply->present != 0; + wsi_conn->has_dri2 = dri2_reply->present != 0; wsi_conn->has_present = pres_reply->present != 0; free(dri3_reply); + free(dri2_reply); free(pres_reply); return wsi_conn; @@ -266,7 +272,8 @@ VkBool32 wsi_get_physical_device_xcb_presentation_support( if (!wsi_conn->has_dri3) { fprintf(stderr, "vulkan: No DRI3 support detected - required for presentation\n"); - fprintf(stderr, "Note: Buggy applications may crash, if they do please report to vendor\n"); + if (wsi_conn->has_dri2) + fprintf(stderr, "Note: DRI2 support detected, you can probably enable DRI3 in /etc/X11/xorg.conf\n"); return false; } @@ -315,7 +322,8 @@ x11_surface_get_support(VkIcdSurfaceBase *icd_surface, if (!wsi_conn->has_dri3) { fprintf(stderr, "vulkan: No DRI3 support detected - required for presentation\n"); - fprintf(stderr, "Note: Buggy applications may crash, if they do please report to vendor\n"); + if (wsi_conn->has_dri2) + fprintf(stderr, "Note: DRI2 support detected, you can probably enable DRI3 in /etc/X11/xorg.conf\n"); *pSupported = false; return VK_SUCCESS; } -- 2.7.4