• Daniel Stone's avatar
    vulkan/wsi/wayland: Use proxy wrappers for swapchain · afbe5bf4
    Daniel Stone authored
    Though most swapchain operations used a queue, they were racy in that
    the object was created with the queue only set later, meaning that its
    event could potentially be dispatched from the default queue in between
    these two steps.
    
    Use proxy wrappers to avoid this race, also assigning wl_buffers created
    for the swapchain to the event queue.
    Signed-off-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
    Cc: mesa-stable@lists.freedesktop.org
    (cherry picked from commit 5034c615)
    [Emil Velikov: wsi_wl_swapchain is missing surface_version, move image_count]
    Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
    
    Conflicts:
    	src/vulkan/wsi/wsi_common_wayland.c
    
    Squahed with:
    
    vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
    
    Before the swapchain event queue is destroyed, all proxy objects that reference
    it must be dropped. Otherwise we risk a use-after-free if a frame callback event
    or buffer release events are received afterwards.
    This happens when an application destroys and recreates a swapchain in FIFO
    mode between two frames without using the VkSwapchainCreateInfoKHR::oldSwapchain
    mechanism to keep the old swapchain until after the next redraw.
    
    Fixes: 5034c615 ("vulkan/wsi/wayland: Use proxy wrappers for swapchain")
    Signed-off-by: Philipp Zabel's avatarPhilipp Zabel <philipp.zabel@gmail.com>
    Reviewed-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
    Cc: mesa-stable@lists.freedesktop.org
    (cherry picked from commit 1586768e)
    [Emil Velikov: image_count is not in base]
    Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
    
    Conflicts:
    	src/vulkan/wsi/wsi_common_wayland.c
    afbe5bf4
Name
Last commit
Last update
..
amd Loading commit data...
compiler Loading commit data...
egl Loading commit data...
gallium Loading commit data...
gbm Loading commit data...
getopt Loading commit data...
glx Loading commit data...
gtest Loading commit data...
hgl Loading commit data...
intel Loading commit data...
loader Loading commit data...
mapi Loading commit data...
mesa Loading commit data...
util Loading commit data...
vulkan Loading commit data...
Makefile.am Loading commit data...
SConscript Loading commit data...