diff options
Diffstat (limited to 'rootston/output.c')
-rw-r--r-- | rootston/output.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/rootston/output.c b/rootston/output.c index fd7df99c..e3b03984 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -16,6 +16,7 @@ #include "rootston/layers.h" #include "rootston/output.h" #include "rootston/server.h" +#include "backend/drm/drm.h" /** * Rotate a child's position relative to a parent. The parent size is (pw, ph), @@ -821,7 +822,7 @@ void handle_new_output(struct wl_listener *listener, void *data) { wlr_output->model, wlr_output->serial, wlr_output->phys_width, wlr_output->phys_height); - if (wl_list_length(&wlr_output->modes) > 0) { + 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); @@ -857,6 +858,17 @@ void handle_new_output(struct wl_listener *listener, void *data) { roots_config_get_output(config, wlr_output); if (output_config) { if (output_config->enable) { + struct roots_output_mode_config *mode_config; + + if (wlr_output_is_drm(wlr_output)) { + wl_list_for_each(mode_config, &output_config->modes, link) { + wlr_drm_connector_add_mode(wlr_output, &mode_config->info); + } + } else { + if (!wl_list_empty(&output_config->modes)) { + wlr_log(L_ERROR, "Can only add modes for DRM backend"); + } + } if (output_config->mode.width) { set_mode(wlr_output, output_config); } |