aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
blob: e54fe2cb8611b68e34aeb8e17715862246882166 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*
 * Copyright 2016 Advanced Micro Devices, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Authors: AMD
 *
 */


#ifndef MOD_COLOR_H_
#define MOD_COLOR_H_

#include "dm_services.h"

struct mod_color {
	int dummy;
};

struct color_space_coordinates {
	unsigned int redX;
	unsigned int redY;
	unsigned int greenX;
	unsigned int greenY;
	unsigned int blueX;
	unsigned int blueY;
	unsigned int whiteX;
	unsigned int whiteY;
};

struct gamut_space_coordinates {
	unsigned int redX;
	unsigned int redY;
	unsigned int greenX;
	unsigned int greenY;
	unsigned int blueX;
	unsigned int blueY;
};

struct gamut_space_entry {
	unsigned int index;
	unsigned int redX;
	unsigned int redY;
	unsigned int greenX;
	unsigned int greenY;
	unsigned int blueX;
	unsigned int blueY;

	int a0;
	int a1;
	int a2;
	int a3;
	int gamma;
};

struct white_point_coodinates {
	unsigned int whiteX;
	unsigned int whiteY;
};

struct white_point_coodinates_entry {
	unsigned int index;
	unsigned int whiteX;
	unsigned int whiteY;
};

struct color_range {
	int current;
	int min;
	int max;
};

struct mod_color *mod_color_create(struct dc *dc);

void mod_color_destroy(struct mod_color *mod_color);

bool mod_color_add_sink(struct mod_color *mod_color,
		const struct dc_sink *sink);

bool mod_color_remove_sink(struct mod_color *mod_color,
		const struct dc_sink *sink);

bool mod_color_update_gamut_to_stream(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams);

bool mod_color_set_white_point(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		struct white_point_coodinates *white_point);

bool mod_color_adjust_source_gamut(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		struct gamut_space_coordinates *input_gamut_coordinates,
		struct white_point_coodinates *input_white_point_coordinates);

bool mod_color_adjust_destination_gamut(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		struct gamut_space_coordinates *input_gamut_coordinates,
		struct white_point_coodinates *input_white_point_coordinates);

bool mod_color_get_user_enable(struct mod_color *mod_color,
		const struct dc_sink *sink,
		bool *user_enable);

bool mod_color_set_user_enable(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		bool user_enable);

bool mod_color_get_custom_color_temperature(struct mod_color *mod_color,
		const struct dc_sink *sink,
		int *color_temperature);

bool mod_color_set_custom_color_temperature(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		int color_temperature);

bool mod_color_get_color_saturation(struct mod_color *mod_color,
		const struct dc_sink *sink,
		struct color_range *color_saturation);

bool mod_color_get_color_contrast(struct mod_color *mod_color,
		const struct dc_sink *sink,
		struct color_range *color_contrast);

bool mod_color_get_color_brightness(struct mod_color *mod_color,
		const struct dc_sink *sink,
		struct color_range *color_brightness);

bool mod_color_get_color_hue(struct mod_color *mod_color,
		const struct dc_sink *sink,
		struct color_range *color_hue);

bool mod_color_get_source_gamut(struct mod_color *mod_color,
		const struct dc_sink *sink,
		struct color_space_coordinates *source_gamut);

bool mod_color_notify_mode_change(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams);

bool mod_color_set_brightness(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		int brightness_value);

bool mod_color_set_contrast(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		int contrast_value);

bool mod_color_set_hue(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		int hue_value);

bool mod_color_set_saturation(struct mod_color *mod_color,
		const struct dc_stream **streams, int num_streams,
		int saturation_value);

bool mod_color_set_preferred_quantization_range(struct mod_color *mod_color,
		const struct dc_sink *sink,
		enum dc_quantization_range quantization_range);

bool mod_color_get_preferred_quantization_range(struct mod_color *mod_color,
		const struct dc_sink *sink,
		enum dc_quantization_range *quantization_range);

#endif /* MOD_COLOR_H_ */