aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-06 18:23:35 +0200
committerKenny Levinsen <kl@kl.wtf>2021-06-13 10:57:17 +0200
commit63f891e393ca5256ad5b6847291d88c098321ed6 (patch)
treef107163f0cf5f8b495617458bfa059de9833d2fd /backend/drm/drm.c
parente89cf5f047bee4820d8a08c903f3b5664fa92558 (diff)
backend/drm: allow committing a buffer and a mode together
Set the plane's pending FB before calling drm_connector_set_mode.
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 466736b4..578944d2 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -437,7 +437,7 @@ static bool drm_connector_test(struct wlr_output *output) {
return true;
}
-static bool drm_connector_commit_buffer(struct wlr_drm_connector *conn,
+static bool drm_connector_set_pending_fb(struct wlr_drm_connector *conn,
const struct wlr_output_state *state) {
struct wlr_drm_backend *drm = conn->backend;
@@ -464,10 +464,6 @@ static bool drm_connector_commit_buffer(struct wlr_drm_connector *conn,
break;
}
- if (!drm_crtc_page_flip(conn, state)) {
- return false;
- }
-
return true;
}
@@ -509,6 +505,12 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn,
return false;
}
+ if (state.committed & WLR_OUTPUT_STATE_BUFFER) {
+ if (!drm_connector_set_pending_fb(conn, &state)) {
+ return false;
+ }
+ }
+
if (state.committed & (WLR_OUTPUT_STATE_MODE | WLR_OUTPUT_STATE_ENABLED)) {
if ((state.committed & WLR_OUTPUT_STATE_MODE) &&
state.mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM) {
@@ -526,8 +528,7 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn,
return false;
}
} else if (state.committed & WLR_OUTPUT_STATE_BUFFER) {
- // TODO: support modesetting with a buffer
- if (!drm_connector_commit_buffer(conn, &state)) {
+ if (!drm_crtc_page_flip(conn, &state)) {
return false;
}
} else if (state.committed & (WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED |