diff options
author | Simon Ser <contact@emersion.fr> | 2020-05-17 18:49:56 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-05-26 20:10:55 +0200 |
commit | 21c6cc5e4c66ba0d53aa3876f2c0f8746bf63fba (patch) | |
tree | 1909b7a48fb9b068cba9cd4f09657271a8d51e12 /backend/drm | |
parent | 47e52128237a5b4f1a2de228e8b1d54921b77e37 (diff) |
backend/drm: refuse to enable an output without a mode
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 65734631..f052d994 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -422,6 +422,15 @@ static bool test_buffer(struct wlr_drm_connector *conn, static bool drm_connector_test(struct wlr_output *output) { struct wlr_drm_connector *conn = get_drm_connector_from_output(output); + if ((output->pending.committed & WLR_OUTPUT_STATE_ENABLED) && + output->pending.enabled) { + if (output->current_mode == NULL && + !(output->pending.committed & WLR_OUTPUT_STATE_MODE)) { + wlr_log(WLR_DEBUG, "Can't enable an output without a mode"); + return false; + } + } + if ((output->pending.committed & WLR_OUTPUT_STATE_BUFFER) && output->pending.buffer_type == WLR_OUTPUT_STATE_BUFFER_SCANOUT) { if (!test_buffer(conn, output->pending.buffer)) { |