aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_dummy_partition_restore.c
blob: 457086ad42989cc50d890cc7264e4c8efb2434ce (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
29
/* See LICENSE file for copyright and license details. */
#define IN_LIBGAMMA_DUMMY
#include "common.h"


/**
 * Restore the gamma ramps all CRTC:s with a partition to the system settings
 * 
 * @param   this  The partition state
 * @return        Zero on success, otherwise (negative) the value of an
 *                error identifier provided by this library
 */
int
libgamma_dummy_partition_restore(libgamma_partition_state_t *restrict this)
{
	libgamma_dummy_partition_t *data = this->data;
	size_t i;

	if (!libgamma_dummy_internal_configurations.capabilities.partition_restore) {
		errno = ENOTSUP;
		return LIBGAMMA_ERRNO_SET;
	}

	for (i = 0; i < data->crtc_count; i++)
		if (libgamma_dummy_internal_crtc_restore_forced(data->crtcs + i) < 0)
			return -1;

	return 0;
}