vulkan/wsi/wayland: remove swapchain wl_drm wrapper
authorSimon Ser <contact@emersion.fr>
Thu, 24 Jun 2021 18:24:28 +0000 (20:24 +0200)
committerSimon Ser <contact@emersion.fr>
Thu, 8 Jul 2021 10:05:09 +0000 (12:05 +0200)
The sole purpose of this wl_proxy is to set the queue to
chain->display->queue. However, wl_proxy inherit their queue from
their parent, so the original wl_drm proxy already has its queue
set up properly (inherited from wl_registry).

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11589>

src/vulkan/wsi/wsi_common_wayland.c

index 4294863..4ebc059 100644 (file)
@@ -760,8 +760,6 @@ struct wsi_wl_swapchain {
 
    struct wl_surface *                          surface;
 
-   struct wl_drm *                              drm_wrapper;
-
    struct wl_callback *                         frame;
 
    VkExtent2D                                   extent;
@@ -982,7 +980,7 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain,
       assert(image->base.drm_modifier == DRM_FORMAT_MOD_INVALID);
 
       image->buffer =
-         wl_drm_create_prime_buffer(chain->drm_wrapper,
+         wl_drm_create_prime_buffer(display->drm.wl_drm,
                                     image->base.fds[0], /* name */
                                     chain->extent.width,
                                     chain->extent.height,
@@ -1023,8 +1021,6 @@ wsi_wl_swapchain_destroy(struct wsi_swapchain *wsi_chain,
       wl_callback_destroy(chain->frame);
    if (chain->surface)
       wl_proxy_wrapper_destroy(chain->surface);
-   if (chain->drm_wrapper)
-      wl_proxy_wrapper_destroy(chain->drm_wrapper);
 
    if (chain->display)
       wsi_wl_display_unref(chain->display);
@@ -1073,7 +1069,6 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
    for (uint32_t i = 0; i < num_images; i++)
       chain->images[i].buffer = NULL;
    chain->surface = NULL;
-   chain->drm_wrapper = NULL;
    chain->frame = NULL;
 
    bool alpha = pCreateInfo->compositeAlpha ==
@@ -1137,17 +1132,6 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
       }
    }
 
-   if (chain->display->drm.wl_drm) {
-      chain->drm_wrapper =
-         wl_proxy_create_wrapper(chain->display->drm.wl_drm);
-      if (!chain->drm_wrapper) {
-         result = VK_ERROR_OUT_OF_HOST_MEMORY;
-         goto fail;
-      }
-      wl_proxy_set_queue((struct wl_proxy *) chain->drm_wrapper,
-                         chain->display->queue);
-   }
-
    chain->fifo_ready = true;
 
    for (uint32_t i = 0; i < chain->base.image_count; i++) {