diff options
author | Andrew Wong <andrew.wong1@amd.com> | 2016-12-22 15:41:30 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 17:07:29 -0400 |
commit | 1646a6fe746d7e923774994d2020e1707dcda884 (patch) | |
tree | c544d0e7178f481c0d2f5eb2ceec70b9c0f2be54 /drivers/gpu/drm/amd/display/modules | |
parent | c89a58cd0d1cc940a29a00cc03e441f97fab56e1 (diff) |
drm/amd/display: DAL3: HDR10 Infoframe encoding
- Add HDR metadata struct
- Add register programming calculations
- Added HDR metadata to surface and update_surface
- Add HDR info packet programming for DP port
Signed-off-by: Andrew Wong <andrew.wong1@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')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/color/color.c | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/inc/mod_color.h | 20 |
2 files changed, 12 insertions, 24 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/color/color.c b/drivers/gpu/drm/amd/display/modules/color/color.c index 5c578aecf21c..599d9f9aa7ca 100644 --- a/drivers/gpu/drm/amd/display/modules/color/color.c +++ b/drivers/gpu/drm/amd/display/modules/color/color.c @@ -74,7 +74,7 @@ struct color_state { struct color_gamut_data destination_gamut; enum color_transfer_func input_transfer_function; enum color_transfer_func output_transfer_function; - struct color_mastering_info mastering_info; + struct dc_hdr_static_metadata mastering_info; }; struct core_color { @@ -1970,7 +1970,7 @@ bool mod_color_set_white_point(struct mod_color *mod_color, 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) + const struct dc_hdr_static_metadata *mastering_info) { struct core_color *core_color = MOD_COLOR_TO_CORE(mod_color); unsigned int stream_index, sink_index; @@ -1980,14 +1980,14 @@ bool mod_color_set_mastering_info(struct mod_color *mod_color, streams[stream_index]->sink); memcpy(&core_color->state[sink_index].mastering_info, mastering_info, - sizeof(struct color_mastering_info)); + sizeof(struct dc_hdr_static_metadata)); } return true; } bool mod_color_get_mastering_info(struct mod_color *mod_color, const struct dc_sink *sink, - struct color_mastering_info *mastering_info) + struct dc_hdr_static_metadata *mastering_info) { struct core_color *core_color = MOD_COLOR_TO_CORE(mod_color); @@ -1995,7 +1995,7 @@ bool mod_color_get_mastering_info(struct mod_color *mod_color, unsigned int sink_index = sink_index_from_sink(core_color, sink); memcpy(mastering_info, &core_color->state[sink_index].mastering_info, - sizeof(struct color_mastering_info)); + sizeof(struct dc_hdr_static_metadata)); return true; } @@ -2756,8 +2756,10 @@ bool mod_color_update_gamut_info(struct mod_color *mod_color, else output_tf->tf = TRANSFER_FUNCTION_SRGB; } + /* 5. ---- POPULATE HDR METADATA ---- */ + core_color->state[sink_index].mastering_info.is_hdr = is_hdr; - /* 5. ---- TODO: UPDATE INFOPACKETS ---- */ + /* 6. ---- TODO: UPDATE INFOPACKETS ---- */ if (!mod_color_update_gamut_to_stream( mod_color, streams, num_streams)) @@ -2769,6 +2771,8 @@ bool mod_color_update_gamut_info(struct mod_color *mod_color, updates[0].gamma = core_color->state[sink_index].gamma; updates[0].in_transfer_func = input_tf; updates[0].out_transfer_func = output_tf; + updates[0].hdr_static_metadata = + &core_color->state[sink_index].mastering_info; dc_update_surfaces_for_target(core_color->dc, updates, 1, NULL); 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 670b87fb8bd2..70349a88916c 100644 --- a/drivers/gpu/drm/amd/display/modules/inc/mod_color.h +++ b/drivers/gpu/drm/amd/display/modules/inc/mod_color.h @@ -87,22 +87,6 @@ enum hdr_tf_support_flag { 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; }; @@ -206,11 +190,11 @@ bool mod_color_get_user_enable(struct mod_color *mod_color, 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); + const struct dc_hdr_static_metadata *mastering_info); bool mod_color_get_mastering_info(struct mod_color *mod_color, const struct dc_sink *sink, - struct color_mastering_info *mastering_info); + struct dc_hdr_static_metadata *mastering_info); bool mod_color_set_user_enable(struct mod_color *mod_color, const struct dc_stream **streams, int num_streams, |