|
|
@ -50,6 +50,8 @@ static void backend_destroy(struct wlr_backend *backend) {
|
|
|
|
|
|
|
|
|
|
|
|
finish_drm_resources(drm);
|
|
|
|
finish_drm_resources(drm);
|
|
|
|
finish_drm_renderer(&drm->renderer);
|
|
|
|
finish_drm_renderer(&drm->renderer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(drm->name);
|
|
|
|
wlr_session_close_file(drm->session, drm->dev);
|
|
|
|
wlr_session_close_file(drm->session, drm->dev);
|
|
|
|
wl_event_source_remove(drm->drm_event);
|
|
|
|
wl_event_source_remove(drm->drm_event);
|
|
|
|
free(drm);
|
|
|
|
free(drm);
|
|
|
@ -108,9 +110,7 @@ static void drm_invalidated(struct wl_listener *listener, void *data) {
|
|
|
|
struct wlr_drm_backend *drm =
|
|
|
|
struct wlr_drm_backend *drm =
|
|
|
|
wl_container_of(listener, drm, drm_invalidated);
|
|
|
|
wl_container_of(listener, drm, drm_invalidated);
|
|
|
|
|
|
|
|
|
|
|
|
char *name = drmGetDeviceNameFromFd2(drm->fd);
|
|
|
|
wlr_log(WLR_DEBUG, "%s invalidated", drm->name);
|
|
|
|
wlr_log(WLR_DEBUG, "%s invalidated", name);
|
|
|
|
|
|
|
|
free(name);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scan_drm_connectors(drm);
|
|
|
|
scan_drm_connectors(drm);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -137,7 +137,6 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
|
|
|
|
char *name = drmGetDeviceNameFromFd2(dev->fd);
|
|
|
|
char *name = drmGetDeviceNameFromFd2(dev->fd);
|
|
|
|
drmVersion *version = drmGetVersion(dev->fd);
|
|
|
|
drmVersion *version = drmGetVersion(dev->fd);
|
|
|
|
wlr_log(WLR_INFO, "Initializing DRM backend for %s (%s)", name, version->name);
|
|
|
|
wlr_log(WLR_INFO, "Initializing DRM backend for %s (%s)", name, version->name);
|
|
|
|
free(name);
|
|
|
|
|
|
|
|
drmFreeVersion(version);
|
|
|
|
drmFreeVersion(version);
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_drm_backend *drm = calloc(1, sizeof(struct wlr_drm_backend));
|
|
|
|
struct wlr_drm_backend *drm = calloc(1, sizeof(struct wlr_drm_backend));
|
|
|
@ -152,6 +151,7 @@ struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
|
|
|
|
|
|
|
|
|
|
|
|
drm->dev = dev;
|
|
|
|
drm->dev = dev;
|
|
|
|
drm->fd = dev->fd;
|
|
|
|
drm->fd = dev->fd;
|
|
|
|
|
|
|
|
drm->name = name;
|
|
|
|
if (parent != NULL) {
|
|
|
|
if (parent != NULL) {
|
|
|
|
drm->parent = get_drm_backend_from_backend(parent);
|
|
|
|
drm->parent = get_drm_backend_from_backend(parent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|