diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-04 22:42:36 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-08-04 22:51:40 +0200 |
commit | 1936e136df9e801b14d3b9dbf8edce75b53db9cd (patch) | |
tree | afe957eb94b26edd4a0d9a275138ecfa360eb8f5 | |
parent | df0e75ba05e20a47fa8d2264d990757100ca9983 (diff) |
backend/drm: require buffer on modeset in drm_connector_test
When testing a modeset, make sure the caller has also provided a
buffer. This allows df0e75ba05e2 ("output: try skipping buffer
allocation if the backend allows it") to work as expected with the
DRM backend.
Closes: https://github.com/swaywm/wlroots/issues/3086
-rw-r--r-- | backend/drm/drm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index cd161e02..6541d31a 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -458,6 +458,14 @@ static bool drm_connector_test(struct wlr_output *output) { } if (drm_connector_state_active(conn, &output->pending)) { + if ((output->pending.committed & + (WLR_OUTPUT_STATE_ENABLED | WLR_OUTPUT_STATE_MODE)) && + !(output->pending.committed & WLR_OUTPUT_STATE_BUFFER)) { + wlr_drm_conn_log(conn, WLR_DEBUG, + "Can't enable an output without a buffer"); + return false; + } + if (!drm_connector_alloc_crtc(conn)) { wlr_drm_conn_log(conn, WLR_DEBUG, "No CRTC available for this connector"); |