summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/modules/inc
diff options
context:
space:
mode:
authorAmy Zhang <Amy.Zhang@amd.com>2016-12-13 00:57:40 +0300
committerAlex Deucher <alexander.deucher@amd.com>2017-09-27 00:06:24 +0300
commit5ce0183cdd00d9c9e57405fa5a06d2a97b747aeb (patch)
tree6c6857a7082c140242c0863ac9a9c4f997de5528 /drivers/gpu/drm/amd/display/modules/inc
parentb39474ef0925a748d0dd43521fc1192777afd329 (diff)
downloadlinux-5ce0183cdd00d9c9e57405fa5a06d2a97b747aeb.tar.xz
drm/amd/display: Framework for degamma and regramma through color module
Signed-off-by: Amy Zhang <Amy.Zhang@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/inc')
-rw-r--r--drivers/gpu/drm/amd/display/modules/inc/mod_color.h115
1 files changed, 110 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/inc/mod_color.h b/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
index fbf908141ba7..670b87fb8bd2 100644
--- a/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
+++ b/drivers/gpu/drm/amd/display/modules/inc/mod_color.h
@@ -30,6 +30,79 @@
#include "dm_services.h"
#include "color_helper.h"
+enum color_transfer_func {
+ transfer_func_unknown,
+ transfer_func_srgb,
+ transfer_func_bt709,
+ transfer_func_pq2084,
+ transfer_func_pq2084_interim,
+ transfer_func_linear_0_1,
+ transfer_func_linear_0_125,
+ transfer_func_dolbyvision,
+ transfer_func_gamma_22,
+ transfer_func_gamma_26
+};
+
+enum color_color_space {
+ color_space_unsupported,
+ color_space_srgb,
+ color_space_bt601,
+ color_space_bt709,
+ color_space_xv_ycc_bt601,
+ color_space_xv_ycc_bt709,
+ color_space_xr_rgb,
+ color_space_bt2020,
+ color_space_adobe,
+ color_space_dci_p3,
+ color_space_sc_rgb_ms_ref,
+ color_space_display_native,
+ color_space_app_ctrl,
+ color_space_dolby_vision,
+ color_space_custom_coordinates
+};
+
+enum color_white_point_type {
+ color_white_point_type_unknown,
+ color_white_point_type_5000k_horizon,
+ color_white_point_type_6500k_noon,
+ color_white_point_type_7500k_north_sky,
+ color_white_point_type_9300k,
+ color_white_point_type_custom_coordinates
+};
+
+enum colorimetry_support_flag {
+ xv_ycc_bt601 = 0x01,
+ xv_ycc_bt709 = 0x02,
+ s_ycc_601 = 0x04,
+ adobe_ycc_601 = 0x08,
+ adobe_rgb = 0x10,
+ bt_2020_c_ycc = 0x20,
+ bt_2020_ycc = 0x40,
+ bt_2020_rgb = 0x80
+};
+
+enum hdr_tf_support_flag {
+ traditional_gamma_sdr = 0x01,
+ traditional_gamma_hdr = 0x02,
+ smpte_st2084 = 0x04
+};
+
+struct color_mastering_info {
+ unsigned int chromaticity_green_x;
+ unsigned int chromaticity_green_y;
+ unsigned int chromaticity_blue_x;
+ unsigned int chromaticity_blue_y;
+ unsigned int chromaticity_red_x;
+ unsigned int chromaticity_red_y;
+ unsigned int chromaticity_white_point_x;
+ unsigned int chromaticity_white_point_y;
+
+ unsigned int min_luminance;
+ unsigned int max_luminance;
+ unsigned int maximum_content_light_level;
+ unsigned int maximum_frame_average_light_level;
+};
+
struct mod_color {
int dummy;
};
@@ -86,12 +159,23 @@ struct color_range {
int max;
};
+struct color_gamut_data {
+ enum color_color_space color_space;
+ enum color_white_point_type white_point;
+ struct color_space_coordinates gamut;
+};
+
+struct color_edid_caps {
+ unsigned int colorimetry_caps;
+ unsigned int hdr_caps;
+};
+
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);
+ const struct dc_sink *sink, struct color_edid_caps *edid_caps);
bool mod_color_remove_sink(struct mod_color *mod_color,
const struct dc_sink *sink);
@@ -105,18 +189,29 @@ bool mod_color_set_white_point(struct mod_color *mod_color,
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);
+ struct color_gamut_data *input_gamut_data);
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);
+ struct color_gamut_data *input_gamut_data);
+
+bool mod_color_adjust_source_gamut_and_tf(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ struct color_gamut_data *input_gamut_data,
+ enum color_transfer_func input_transfer_func);
bool mod_color_get_user_enable(struct mod_color *mod_color,
const struct dc_sink *sink,
bool *user_enable);
+bool mod_color_set_mastering_info(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ struct color_mastering_info *mastering_info);
+
+bool mod_color_get_mastering_info(struct mod_color *mod_color,
+ const struct dc_sink *sink,
+ struct color_mastering_info *mastering_info);
+
bool mod_color_set_user_enable(struct mod_color *mod_color,
const struct dc_stream **streams, int num_streams,
bool user_enable);
@@ -190,4 +285,14 @@ bool mod_color_is_rgb_limited_range_supported_for_timing(
const struct dc_sink *sink,
const struct dc_crtc_timing *timing);
+bool mod_color_set_regamma(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams);
+
+bool mod_color_set_degamma(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams,
+ enum color_transfer_func transfer_function);
+
+bool mod_color_update_gamut_info(struct mod_color *mod_color,
+ const struct dc_stream **streams, int num_streams);
+
#endif /* MOD_COLOR_H_ */