aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-01-21 22:16:55 +0100
committeremersion <contact@emersion.fr>2018-01-21 22:18:06 +0100
commit59c53e8333cae17210832fb79514c4d0110c7de8 (patch)
treea2b06676b53f4f7ca075ce728155d0d442f69759 /backend
parentf704c3d42b80ad28bfd096e5467a5219c0778e3b (diff)
parente5fa4d8e8e6e81b0cdac9df2dcb1f589867c98f2 (diff)
Merge remote-tracking branch 'upstream/master' into output-damage
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c15
-rw-r--r--backend/session/logind.c4
-rw-r--r--backend/session/session.c3
-rw-r--r--backend/wayland/backend.c24
4 files changed, 38 insertions, 8 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 72fc1441..4ba36bc4 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -194,6 +194,9 @@ static bool wlr_drm_connector_swap_buffers(struct wlr_output *output) {
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
struct wlr_drm_crtc *crtc = conn->crtc;
+ if (!crtc) {
+ return false;
+ }
struct wlr_drm_plane *plane = crtc->primary;
struct gbm_bo *bo = wlr_drm_surface_swap_buffers(&plane->surf);
@@ -237,6 +240,9 @@ void wlr_drm_connector_start_renderer(struct wlr_drm_connector *conn) {
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)conn->output.backend;
struct wlr_drm_crtc *crtc = conn->crtc;
+ if (!crtc) {
+ return;
+ }
struct wlr_drm_plane *plane = crtc->primary;
struct gbm_bo *bo = wlr_drm_surface_get_front(
@@ -457,6 +463,9 @@ static bool wlr_drm_connector_set_mode(struct wlr_output *output,
}
struct wlr_drm_crtc *crtc = conn->crtc;
+ if (!crtc) {
+ return false;
+ }
wlr_log(L_DEBUG, "%s: crtc=%ju ovr=%jd pri=%jd cur=%jd", conn->output.name,
crtc - drm->crtcs,
crtc->overlay ? crtc->overlay - drm->overlay_planes : -1,
@@ -508,6 +517,9 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
struct wlr_drm_renderer *renderer = &drm->renderer;
struct wlr_drm_crtc *crtc = conn->crtc;
+ if (!crtc) {
+ return false;
+ }
struct wlr_drm_plane *plane = crtc->cursor;
// We don't have a real cursor plane, so we make a fake one
@@ -633,6 +645,9 @@ static bool wlr_drm_connector_move_cursor(struct wlr_output *output,
int x, int y) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
struct wlr_drm_backend *drm = (struct wlr_drm_backend *)output->backend;
+ if (!conn->crtc) {
+ return false;
+ }
struct wlr_drm_plane *plane = conn->crtc->cursor;
struct wlr_box box;
diff --git a/backend/session/logind.c b/backend/session/logind.c
index 0b5b2a63..1ece051f 100644
--- a/backend/session/logind.c
+++ b/backend/session/logind.c
@@ -330,7 +330,9 @@ static bool add_signal_matches(struct logind_session *session) {
static int dbus_event(int fd, uint32_t mask, void *data) {
sd_bus *bus = data;
- while (sd_bus_process(bus, NULL) > 0);
+ while (sd_bus_process(bus, NULL) > 0) {
+ // Do nothing.
+ }
return 1;
}
diff --git a/backend/session/session.c b/backend/session/session.c
index a5f17b8d..2bbbd4ef 100644
--- a/backend/session/session.c
+++ b/backend/session/session.c
@@ -307,8 +307,9 @@ size_t wlr_session_find_gpus(struct wlr_session *session,
}
const char *seat = udev_device_get_property_value(dev, "ID_SEAT");
- if (!seat)
+ if (!seat) {
seat = "seat0";
+ }
if (session->seat[0] && strcmp(session->seat, seat) != 0) {
udev_device_unref(dev);
continue;
diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c
index 32fdc2b6..f85498eb 100644
--- a/backend/wayland/backend.c
+++ b/backend/wayland/backend.c
@@ -85,12 +85,24 @@ static void wlr_wl_backend_destroy(struct wlr_backend *_backend) {
wl_event_source_remove(backend->remote_display_src);
wlr_egl_finish(&backend->egl);
- if (backend->seat) wl_seat_destroy(backend->seat);
- if (backend->shm) wl_shm_destroy(backend->shm);
- if (backend->shell) zxdg_shell_v6_destroy(backend->shell);
- if (backend->compositor) wl_compositor_destroy(backend->compositor);
- if (backend->registry) wl_registry_destroy(backend->registry);
- if (backend->remote_display) wl_display_disconnect(backend->remote_display);
+ if (backend->seat) {
+ wl_seat_destroy(backend->seat);
+ }
+ if (backend->shm) {
+ wl_shm_destroy(backend->shm);
+ }
+ if (backend->shell) {
+ zxdg_shell_v6_destroy(backend->shell);
+ }
+ if (backend->compositor) {
+ wl_compositor_destroy(backend->compositor);
+ }
+ if (backend->registry) {
+ wl_registry_destroy(backend->registry);
+ }
+ if (backend->remote_display) {
+ wl_display_disconnect(backend->remote_display);
+ }
free(backend);
}