From 67f479d05794592d7a2f1752c3da9c75418c3454 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Mar 2014 19:46:11 +0100 Subject: Support for running Redshift without a graphical environment in Linux by using Direct Rendering Manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/redshift.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/redshift.c') diff --git a/src/redshift.c b/src/redshift.c index e4143fc..beecd35 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -53,6 +53,10 @@ #include "gamma-dummy.h" +#ifdef ENABLE_DRM +# include "gamma-drm.h" +#endif + #ifdef ENABLE_RANDR # include "gamma-randr.h" #endif @@ -75,6 +79,9 @@ /* Union of state data for gamma adjustment methods */ typedef union { +#ifdef ENABLE_DRM + drm_state_t drm; +#endif #ifdef ENABLE_RANDR randr_state_t randr; #endif @@ -89,6 +96,18 @@ typedef union { /* Gamma adjustment method structs */ static const gamma_method_t gamma_methods[] = { +#ifdef ENABLE_DRM + { + "drm", 0, + (gamma_method_init_func *)drm_init, + (gamma_method_start_func *)drm_start, + (gamma_method_free_func *)drm_free, + (gamma_method_print_help_func *)drm_print_help, + (gamma_method_set_option_func *)drm_set_option, + (gamma_method_restore_func *)drm_restore, + (gamma_method_set_temperature_func *)drm_set_temperature + }, +#endif #ifdef ENABLE_RANDR { "randr", 1, -- cgit v1.2.3-70-g09d2