diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-08-06 22:41:04 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-08-06 22:41:04 +0200 |
commit | 303669359ff09004d491136d94b4e525c4792a18 (patch) | |
tree | 83a08367c95573b468c5eaa55197c9e713670311 /src/drmgamma.h | |
parent | m + beginning of gamma (diff) | |
download | crt-calibrator-303669359ff09004d491136d94b4e525c4792a18.tar.gz crt-calibrator-303669359ff09004d491136d94b4e525c4792a18.tar.bz2 crt-calibrator-303669359ff09004d491136d94b4e525c4792a18.tar.xz |
work on drm utilisation
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/drmgamma.h')
-rw-r--r-- | src/drmgamma.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/drmgamma.h b/src/drmgamma.h index 7044fd7..efc7ec2 100644 --- a/src/drmgamma.h +++ b/src/drmgamma.h @@ -44,8 +44,60 @@ typedef struct drm_card */ size_t crtc_count; + /** + * The available connectors + */ + drmModeConnector** restrict connectors; + + /** + * The available encoders + */ + drmModeEncoder** restrict encoders; + + /** + * The number of connectors and encoders + */ + size_t connector_count; + } drm_card_t; +/** + * CRT controller information + */ +typedef struct drm_crtc +{ + /** + * CRT controller identifier + */ + uint32_t id; + + /** + * The graphics card + */ + drm_card_t* restrict card; + + /** + * The CRT controller's connector + */ + drmModeConnector* restrict connector; + + /** + * The CRT controller's encoder + */ + drmModeEncoder* restrict encoder; + + /** + * Whether the connector is connected + */ + int connected; + + /** + * The CRT's EDID, hexadecimally encoded + */ + char* edid; + +} drm_crtc_t; + /** * Figure out how many graphics cards there are on the system @@ -70,6 +122,23 @@ int drm_card_open(size_t index, drm_card_t* restrict card); */ void drm_card_close(drm_card_t* restrict card); +/** + * Acquire access to a CRT controller + * + * @param index The index of the CRT controller + * @param card The graphics card information + * @param crtc CRT controller information to fill in + * @return Zero on success, -1 on error + */ +int drm_crtc_open(size_t index, drm_card_t* restrict card, drm_crtc_t* restrict crtc); + +/** + * Release access to a CRT controller + * + * @param crtc The CRT controller information to fill in + */ +void drm_crtc_close(drm_crtc_t* restrict crtc); + #endif |