[Mesa-dev] [PATCH] vulkan/wsi: Improve the DRI3 error message

Matt Turner mattst88 at gmail.com
Sat Feb 18 22:59:49 UTC 2017


On Sat, Feb 18, 2017 at 1:31 PM, Jacob Lifshay <programmerjake at gmail.com> wrote:
> This commit improves the message by telling them that they could probably
> enable DRI3.  More importantly, it includes a little heuristic to check
> to see if we're running on AMD or NVIDIA's proprietary X11 drivers and,
> if we are, doesn't emit the warning.  This way, users with both a discrete
> card and Intel graphics don't get the warning when they're just running
> on the discrete card.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99715
> Co-authored-by: Jason Ekstrand <jason.ekstrand at intel.com>
> Reviewed-by: Kai Wasserbäch <kai at dev.carbon-project.org>
> ---
>  src/vulkan/wsi/wsi_common_x11.c | 51 +++++++++++++++++++++++++++++++++--------
>  1 file changed, 41 insertions(+), 10 deletions(-)
>
> diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
> index 64ba921..e4906f1 100644
> --- a/src/vulkan/wsi/wsi_common_x11.c
> +++ b/src/vulkan/wsi/wsi_common_x11.c
> @@ -49,6 +49,7 @@
>  struct wsi_x11_connection {
>     bool has_dri3;
>     bool has_present;
> +   bool is_proprietary_x11;
>  };
>
>  struct wsi_x11 {
> @@ -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, pres_cookie, amd_cookie, nv_cookie;
> +   xcb_query_extension_reply_t *dri3_reply, *pres_reply, *amd_reply, *nv_reply;
>
>     struct wsi_x11_connection *wsi_conn =
>        vk_alloc(alloc, sizeof(*wsi_conn), 8,
> @@ -75,20 +76,43 @@ wsi_x11_connection_create(const VkAllocationCallbacks *alloc,
>     dri3_cookie = xcb_query_extension(conn, 4, "DRI3");
>     pres_cookie = xcb_query_extension(conn, 7, "PRESENT");
>
> +   /* We try to be nice to users and emit a warning if they try to use a
> +    * Vulkan application on a system without DRI3 enabled.  However, this ends
> +    * up spewing the warning when a user has, for example, both Intel
> +    * integrated graphics and a discrete card with proprietary driers and are

typo: drivers


More information about the mesa-dev mailing list