aboutsummaryrefslogtreecommitdiffstats
path: root/method-linux-drm.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--method-linux-drm.h (renamed from gamma-linux-drm.h)57
1 files changed, 53 insertions, 4 deletions
diff --git a/gamma-linux-drm.h b/method-linux-drm.h
index a8f1e1c..50da38e 100644
--- a/gamma-linux-drm.h
+++ b/method-linux-drm.h
@@ -1,6 +1,35 @@
/* See LICENSE file for copyright and license details. */
-#ifndef LIBGAMMA_GAMMA_LINUX_DRM_H
-#define LIBGAMMA_GAMMA_LINUX_DRM_H
+
+#include <xf86drm.h>
+#include <xf86drmMode.h>
+
+
+/**
+ * Graphics card data for the Direct Rendering Manager adjustment method
+ */
+typedef struct libgamma_drm_card_data {
+ /**
+ * File descriptor for the connection to the graphics card
+ */
+ int fd;
+
+ /**
+ * The graphics card's mode resources
+ */
+ drmModeRes *res;
+
+ /**
+ * Resources for open connectors
+ */
+ drmModeConnector **connectors;
+
+ /**
+ * Resources for open encoders
+ */
+ drmModeEncoder **encoders;
+
+} libgamma_drm_card_data_t;
+
/**
@@ -8,6 +37,7 @@
*
* @param this The data structure to fill with the method's capabilities
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
void libgamma_linux_drm_method_capabilities(libgamma_method_capabilities_t *restrict);
/**
@@ -23,6 +53,7 @@ void libgamma_linux_drm_method_capabilities(libgamma_method_capabilities_t *rest
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__(1), __warn_unused_result__)))
int libgamma_linux_drm_site_initialise(libgamma_site_state_t *restrict, char *restrict);
/**
@@ -30,6 +61,7 @@ int libgamma_linux_drm_site_initialise(libgamma_site_state_t *restrict, char *re
*
* @param this The site state
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
void libgamma_linux_drm_site_destroy(libgamma_site_state_t *restrict);
/**
@@ -39,6 +71,7 @@ void libgamma_linux_drm_site_destroy(libgamma_site_state_t *restrict);
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_site_restore(libgamma_site_state_t *restrict);
@@ -51,6 +84,7 @@ int libgamma_linux_drm_site_restore(libgamma_site_state_t *restrict);
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_partition_initialise(libgamma_partition_state_t *restrict, libgamma_site_state_t *restrict, size_t);
/**
@@ -58,6 +92,7 @@ int libgamma_linux_drm_partition_initialise(libgamma_partition_state_t *restrict
*
* @param this The partition state
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
void libgamma_linux_drm_partition_destroy(libgamma_partition_state_t *restrict);
/**
@@ -67,6 +102,7 @@ void libgamma_linux_drm_partition_destroy(libgamma_partition_state_t *restrict);
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_partition_restore(libgamma_partition_state_t *restrict);
@@ -79,6 +115,7 @@ int libgamma_linux_drm_partition_restore(libgamma_partition_state_t *restrict);
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_crtc_initialise(libgamma_crtc_state_t *restrict, libgamma_partition_state_t *restrict, size_t);
/**
@@ -86,6 +123,7 @@ int libgamma_linux_drm_crtc_initialise(libgamma_crtc_state_t *restrict, libgamma
*
* @param this The CRTC state
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
void libgamma_linux_drm_crtc_destroy(libgamma_crtc_state_t *restrict);
/**
@@ -95,6 +133,7 @@ void libgamma_linux_drm_crtc_destroy(libgamma_crtc_state_t *restrict);
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_crtc_restore(libgamma_crtc_state_t *restrict);
@@ -106,6 +145,7 @@ int libgamma_linux_drm_crtc_restore(libgamma_crtc_state_t *restrict);
* @param fields OR:ed identifiers for the information about the CRTC that should be read
* @return Zero on success, -1 on error; on error refer to the error reports in `this`
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t *restrict, libgamma_crtc_state_t *restrict, int32_t);
/**
@@ -116,6 +156,7 @@ int libgamma_linux_drm_get_crtc_information(libgamma_crtc_information_t *restric
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
int libgamma_linux_drm_crtc_get_gamma_ramps16(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps16_t *restrict);
/**
@@ -126,7 +167,15 @@ int libgamma_linux_drm_crtc_get_gamma_ramps16(libgamma_crtc_state_t *restrict, l
* @return Zero on success, otherwise (negative) the value of an
* error identifier provided by this library
*/
-int libgamma_linux_drm_crtc_set_gamma_ramps16(libgamma_crtc_state_t *restrict, libgamma_gamma_ramps16_t);
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__, __warn_unused_result__)))
+int libgamma_linux_drm_crtc_set_gamma_ramps16(libgamma_crtc_state_t *restrict, const libgamma_gamma_ramps16_t *restrict);
+
-#endif
+/**
+ * Release all connectors and encoders
+ *
+ * @param this The graphics card data
+ */
+LIBGAMMA_GCC_ONLY__(__attribute__((__nonnull__)))
+void libgamma_linux_drm_internal_release_connectors_and_encoders(libgamma_drm_card_data_t *restrict);