struct wsi_wayland;
+struct wsi_wl_display_drm {
+ struct wl_drm * wl_drm;
+ uint32_t capabilities;
+};
+
struct wsi_wl_display {
/* The real wl_display */
struct wl_display * wl_display;
/* Actually a proxy wrapper around the event queue */
struct wl_display * wl_display_wrapper;
struct wl_event_queue * queue;
- struct wl_drm * drm;
+
+ struct wsi_wl_display_drm drm;
struct zwp_linux_dmabuf_v1 * dmabuf;
struct wsi_wayland *wsi_wl;
struct u_vector xrgb8888;
} modifiers;
- uint32_t capabilities;
-
/* Only used for displays created by wsi_wl_display_create */
uint32_t refcount;
};
{
struct wsi_wl_display *display = data;
- display->capabilities = capabilities;
+ display->drm.capabilities = capabilities;
}
static const struct wl_drm_listener drm_listener = {
struct wsi_wl_display *display = data;
if (strcmp(interface, "wl_drm") == 0) {
- assert(display->drm == NULL);
+ assert(display->drm.wl_drm == NULL);
assert(version >= 2);
- display->drm = wl_registry_bind(registry, name, &wl_drm_interface, 2);
-
- if (display->drm)
- wl_drm_add_listener(display->drm, &drm_listener, display);
+ display->drm.wl_drm =
+ wl_registry_bind(registry, name, &wl_drm_interface, 2);
+ wl_drm_add_listener(display->drm.wl_drm, &drm_listener, display);
} else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0 && version >= 3) {
display->dmabuf =
wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface, 3);
u_vector_finish(&display->formats);
u_vector_finish(&display->modifiers.argb8888);
u_vector_finish(&display->modifiers.xrgb8888);
- if (display->drm)
- wl_drm_destroy(display->drm);
+ if (display->drm.wl_drm)
+ wl_drm_destroy(display->drm.wl_drm);
if (display->dmabuf)
zwp_linux_dmabuf_v1_destroy(display->dmabuf);
if (display->wl_display_wrapper)
/* Round-trip to get the wl_drm global */
wl_display_roundtrip_queue(display->wl_display, display->queue);
- if (!display->drm) {
+ if (!display->drm.wl_drm) {
result = VK_ERROR_SURFACE_LOST_KHR;
goto fail_registry;
}
wl_display_roundtrip_queue(display->wl_display, display->queue);
/* We need prime support */
- if (!(display->capabilities & WL_DRM_CAPABILITY_PRIME)) {
+ if (!(display->drm.capabilities & WL_DRM_CAPABILITY_PRIME)) {
result = VK_ERROR_SURFACE_LOST_KHR;
goto fail_registry;
}
* wl_drm.
*/
if (!chain->num_drm_modifiers) {
- chain->drm_wrapper = wl_proxy_create_wrapper(chain->display->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;