aboutsummaryrefslogtreecommitdiffstats
path: root/src/gamma-drm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gamma-drm.c')
-rw-r--r--src/gamma-drm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gamma-drm.c b/src/gamma-drm.c
index cbdafe5..d431395 100644
--- a/src/gamma-drm.c
+++ b/src/gamma-drm.c
@@ -268,6 +268,16 @@ drm_set_temperature(drm_state_t *state, const color_setting_t *setting)
}
last_gamma_size = crtcs->gamma_size;
}
+
+ /* Initialize gamma ramps to pure state */
+ int ramp_size = crtcs->gamma_size;
+ for (int i = 0; i < ramp_size; i++) {
+ uint16_t value = (double)i/ramp_size * (UINT16_MAX+1);
+ r_gamma[i] = value;
+ g_gamma[i] = value;
+ b_gamma[i] = value;
+ }
+
colorramp_fill(r_gamma, g_gamma, b_gamma, crtcs->gamma_size,
setting);
drmModeCrtcSetGamma(state->fd, crtcs->crtc_id, crtcs->gamma_size,