diff --git a/libswc/drm.c b/libswc/drm.c index c85937c..0cc6901 100644 --- a/libswc/drm.c +++ b/libswc/drm.c @@ -270,8 +270,12 @@ drm_initialize(void) drm.path = drmGetRenderDeviceNameFromFd(swc.drm->fd); if (!drm.path) { - ERROR("Could not determine render node path\n"); - goto error1; + WARNING("Could not determine render node path\n"); + drm.path = drmGetPrimaryDeviceNameFromFd(swc.drm->fd); + if (!drm.path) { + ERROR("Could not determine primary node path\n"); + goto error1; + } } if (!(swc.drm->context = wld_drm_create_context(swc.drm->fd))) { diff --git a/libswc/pointer.c b/libswc/pointer.c index 7e4d24d..89916c5 100644 --- a/libswc/pointer.c +++ b/libswc/pointer.c @@ -108,10 +108,11 @@ attach(struct view *view, struct wld_buffer *buffer) if (view_set_size_from_buffer(view, buffer)) view_update_screens(view); - wl_list_for_each (screen, &swc.screens, link) { - view_attach(&screen->planes.cursor->view, buffer ? pointer->cursor.buffer : NULL); - view_update(&screen->planes.cursor->view); - } + wl_list_for_each (screen, &swc.screens, link) + if (screen->planes.cursor) { + view_attach(&screen->planes.cursor->view, buffer ? pointer->cursor.buffer : NULL); + view_update(&screen->planes.cursor->view); + } return 0; } @@ -124,10 +125,11 @@ move(struct view *view, int32_t x, int32_t y) if (view_set_position(view, x, y)) view_update_screens(view); - wl_list_for_each (screen, &swc.screens, link) { - view_move(&screen->planes.cursor->view, view->geometry.x, view->geometry.y); - view_update(&screen->planes.cursor->view); - } + wl_list_for_each (screen, &swc.screens, link) + if (screen->planes.cursor) { + view_move(&screen->planes.cursor->view, view->geometry.x, view->geometry.y); + view_update(&screen->planes.cursor->view); + } return true; } @@ -286,7 +288,8 @@ pointer_initialize(struct pointer *pointer) pointer_set_cursor(pointer, cursor_left_ptr); wl_list_for_each (screen, &swc.screens, link) - view_attach(&screen->planes.cursor->view, pointer->cursor.buffer); + if (screen->planes.cursor) + view_attach(&screen->planes.cursor->view, pointer->cursor.buffer); input_focus_initialize(&pointer->focus, &pointer->focus_handler); pixman_region32_init(&pointer->region); diff --git a/libswc/screen.c b/libswc/screen.c index 58bf43b..add8160 100644 --- a/libswc/screen.c +++ b/libswc/screen.c @@ -121,7 +121,8 @@ screen_new(uint32_t crtc, struct output *output, struct plane *cursor_plane) goto error2; } - cursor_plane->screen = screen; + if (cursor_plane) + cursor_plane->screen = screen; screen->planes.cursor = cursor_plane; screen->handler = &null_handler;