mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Merge wlr_udev into wlr_session
This commit is contained in:
parent
46823152ea
commit
fb93628bda
18 changed files with 292 additions and 350 deletions
|
|
@ -12,7 +12,6 @@
|
|||
#include <wlr/backend/wayland.h>
|
||||
#include <wlr/backend/multi.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include "backend/udev.h"
|
||||
|
||||
void wlr_backend_init(struct wlr_backend *backend,
|
||||
const struct wlr_backend_impl *impl) {
|
||||
|
|
@ -91,29 +90,23 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct wlr_udev *udev = wlr_udev_create(display);
|
||||
if (!udev) {
|
||||
wlr_log(L_ERROR, "Failed to start udev");
|
||||
int gpu = wlr_session_find_gpu(session);
|
||||
if (gpu == -1) {
|
||||
wlr_log(L_ERROR, "Failed to open DRM device");
|
||||
goto error_session;
|
||||
}
|
||||
|
||||
int gpu = wlr_udev_find_gpu(udev, session);
|
||||
if (gpu == -1) {
|
||||
wlr_log(L_ERROR, "Failed to open DRM device");
|
||||
goto error_udev;
|
||||
}
|
||||
|
||||
backend = wlr_multi_backend_create(session, udev);
|
||||
backend = wlr_multi_backend_create(session);
|
||||
if (!backend) {
|
||||
goto error_gpu;
|
||||
}
|
||||
|
||||
struct wlr_backend *libinput = wlr_libinput_backend_create(display, session, udev);
|
||||
struct wlr_backend *libinput = wlr_libinput_backend_create(display, session);
|
||||
if (!libinput) {
|
||||
goto error_multi;
|
||||
}
|
||||
|
||||
struct wlr_backend *drm = wlr_drm_backend_create(display, session, udev, gpu);
|
||||
struct wlr_backend *drm = wlr_drm_backend_create(display, session, gpu);
|
||||
if (!drm) {
|
||||
goto error_libinput;
|
||||
}
|
||||
|
|
@ -128,8 +121,6 @@ error_multi:
|
|||
wlr_backend_destroy(backend);
|
||||
error_gpu:
|
||||
wlr_session_close_file(session, gpu);
|
||||
error_udev:
|
||||
wlr_udev_destroy(udev);
|
||||
error_session:
|
||||
wlr_session_destroy(session);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue