Skip to content

Commit

Permalink
drm: always use primary node in wlr_drm_create()
Browse files Browse the repository at this point in the history
Unlike for get_render_name(), we need to use the primary node in
wlr_drm_create().

Otherwise mesa dri2_initialize_wayland_drm() ends up calling
dri2_load_driver_dri3() instead of dri2_load_driver() for split
display/render setup. See also mesa comments about gem names with
render nodes.

Fixes: f7e3d32 ("Add a stub wl_drm implementation")
  • Loading branch information
tmlind committed Sep 6, 2021
1 parent 6a6bd4a commit 8f5f7aa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions types/wlr_drm.c
Expand Up @@ -205,15 +205,8 @@ struct wlr_drm *wlr_drm_create(struct wl_display *display,
return NULL;
}

char *node_name = NULL;
if (dev->available_nodes & (1 << DRM_NODE_RENDER)) {
node_name = strdup(dev->nodes[DRM_NODE_RENDER]);
} else {
assert(dev->available_nodes & (1 << DRM_NODE_PRIMARY));
wlr_log(WLR_DEBUG, "No DRM render node available, "
"falling back to primary node '%s'", dev->nodes[DRM_NODE_PRIMARY]);
node_name = strdup(dev->nodes[DRM_NODE_PRIMARY]);
}
assert(dev->available_nodes & (1 << DRM_NODE_PRIMARY));
char *node_name = strdup(dev->nodes[DRM_NODE_PRIMARY]);
drmFreeDevice(&dev);
if (node_name == NULL) {
return NULL;
Expand Down

0 comments on commit 8f5f7aa

Please sign in to comment.