Skip to content

wlr_gamma_control: Store gamma size when creating control

Kenny Levinsen requested to merge kennylevinsen/wlroots:early-gamma-size into master

When a wlr_gamma_control client calls set_gamma, we allocate a LUT based on the value returned from wlr_output_get_gamma_size at the time of the call.

If the output is off and has no CRTC, such as if gamma changes in the background while a display is disabled for idle reasons, wlr_output_get_gamma_size returns 0. This leads to a zero-sized table, which the drm backend interprets as a request to reset gamma tables to their default.

Store the gamma size when the gamma control was created. Even if the size changes, this is the size the client was sent and uses to create the LUTs it sends.

Merge request reports