aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-14 17:26:30 +0200
committerScott Anderson <scott@anderso.nz>2020-05-14 23:55:43 +0000
commit2988ebb6f37e201ba5884aa434aa7120fa951852 (patch)
tree7b345a3d1bad7842771c915a153dc62d57e8da4a /backend/drm
parent347bdb6d9a8064e32adbfac5413c9c81fc49109b (diff)
backend/drm: fix atomic commits when the GAMMA_LUT prop is missing
We already have the logic to fallback to the legacy interface above. We just need to avoid calling atomic_add with a zero prop ID. Closes: https://github.com/swaywm/wlroots/issues/2187
Diffstat (limited to 'backend/drm')
-rw-r--r--backend/drm/atomic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index 31145504..67dfce02 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -200,7 +200,9 @@ static bool atomic_crtc_commit(struct wlr_drm_backend *drm,
atomic_add(&atom, crtc->id, crtc->props.mode_id, crtc->mode_id);
atomic_add(&atom, crtc->id, crtc->props.active, crtc->active);
if (crtc->active) {
- atomic_add(&atom, crtc->id, crtc->props.gamma_lut, crtc->gamma_lut);
+ if (crtc->props.gamma_lut != 0) {
+ atomic_add(&atom, crtc->id, crtc->props.gamma_lut, crtc->gamma_lut);
+ }
set_plane_props(&atom, drm, crtc->primary, crtc->id, 0, 0);
if (crtc->cursor) {
if (crtc->cursor->cursor_enabled) {