aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-06 17:28:08 +0100
committerSimon Ser <contact@emersion.fr>2022-12-07 17:44:51 +0100
commit602f0d3be5789db723870f92d3492f2ff8dbac71 (patch)
tree05c0cf28b6ff010120ed1f4460ecea48046c5e17 /backend
parentbc2d2e853b577b18db268da6e5bbc1141c24d001 (diff)
backend/drm: pass fb as arg in set_plane_props()
plane_get_next_fb() will go away in subsequent commits. Primary and cursor will differ with the new logic. Let's prepare for this.
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/atomic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index c337782c..affb0223 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -171,10 +171,11 @@ static void plane_disable(struct atomic *atom, struct wlr_drm_plane *plane) {
}
static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm,
- struct wlr_drm_plane *plane, uint32_t crtc_id, int32_t x, int32_t y) {
+ struct wlr_drm_plane *plane, struct wlr_drm_fb *fb, uint32_t crtc_id,
+ int32_t x, int32_t y) {
uint32_t id = plane->id;
const union wlr_drm_plane_props *props = &plane->props;
- struct wlr_drm_fb *fb = plane_get_next_fb(plane);
+
if (fb == NULL) {
wlr_log(WLR_ERROR, "Failed to acquire FB for plane %"PRIu32, plane->id);
atom->failed = true;
@@ -293,15 +294,16 @@ static bool atomic_crtc_commit(struct wlr_drm_connector *conn,
if (crtc->props.vrr_enabled != 0) {
atomic_add(&atom, crtc->id, crtc->props.vrr_enabled, vrr_enabled);
}
- set_plane_props(&atom, drm, crtc->primary, crtc->id, 0, 0);
+ set_plane_props(&atom, drm, crtc->primary, plane_get_next_fb(crtc->primary),
+ crtc->id, 0, 0);
if (crtc->primary->props.fb_damage_clips != 0) {
atomic_add(&atom, crtc->primary->id,
crtc->primary->props.fb_damage_clips, fb_damage_clips);
}
if (crtc->cursor) {
if (drm_connector_is_cursor_visible(conn)) {
- set_plane_props(&atom, drm, crtc->cursor, crtc->id,
- conn->cursor_x, conn->cursor_y);
+ set_plane_props(&atom, drm, crtc->cursor, plane_get_next_fb(crtc->cursor),
+ crtc->id, conn->cursor_x, conn->cursor_y);
} else {
plane_disable(&atom, crtc->cursor);
}