[1/1] vulkan/wsi/x11: Fix properly check if the system has DRI_MODIFIERS

Submitted by Abel García Dorta on May 3, 2018, 6:10 p.m.

Details

Message ID 20180503181023.30325-2-mercuriete@gmail.com
State New
Headers show
Series "vulkan/wsi/x11: Fix properly check if the system has DRI_MODIFIERS" ( rev: 2 ) in Mesa

Not browsing as part of any series.

Commit Message

Abel García Dorta May 3, 2018, 6:10 p.m.
From: Abel Garcia Dorta <mercuriete@gmail.com>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106180

Fixes: c80c08e226 "vulkan/wsi/x11: Add support for DRI3 v1.2"

Cc: <mesa-stable@lists.freedesktop.org>
---
 src/vulkan/wsi/wsi_common_x11.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 3a00caddfb..ee7b247ee1 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1055,10 +1055,7 @@  x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
    image->pixmap = xcb_generate_id(chain->conn);
 
 #ifdef HAVE_DRI3_MODIFIERS
-   if (image->base.drm_modifier != DRM_FORMAT_MOD_INVALID) {
-      /* If the image has a modifier, we must have DRI3 v1.2. */
-      assert(chain->has_dri3_modifiers);
-
+   if (chain->has_dri3_modifiers && image->base.drm_modifier != DRM_FORMAT_MOD_INVALID) {
       cookie =
          xcb_dri3_pixmap_from_buffers_checked(chain->conn,
                                               image->pixmap,

Comments

On Thu, May 3, 2018 at 8:10 PM, mercuriete <mercuriete@gmail.com> wrote:
> From: Abel Garcia Dorta <mercuriete@gmail.com>
>
> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=106180
>
> Fixes: c80c08e226 "vulkan/wsi/x11: Add support for DRI3 v1.2"
>
> Cc: <mesa-stable@lists.freedesktop.org>
> ---
>  src/vulkan/wsi/wsi_common_x11.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
> index 3a00caddfb..ee7b247ee1 100644
> --- a/src/vulkan/wsi/wsi_common_x11.c
> +++ b/src/vulkan/wsi/wsi_common_x11.c
> @@ -1055,10 +1055,7 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
>     image->pixmap = xcb_generate_id(chain->conn);
>
>  #ifdef HAVE_DRI3_MODIFIERS
> -   if (image->base.drm_modifier != DRM_FORMAT_MOD_INVALID) {
> -      /* If the image has a modifier, we must have DRI3 v1.2. */
> -      assert(chain->has_dri3_modifiers);
> -
> +   if (chain->has_dri3_modifiers && image->base.drm_modifier != DRM_FORMAT_MOD_INVALID) {

I strongly suspect this is not the right fix, as it seems to be an
invariant we are trying to keep that if has_dri3_modifiers is false,
then  the modifier has to be DRM_FORMAT_MOD_INVALID. So the question
is why are we still getting a modifier.
>        cookie =
>           xcb_dri3_pixmap_from_buffers_checked(chain->conn,
>                                                image->pixmap,
> --
> 2.16.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev