Skip to content

Commit

Permalink
Fix DRM leasing on some compositors after !2278
Browse files Browse the repository at this point in the history
At the suggestion of @Supreeeme, this makes a change to some code I added to
the connector withdrawn handler in !2278 that causes an error when leasing
is attempted on some wayland compositors, namely niri.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2283>
  • Loading branch information
Joel-Valenciano authored and Marge Bot committed Jul 19, 2024
1 parent c6d341a commit f9d0231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xrt/compositor/main/comp_window_direct_wayland.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ comp_window_direct_wayland_create_surface(struct comp_window_direct_wayland *w,
VkResult ret = VK_ERROR_INCOMPATIBLE_DISPLAY_KHR;

if (w->selected_device == NULL || w->selected_connector == NULL || w->lease == NULL) {
COMP_ERROR(w->base.base.c, "Connector disconnected before it could be acquired");
COMP_ERROR(w->base.base.c, "Connector was disconnected before it could be acquired");
return VK_ERROR_INITIALIZATION_FAILED;
}

Expand Down Expand Up @@ -280,7 +280,7 @@ _lease_connector_withdrawn(void *data, struct wp_drm_lease_connector_v1 *wp_drm_
{
struct direct_wayland_lease_connector *conn = data;
COMP_DEBUG(conn->w->base.base.c, "Connector %s has been withdrawn by the compositor", conn->name);
if (conn == conn->w->selected_connector) {
if (conn == conn->w->selected_connector && !conn->w->lease->lease) {
conn->w->selected_connector = NULL;
}
}
Expand Down

0 comments on commit f9d0231

Please sign in to comment.