mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-02 20:08:08 +02:00
compositor-drm: Exit if we failed to get drm master
We can do anything without drm master. Also log an error in case we fail to drop it, which will be trouble for whoever we're switching to.
This commit is contained in:
parent
5743010af0
commit
a018fb0dbf
1 changed files with 7 additions and 2 deletions
|
|
@ -795,7 +795,10 @@ vt_func(struct weston_compositor *compositor, int event)
|
|||
switch (event) {
|
||||
case TTY_ENTER_VT:
|
||||
compositor->focus = 1;
|
||||
drmSetMaster(ec->drm.fd);
|
||||
if (drmSetMaster(ec->drm.fd)) {
|
||||
fprintf(stderr, "failed to set master: %m\n");
|
||||
wl_display_terminate(compositor->wl_display);
|
||||
}
|
||||
compositor->state = ec->prev_state;
|
||||
weston_compositor_damage_all(compositor);
|
||||
wl_list_for_each(input, &compositor->input_device_list, link)
|
||||
|
|
@ -811,7 +814,9 @@ vt_func(struct weston_compositor *compositor, int event)
|
|||
wl_list_for_each(output, &ec->base.output_list, link)
|
||||
drm_output_set_cursor(output, NULL);
|
||||
|
||||
drmDropMaster(ec->drm.fd);
|
||||
if (drmDropMaster(ec->drm.fd) < 0)
|
||||
fprintf(stderr, "failed to drop master: %m\n");
|
||||
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue