aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-23 03:16:49 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-23 03:16:49 +0200
commitee240c08552447ccd13a1797b85508e0d333dc32 (patch)
tree503412da7e92476c14bfa16d8f45c9bbc7b5d78b /src/lib
parentmissed to stage file (diff)
downloadlibgamma-ee240c08552447ccd13a1797b85508e0d333dc32.tar.gz
libgamma-ee240c08552447ccd13a1797b85508e0d333dc32.tar.bz2
libgamma-ee240c08552447ccd13a1797b85508e0d333dc32.tar.xz
m + connector info for drm
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/libgamma-error.h10
-rw-r--r--src/libgamma-facade.c4
-rw-r--r--src/libgamma-method.h75
3 files changed, 84 insertions, 5 deletions
diff --git a/src/libgamma-error.h b/src/libgamma-error.h
index ddb71d2..ba8ec86 100644
--- a/src/libgamma-error.h
+++ b/src/libgamma-error.h
@@ -169,6 +169,16 @@ extern const char* libgamma_group_name;
*/
#define LIBGAMMA_CONNECTOR_UNKNOWN (-25)
+/**
+ * The detected connector type is not listed in this library and has to be updated
+ */
+#define LIBGAMMA_CONNECTOR_TYPE_NOT_RECOGNISED (-26)
+
+/**
+ * The detected subpixel order is not listed in this library and has to be updated
+ */
+#define LIBGAMMA_SUBPIXEL_ORDER_NOT_RECOGNISED (-27)
+
#endif
diff --git a/src/libgamma-facade.c b/src/libgamma-facade.c
index 3ef4e71..9f95c50 100644
--- a/src/libgamma-facade.c
+++ b/src/libgamma-facade.c
@@ -786,10 +786,12 @@ int libgamma_get_crtc_information(libgamma_crtc_information_t* restrict this,
libgamma_crtc_state_t* restrict crtc, int32_t fields)
{
#ifdef HAVE_NO_GAMMA_METHODS
- (void) this;
(void) fields;
#endif
+ this->edid = NULL;
+ this->connector_name = NULL;
+
switch (crtc->partition->site->method)
{
#ifdef HAVE_GAMMA_METHOD_DUMMY
diff --git a/src/libgamma-method.h b/src/libgamma-method.h
index 58b364d..c1b58b2 100644
--- a/src/libgamma-method.h
+++ b/src/libgamma-method.h
@@ -315,6 +315,73 @@ typedef struct libgamma_crtc_state
} libgamma_crtc_state_t;
+/**
+ * Types for connectors
+ */
+typedef enum libgamma_connector_type
+ {
+ /*
+ * The adjustment method does not know the connector's type
+ * (This could be considered an error)
+ */
+ LIBGAMMA_CONNECTOR_TYPE_Unknown,
+ LIBGAMMA_CONNECTOR_TYPE_VGA,
+ LIBGAMMA_CONNECTOR_TYPE_DVII,
+ LIBGAMMA_CONNECTOR_TYPE_DVID,
+ LIBGAMMA_CONNECTOR_TYPE_DVIA,
+ LIBGAMMA_CONNECTOR_TYPE_Composite,
+ LIBGAMMA_CONNECTOR_TYPE_SVIDEO,
+ LIBGAMMA_CONNECTOR_TYPE_LVDS,
+ LIBGAMMA_CONNECTOR_TYPE_Component,
+ LIBGAMMA_CONNECTOR_TYPE_9PinDIN,
+ LIBGAMMA_CONNECTOR_TYPE_DisplayPort,
+ LIBGAMMA_CONNECTOR_TYPE_HDMIA,
+ LIBGAMMA_CONNECTOR_TYPE_HDMIB,
+ LIBGAMMA_CONNECTOR_TYPE_TV,
+ LIBGAMMA_CONNECTOR_TYPE_eDP,
+ LIBGAMMA_CONNECTOR_TYPE_VIRTUAL,
+ LIBGAMMA_CONNECTOR_TYPE_DSI
+ } libgamma_connector_type_t;
+
+/**
+ * Orders for subpixels. Currently the possible values are
+ * very biased to LCD, Plasma and monochrome monitors.
+ */
+typedef enum libgamma_subpixel_order
+ {
+ /**
+ * The adjustment method does not know the order of the subpixels
+ * (This could be considered an error)
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_UNKNOWN,
+
+ /**
+ * There are no subpixels in the monitor
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_NONE,
+
+ /**
+ * The subpixels are ordered red, green and then blue, from left to right
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB,
+
+ /**
+ * The subpixels are ordered blue, green and then red, from left to right
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_BGR,
+
+ /**
+ * The subpixels are ordered red, green and then blue, from the top down
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_VERTICAL_RGB,
+
+ /**
+ * The subpixels are ordered blue, green and then red, from the top down
+ */
+ LIBGAMMA_SUBPIXEL_ORDER_VERTICAL_BGR
+
+ } libgamma_subpixel_order_t;
+
/**
* For a `libgamma_crtc_information_t` fill in the
@@ -554,10 +621,10 @@ typedef struct libgamma_crtc_information
/**
* The layout of the subpixels.
- * You cannot count on this value, but it is provided
- * anyway as a means of distinguishing monitors.
+ * You cannot count on this value — especially for CRT:s —
+ * but it is provided anyway as a means of distinguishing monitors.
*/
- int subpixel_order;
+ libgamma_subpixel_order_t subpixel_order;
/**
* Zero on success, positive it holds the value `errno` had
@@ -598,7 +665,7 @@ typedef struct libgamma_crtc_information
/**
* The type of the connector that is associated with the CRTC
*/
- int connector_type;
+ libgamma_connector_type_t connector_type;
/**
* Zero on success, positive it holds the value `errno` had