vulkan/wsi/wayland: move some structs to beginning of code

There are some structs defined in the middle of the code. Move them
closer to where the other structs are defined.

This makes the code easier to read and also will help us in the next
commits, in which we add dma-buf feedback support.

Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12226>
This commit is contained in:
Leandro Ribeiro
2022-10-19 10:51:01 -03:00
committed by Marge Bot
parent 19b6c889be
commit 05ed116d01
+41 -41
View File
@@ -86,6 +86,47 @@ struct wsi_wayland {
VkPhysicalDevice physical_device;
};
struct wsi_wl_image {
struct wsi_image base;
struct wl_buffer * buffer;
bool busy;
int shm_fd;
void * shm_ptr;
unsigned shm_size;
};
enum wsi_wl_buffer_type {
WSI_WL_BUFFER_NATIVE,
WSI_WL_BUFFER_GPU_SHM,
WSI_WL_BUFFER_SHM_MEMCPY,
};
struct wsi_wl_swapchain {
struct wsi_swapchain base;
struct wsi_wl_display *display;
struct wl_surface * surface;
struct wl_callback * frame;
VkExtent2D extent;
VkFormat vk_format;
enum wsi_wl_buffer_type buffer_type;
uint32_t drm_format;
enum wl_shm_format shm_format;
uint32_t num_drm_modifiers;
const uint64_t * drm_modifiers;
VkPresentModeKHR present_mode;
bool fifo_ready;
struct wsi_wl_image images[0];
};
VK_DEFINE_NONDISP_HANDLE_CASTS(wsi_wl_swapchain, base.base, VkSwapchainKHR,
VK_OBJECT_TYPE_SWAPCHAIN_KHR)
enum wsi_wl_fmt_flag {
WSI_WL_FMT_ALPHA = 1 << 0,
WSI_WL_FMT_OPAQUE = 1 << 1,
@@ -905,47 +946,6 @@ wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
return VK_SUCCESS;
}
struct wsi_wl_image {
struct wsi_image base;
struct wl_buffer * buffer;
bool busy;
int shm_fd;
void * shm_ptr;
unsigned shm_size;
};
enum wsi_wl_buffer_type {
WSI_WL_BUFFER_NATIVE,
WSI_WL_BUFFER_GPU_SHM,
WSI_WL_BUFFER_SHM_MEMCPY,
};
struct wsi_wl_swapchain {
struct wsi_swapchain base;
struct wsi_wl_display *display;
struct wl_surface * surface;
struct wl_callback * frame;
VkExtent2D extent;
VkFormat vk_format;
enum wsi_wl_buffer_type buffer_type;
uint32_t drm_format;
enum wl_shm_format shm_format;
uint32_t num_drm_modifiers;
const uint64_t * drm_modifiers;
VkPresentModeKHR present_mode;
bool fifo_ready;
struct wsi_wl_image images[0];
};
VK_DEFINE_NONDISP_HANDLE_CASTS(wsi_wl_swapchain, base.base, VkSwapchainKHR,
VK_OBJECT_TYPE_SWAPCHAIN_KHR)
static struct wsi_image *
wsi_wl_swapchain_get_wsi_image(struct wsi_swapchain *wsi_chain,
uint32_t image_index)