aboutsummaryrefslogtreecommitdiffstats
path: root/src/gamma-drm.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2025-03-05 09:14:17 +0100
committerMattias Andrée <m@maandree.se>2025-03-05 09:14:17 +0100
commit6c518351ef1a7fc144d3689165fbe582d1ee72fc (patch)
treedaf5f57999a889a14506de4af7136d025476d338 /src/gamma-drm.c
parentUpdate my e-mail address (diff)
parentAdd coopgamma backend (diff)
downloadredshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.gz
redshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.bz2
redshift-ng-6c518351ef1a7fc144d3689165fbe582d1ee72fc.tar.xz
Merge branch 'coopgamma' of https://github.com/maandree/redshift
Diffstat (limited to 'src/gamma-drm.c')
-rw-r--r--src/gamma-drm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gamma-drm.c b/src/gamma-drm.c
index 088957d..dec7074 100644
--- a/src/gamma-drm.c
+++ b/src/gamma-drm.c
@@ -85,7 +85,7 @@ drm_init(drm_state_t **state)
}
static int
-drm_start(drm_state_t *state)
+drm_start(drm_state_t *state, program_mode_t mode)
{
/* Acquire access to a graphics card. */
long maxlen = strlen(DRM_DIR_NAME) + strlen(DRM_DEV_NAME) + 10;
@@ -277,7 +277,7 @@ drm_set_temperature(
drm_state_t *state, const color_setting_t *setting, int preserve)
{
drm_crtc_state_t *crtcs = state->crtcs;
- int last_gamma_size = 0;
+ uint32_t last_gamma_size = 0;
uint16_t *r_gamma = NULL;
uint16_t *g_gamma = NULL;
uint16_t *b_gamma = NULL;
@@ -303,16 +303,16 @@ drm_set_temperature(
}
/* Initialize gamma ramps to pure state */
- int ramp_size = crtcs->gamma_size;
- for (int i = 0; i < ramp_size; i++) {
+ uint32_t ramp_size = crtcs->gamma_size;
+ for (uint32_t 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);
+ colorramp_fill_u16(r_gamma, g_gamma, b_gamma, crtcs->gamma_size,
+ crtcs->gamma_size, crtcs->gamma_size, setting);
drmModeCrtcSetGamma(state->fd, crtcs->crtc_id, crtcs->gamma_size,
r_gamma, g_gamma, b_gamma);
}