From b641168583fa0b628ce27468ba6ea6c1fa64888a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 May 2015 11:04:29 +0200 Subject: update todo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TODO b/TODO index 9e49562..3fed17c 100644 --- a/TODO +++ b/TODO @@ -10,3 +10,7 @@ Unsupported display servers: Wayland I do not think Wayland have gamma ramp support Mir I do not think Mir have gamma ramp support + +Adjustments in Quartz are reverted when the process exits, +this information must be available in the method capabilities. + -- cgit v1.2.3-70-g09d2 From c012056651d442dd2644095a79f42b55c28823bf Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 May 2015 11:47:12 +0200 Subject: update todo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 3fed17c..816981c 100644 --- a/TODO +++ b/TODO @@ -14,3 +14,5 @@ Unsupported display servers: Adjustments in Quartz are reverted when the process exits, this information must be available in the method capabilities. +Gamma ramp support test should return yes, no or maybe. + -- cgit v1.2.3-70-g09d2 From 6278cb60258ca34e8fd03de4ec15cf5f50573b7d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 7 May 2015 12:03:34 +0200 Subject: update todo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TODO b/TODO index 816981c..2b223c6 100644 --- a/TODO +++ b/TODO @@ -16,3 +16,5 @@ this information must be available in the method capabilities. Gamma ramp support test should return yes, no or maybe. +Add hotplug support. + -- cgit v1.2.3-70-g09d2 From d939dd05e1fad24820bcee4142a5fca482dbbfb7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 May 2015 16:29:18 +0200 Subject: add auto_restore to method caps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 3 --- src/lib/gamma-dummy.c.gpp | 4 +++- src/lib/gamma-linux-drm.c | 2 ++ src/lib/gamma-quartz-cg.c | 2 ++ src/lib/gamma-w32-gdi.c | 2 ++ src/lib/gamma-x-randr.c | 4 +++- src/lib/gamma-x-vidmode.c | 2 ++ src/lib/libgamma-method.h | 8 +++++++- 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 2b223c6..68a42b6 100644 --- a/TODO +++ b/TODO @@ -11,9 +11,6 @@ Unsupported display servers: Mir I do not think Mir have gamma ramp support -Adjustments in Quartz are reverted when the process exits, -this information must be available in the method capabilities. - Gamma ramp support test should return yes, no or maybe. Add hotplug support. diff --git a/src/lib/gamma-dummy.c.gpp b/src/lib/gamma-dummy.c.gpp index 96bfcc7..2c89b45 100644 --- a/src/lib/gamma-dummy.c.gpp +++ b/src/lib/gamma-dummy.c.gpp @@ -295,9 +295,11 @@ static libgamma_dummy_configurations_t libgamma_dummy_configurations = */ void libgamma_dummy_method_capabilities(libgamma_method_capabilities_t* restrict this) { + int real_method = libgamma_dummy_configurations.real_method; *this = libgamma_dummy_configurations.capabilities; - this->real = libgamma_dummy_configurations.real_method != LIBGAMMA_METHOD_DUMMY; + this->real = real_method != LIBGAMMA_METHOD_DUMMY; this->fake = this->real; + this->auto_restore = real_method == LIBGAMMA_METHOD_QUARTZ_CORE_GRAPHICS; } diff --git a/src/lib/gamma-linux-drm.c b/src/lib/gamma-linux-drm.c index 6774e02..a35f49b 100644 --- a/src/lib/gamma-linux-drm.c +++ b/src/lib/gamma-linux-drm.c @@ -114,6 +114,8 @@ void libgamma_linux_drm_method_capabilities(libgamma_method_capabilities_t* rest /* DRM is a real non-faked adjustment method */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-quartz-cg.c b/src/lib/gamma-quartz-cg.c index 7f6904a..d509ce8 100644 --- a/src/lib/gamma-quartz-cg.c +++ b/src/lib/gamma-quartz-cg.c @@ -77,6 +77,8 @@ void libgamma_quartz_cg_method_capabilities(libgamma_method_capabilities_t* rest this->fake = 0; this->real = 1; #endif + /* Gamma ramp adjustments are non-persistent. */ + this->auto_restore = 1; } diff --git a/src/lib/gamma-w32-gdi.c b/src/lib/gamma-w32-gdi.c index 8104b18..7a55b1b 100644 --- a/src/lib/gamma-w32-gdi.c +++ b/src/lib/gamma-w32-gdi.c @@ -84,6 +84,8 @@ void libgamma_w32_gdi_method_capabilities(libgamma_method_capabilities_t* restri this->fake = 0; this->real = 1; #endif + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-x-randr.c b/src/lib/gamma-x-randr.c index 21b6ca6..b3115a6 100644 --- a/src/lib/gamma-x-randr.c +++ b/src/lib/gamma-x-randr.c @@ -155,9 +155,11 @@ void libgamma_x_randr_method_capabilities(libgamma_method_capabilities_t* restri this->fixed_gamma_size = 0; /* Gamma ramp depths are fixed. */ this->fixed_gamma_depth = 1; - /* X RandR is a real non-faked adjustment method */ + /* X RandR is a real non-faked adjustment method. */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/gamma-x-vidmode.c b/src/lib/gamma-x-vidmode.c index 29fdc4f..51c86e6 100644 --- a/src/lib/gamma-x-vidmode.c +++ b/src/lib/gamma-x-vidmode.c @@ -60,6 +60,8 @@ void libgamma_x_vidmode_method_capabilities(libgamma_method_capabilities_t* rest /* X VidMode is a real non-faked adjustment method */ this->real = 1; this->fake = 0; + /* Gamma ramp adjustments are persistent. */ + this->auto_restore = 0; } diff --git a/src/lib/libgamma-method.h b/src/lib/libgamma-method.h index 90fd25c..fc402ec 100644 --- a/src/lib/libgamma-method.h +++ b/src/lib/libgamma-method.h @@ -156,7 +156,7 @@ typedef struct libgamma_method_capabilities * Whether the adjustment method supports `libgamma_crtc_restore`. */ unsigned crtc_restore : 1; - + /** * Whether the `red_gamma_size`, `green_gamma_size` and `blue_gamma_size` * fields in `libgamma_crtc_information_t` will always have the same @@ -187,6 +187,12 @@ typedef struct libgamma_method_capabilities */ unsigned fake : 1; + /** + * Whether adjustments are undone when the process disconnects from + * the display server. + */ + unsigned auto_restore : 1; + } libgamma_method_capabilities_t; -- cgit v1.2.3-70-g09d2 From 844cdcc930d369d7a752b1359101092c68e895f4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 May 2015 16:43:33 +0200 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/lib/gamma-linux-drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/gamma-linux-drm.c b/src/lib/gamma-linux-drm.c index a35f49b..0e3c152 100644 --- a/src/lib/gamma-linux-drm.c +++ b/src/lib/gamma-linux-drm.c @@ -829,7 +829,7 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric e |= (fields & LIBGAMMA_CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0; /* Store gamma ramp depth. */ this->gamma_depth = 16; - /* X RandR does not support quering gamma ramp support. */ + /* DRM does not support quering gamma ramp support. */ e |= this->gamma_support_error = _E(LIBGAMMA_CRTC_INFO_GAMMA_SUPPORT); /* Free the EDID after us. */ -- cgit v1.2.3-70-g09d2 From 60450891857950ba543ceedd6b87a938d3032cd3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 8 May 2015 17:05:44 +0200 Subject: Gamma ramp support test return yes, no or maybe. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- TODO | 2 -- src/lib/libgamma-method.h | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 68a42b6..fbee3cf 100644 --- a/TODO +++ b/TODO @@ -11,7 +11,5 @@ Unsupported display servers: Mir I do not think Mir have gamma ramp support -Gamma ramp support test should return yes, no or maybe. - Add hotplug support. diff --git a/src/lib/libgamma-method.h b/src/lib/libgamma-method.h index fc402ec..6e0cff1 100644 --- a/src/lib/libgamma-method.h +++ b/src/lib/libgamma-method.h @@ -472,6 +472,29 @@ typedef enum libgamma_subpixel_order #define LIBGAMMA_SUBPIXEL_ORDER_COUNT 6 +/** + * Answer enum to a decision problem. + */ +typedef enum libgamma_decision + { + /** + * The answer is negative. + */ + LIBGAMMA_NO = 0, + + /** + * The answer is unknown. + */ + LIBGAMMA_MAYBE = 1, + + /** + * The answer is positive. + */ + LIBGAMMA_YES = 2 + + } libgamma_decision_t; + + /** * For a `libgamma_crtc_information_t` fill in the * values for `edid` and `edid_length` and report errors to `edid_error`. @@ -755,9 +778,14 @@ typedef struct libgamma_crtc_information /** - * Non-zero gamma ramp adjustments are supported. + * `LIBGAMMA_NO` indicates that the CRTC does not support + * gamma ramp adjustments. `LIBGAMMA_MAYBE` indicates that + * the CRTC may or may not support gamma ramp adjustments, + * meaning that the display server really does not know, but + * the protocol is available. `LIBGAMMA_NO` indicates that + * the CRTC does support gamma ramp adjustments. */ - int gamma_support; + libgamma_decision_t gamma_support; /** * Zero on success, positive it holds the value `errno` had -- cgit v1.2.3-70-g09d2