Do not modeset disabled outputs

This commit is contained in:
emersion 2018-09-01 18:30:41 +02:00
parent bf670b84c4
commit 472476ebcf
1 changed files with 12 additions and 12 deletions

View File

@ -822,12 +822,6 @@ void handle_new_output(struct wl_listener *listener, void *data) {
wlr_output->model, wlr_output->serial, wlr_output->phys_width, wlr_output->model, wlr_output->serial, wlr_output->phys_width,
wlr_output->phys_height); wlr_output->phys_height);
if (!wl_list_empty(&wlr_output->modes)) {
struct wlr_output_mode *mode =
wl_container_of((&wlr_output->modes)->prev, mode, link);
wlr_output_set_mode(wlr_output, mode);
}
struct roots_output *output = calloc(1, sizeof(struct roots_output)); struct roots_output *output = calloc(1, sizeof(struct roots_output));
clock_gettime(CLOCK_MONOTONIC, &output->last_frame); clock_gettime(CLOCK_MONOTONIC, &output->last_frame);
output->desktop = desktop; output->desktop = desktop;
@ -856,22 +850,28 @@ void handle_new_output(struct wl_listener *listener, void *data) {
struct roots_output_config *output_config = struct roots_output_config *output_config =
roots_config_get_output(config, wlr_output); roots_config_get_output(config, wlr_output);
if ((!output_config || output_config->enable) && !wl_list_empty(&wlr_output->modes)) {
struct wlr_output_mode *mode =
wl_container_of(wlr_output->modes.prev, mode, link);
wlr_output_set_mode(wlr_output, mode);
}
if (output_config) { if (output_config) {
if (output_config->enable) { if (output_config->enable) {
struct roots_output_mode_config *mode_config;
if (wlr_output_is_drm(wlr_output)) { if (wlr_output_is_drm(wlr_output)) {
struct roots_output_mode_config *mode_config;
wl_list_for_each(mode_config, &output_config->modes, link) { wl_list_for_each(mode_config, &output_config->modes, link) {
wlr_drm_connector_add_mode(wlr_output, &mode_config->info); wlr_drm_connector_add_mode(wlr_output, &mode_config->info);
} }
} else { } else if (!wl_list_empty(&output_config->modes)) {
if (!wl_list_empty(&output_config->modes)) { wlr_log(WLR_ERROR, "Can only add modes for DRM backend");
wlr_log(WLR_ERROR, "Can only add modes for DRM backend");
}
} }
if (output_config->mode.width) { if (output_config->mode.width) {
set_mode(wlr_output, output_config); set_mode(wlr_output, output_config);
} }
wlr_output_set_scale(wlr_output, output_config->scale); wlr_output_set_scale(wlr_output, output_config->scale);
wlr_output_set_transform(wlr_output, output_config->transform); wlr_output_set_transform(wlr_output, output_config->transform);
wlr_output_layout_add(desktop->layout, wlr_output, output_config->x, wlr_output_layout_add(desktop->layout, wlr_output, output_config->x,