aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-06 22:07:00 +0200
committerKenny Levinsen <kl@kl.wtf>2021-08-10 16:38:22 +0200
commit604674dc54a3b2cb4b73de267c8c2bcae259c4b6 (patch)
treef31c1cef100df094d2695d190b5a5a91565bf37d /backend/drm
parenteb0ce659cf2b024184e5fe4166bb7ac550f5722b (diff)
backend/drm: always perform a test commit in drm_connector_test
This allows callers to use wlr_output_test to check whether a mode can be enabled, for instance. Closes: https://github.com/swaywm/wlroots/issues/2250
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/drm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 6541d31a..0c491973 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -473,16 +473,19 @@ static bool drm_connector_test(struct wlr_output *output) {
}
}
- if ((output->pending.committed & WLR_OUTPUT_STATE_BUFFER) && !conn->backend->parent) {
+ if (conn->backend->parent) {
+ // If we're running as a secondary GPU, we can't perform an atomic
+ // commit without blitting a buffer.
+ return true;
+ }
+
+ if (output->pending.committed & WLR_OUTPUT_STATE_BUFFER) {
if (!drm_connector_set_pending_fb(conn, &output->pending)) {
return false;
}
- if (!drm_crtc_commit(conn, &output->pending, 0, true)) {
- return false;
- }
}
- return true;
+ return drm_crtc_commit(conn, &output->pending, 0, true);
}
bool drm_connector_supports_vrr(struct wlr_drm_connector *conn) {