aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_get_crtc_information.c
blob: 5c7e2fe616ad687fff5858ee1c7aa2e80e9caee6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* 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, ...)\
	case CONST:\
		return libgamma_##CNAME##_get_crtc_information(this, crtc, fields);
	LIST_AVAILABLE_METHODS(X)
#undef X
	default:
		return LIBGAMMA_NO_SUCH_ADJUSTMENT_METHOD;
	}
}