aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/gamma-linux-drm.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-01 06:03:15 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-01 06:03:15 +0200
commit6ce17db88175b341b7729f12b9f1197781312434 (patch)
tree74e90f91793e74fa89231403084e362cb83b7fef /src/lib/gamma-linux-drm.c
parentm + m doc (diff)
downloadlibgamma-6ce17db88175b341b7729f12b9f1197781312434.tar.gz
libgamma-6ce17db88175b341b7729f12b9f1197781312434.tar.bz2
libgamma-6ce17db88175b341b7729f12b9f1197781312434.tar.xz
Use macros for CRTC information fields
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/lib/gamma-linux-drm.c')
-rw-r--r--src/lib/gamma-linux-drm.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/lib/gamma-linux-drm.c b/src/lib/gamma-linux-drm.c
index 2644da8..3c421e7 100644
--- a/src/lib/gamma-linux-drm.c
+++ b/src/lib/gamma-linux-drm.c
@@ -579,15 +579,14 @@ static int read_connector_data(libgamma_crtc_state_t* restrict crtc, libgamma_cr
const char* connector_name_base = NULL;
/* Get some information that does not require too much work. */
- if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE |
- LIBGAMMA_CRTC_INFO_ACTIVE | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_MACRO_ACTIVE | LIBGAMMA_CRTC_INFO_MACRO_CONNECTOR)))
{
/* Get whether or not a monitor is plugged in. */
out->active = connector->connection == DRM_MODE_CONNECTED;
out->active_error = connector->connection == DRM_MODE_UNKNOWNCONNECTION ? LIBGAMMA_STATE_UNKNOWN : 0;
if (out->active == 0)
{
- if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_MACRO_VIEWPORT | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)))
out->width_mm_error = out->height_mm_error = out->subpixel_order_error = LIBGAMMA_NOT_CONNECTED;
goto not_connected;
}
@@ -701,16 +700,8 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
/* We need to free the EDID after us if it is not explicitly requested. */
free_edid = (fields & LIBGAMMA_CRTC_INFO_EDID) == 0;
- /* Figure out what fields we need to get the data for to get the data for other fields. */
- if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
- fields |= LIBGAMMA_CRTC_INFO_EDID;
- if ((fields & LIBGAMMA_CRTC_INFO_CONNECTOR_NAME))
- fields |= LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE;
- if (LIBGAMMA_CRTC_INFO_EDID | LIBGAMMA_CRTC_INFO_WIDTH_MM | LIBGAMMA_CRTC_INFO_HEIGHT_MM | LIBGAMMA_CRTC_INFO_SUBPIXEL_ORDER)
- fields |= LIBGAMMA_CRTC_INFO_ACTIVE;
-
/* Figure out whether we require the connector to get all information we want. */
- require_connector = fields & (LIBGAMMA_CRTC_INFO_ACTIVE | LIBGAMMA_CRTC_INFO_CONNECTOR_TYPE);
+ require_connector = fields & (LIBGAMMA_CRTC_INFO_MACRO_ACTIVE | LIBGAMMA_CRTC_INFO_MACRO_CONNECTOR);
if (require_connector == 0)
goto cont;
@@ -724,7 +715,7 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
goto cont;
}
e |= read_connector_data(crtc, this, connector, fields);
- if ((fields & LIBGAMMA_CRTC_INFO_EDID) == 0)
+ if ((fields & LIBGAMMA_CRTC_INFO_MACRO_EDID) == 0)
goto cont;
if (this->active_error || (this->active == 0))
{
@@ -739,7 +730,7 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t* restric
this->gamma_error = this->width_mm_edid_error = this->height_mm_edid_error = this->edid_error;
goto cont;
}
- if ((fields & (LIBGAMMA_CRTC_INFO_WIDTH_MM_EDID | LIBGAMMA_CRTC_INFO_HEIGHT_MM_EDID | LIBGAMMA_CRTC_INFO_GAMMA)))
+ if ((fields & (LIBGAMMA_CRTC_INFO_MACRO_EDID ^ LIBGAMMA_CRTC_INFO_EDID)))
e |= libgamma_parse_edid(this, fields);
cont:
e |= (fields & LIBGAMMA_CRTC_INFO_GAMMA_SIZE) ? get_gamma_ramp_size(this, crtc) : 0;