aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_get_crtc_information.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-05 00:43:38 +0100
committerMattias Andrée <maandree@kth.se>2021-03-05 00:43:38 +0100
commit0ce0d8d6e0c420ccafa79e0203b928c3559a4311 (patch)
tree88e8228a93691c28811a49898abf86a96dd9d613 /libgamma_get_crtc_information.c
parentChange license + change style + misc (diff)
downloadlibgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.gz
libgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.bz2
libgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.xz
Split source files, merge public header files, eliminite use gpp, rewrite makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libgamma_get_crtc_information.c')
-rw-r--r--libgamma_get_crtc_information.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libgamma_get_crtc_information.c b/libgamma_get_crtc_information.c
new file mode 100644
index 0000000..023c07f
--- /dev/null
+++ b/libgamma_get_crtc_information.c
@@ -0,0 +1,29 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+
+/**
+ * Read information about a CRTC
+ *
+ * @param this Instance of a data structure to fill with the information about the CRTC
+ * @param crtc The state of the CRTC whose information should be read
+ * @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`
+ */
+int
+libgamma_get_crtc_information(libgamma_crtc_information_t *restrict this, libgamma_crtc_state_t *restrict crtc, int32_t fields)
+{
+ this->edid = NULL;
+ this->connector_name = NULL;
+
+ switch (crtc->partition->site->method) {
+#define X(CONST, CNAME, DEPTH, RAMPS)\
+ case CONST:\
+ return libgamma_##CNAME##_get_crtc_information(this, crtc, fields);
+ LIST_AVAILABLE_METHODS(X)
+#undef X
+ default:
+ return LIBGAMMA_NO_SUCH_ADJUSTMENT_METHOD;
+ }
+}