diff options
author | Simon Ser <contact@emersion.fr> | 2021-04-06 19:31:40 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-06-13 10:57:17 +0200 |
commit | f55b43ddd6ba5ceb66f730d897920ddb7befd772 (patch) | |
tree | 18f1c72544019326ec9d7aaef17370bdb23c3bfe | |
parent | cb378600e4389cb8e9c1eca80e5b1851b671def9 (diff) |
backend/drm: allocate a CRTC in drm_connector_test
We can't perform a test-only atomic commit if the connector is
missing a CRTC.
-rw-r--r-- | backend/drm/drm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 7cbc8762..bff2b5d8 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -414,6 +414,8 @@ static bool test_buffer(struct wlr_drm_connector *conn, return drm_crtc_commit(conn, &conn->output.pending, DRM_MODE_ATOMIC_TEST_ONLY); } +static bool drm_connector_alloc_crtc(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); @@ -427,6 +429,14 @@ static bool drm_connector_test(struct wlr_output *output) { } } + if (drm_connector_state_active(conn, &output->pending)) { + if (!drm_connector_alloc_crtc(conn)) { + wlr_drm_conn_log(conn, WLR_DEBUG, + "No CRTC available for this connector"); + 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)) { |