diff options
author | Charlene Liu <charlene.liu@amd.com> | 2017-07-17 16:04:02 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:15:15 -0400 |
commit | 15e173352eeae76286e0d018f9eec6b55726caa4 (patch) | |
tree | 56b16a35bf2536f1534542bfe31b8669549ab84c | |
parent | 1674d35bf57b0546577b87af266e45de3ccf45c0 (diff) |
drm/amd/display: fix aviInfoFrame bar Info and add set_avMute
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 files changed, 77 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c index fed38fbab452..036d22f878b8 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c | |||
@@ -1911,3 +1911,13 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx) | |||
1911 | disable_link(pipe_ctx->stream->sink->link, pipe_ctx->stream->signal); | 1911 | disable_link(pipe_ctx->stream->sink->link, pipe_ctx->stream->signal); |
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable) | ||
1915 | { | ||
1916 | struct core_dc *core_dc = DC_TO_CORE(pipe_ctx->stream->ctx->dc); | ||
1917 | |||
1918 | if (pipe_ctx->stream->signal != SIGNAL_TYPE_HDMI_TYPE_A) | ||
1919 | return; | ||
1920 | |||
1921 | core_dc->hwss.set_avmute(pipe_ctx, enable); | ||
1922 | } | ||
1923 | |||
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 9d0128e95767..63056e8c6d78 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c | |||
@@ -1607,6 +1607,8 @@ static void set_avi_info_frame( | |||
1607 | uint8_t *check_sum = NULL; | 1607 | uint8_t *check_sum = NULL; |
1608 | uint8_t byte_index = 0; | 1608 | uint8_t byte_index = 0; |
1609 | union hdmi_info_packet *hdmi_info = &info_frame.avi_info_packet.info_packet_hdmi; | 1609 | union hdmi_info_packet *hdmi_info = &info_frame.avi_info_packet.info_packet_hdmi; |
1610 | unsigned int vic = pipe_ctx->stream->public.timing.vic; | ||
1611 | enum dc_timing_3d_format format; | ||
1610 | 1612 | ||
1611 | color_space = pipe_ctx->stream->public.output_color_space; | 1613 | color_space = pipe_ctx->stream->public.output_color_space; |
1612 | if (color_space == COLOR_SPACE_UNKNOWN) | 1614 | if (color_space == COLOR_SPACE_UNKNOWN) |
@@ -1661,8 +1663,7 @@ static void set_avi_info_frame( | |||
1661 | 1663 | ||
1662 | /* C0, C1 : Colorimetry */ | 1664 | /* C0, C1 : Colorimetry */ |
1663 | if (color_space == COLOR_SPACE_YCBCR709 || | 1665 | if (color_space == COLOR_SPACE_YCBCR709 || |
1664 | color_space == COLOR_SPACE_YCBCR709_LIMITED || | 1666 | color_space == COLOR_SPACE_YCBCR709_LIMITED) |
1665 | color_space == COLOR_SPACE_2020_YCBCR) | ||
1666 | hdmi_info->bits.C0_C1 = COLORIMETRY_ITU709; | 1667 | hdmi_info->bits.C0_C1 = COLORIMETRY_ITU709; |
1667 | else if (color_space == COLOR_SPACE_YCBCR601 || | 1668 | else if (color_space == COLOR_SPACE_YCBCR601 || |
1668 | color_space == COLOR_SPACE_YCBCR601_LIMITED) | 1669 | color_space == COLOR_SPACE_YCBCR601_LIMITED) |
@@ -1722,9 +1723,29 @@ static void set_avi_info_frame( | |||
1722 | hdmi_info->bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE; | 1723 | hdmi_info->bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE; |
1723 | hdmi_info->bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE; | 1724 | hdmi_info->bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE; |
1724 | } | 1725 | } |
1725 | 1726 | ///VIC | |
1726 | hdmi_info->bits.VIC0_VIC7 = | 1727 | format = stream->public.timing.timing_3d_format; |
1727 | stream->public.timing.vic; | 1728 | /*todo, add 3DStereo support*/ |
1729 | if (format != TIMING_3D_FORMAT_NONE) { | ||
1730 | // Based on HDMI specs hdmi vic needs to be converted to cea vic when 3D is enabled | ||
1731 | switch (pipe_ctx->stream->public.timing.hdmi_vic) { | ||
1732 | case 1: | ||
1733 | vic = 95; | ||
1734 | break; | ||
1735 | case 2: | ||
1736 | vic = 94; | ||
1737 | break; | ||
1738 | case 3: | ||
1739 | vic = 93; | ||
1740 | break; | ||
1741 | case 4: | ||
1742 | vic = 98; | ||
1743 | break; | ||
1744 | default: | ||
1745 | break; | ||
1746 | } | ||
1747 | } | ||
1748 | hdmi_info->bits.VIC0_VIC7 = vic; | ||
1728 | 1749 | ||
1729 | /* pixel repetition | 1750 | /* pixel repetition |
1730 | * PR0 - PR3 start from 0 whereas pHwPathMode->mode.timing.flags.pixel | 1751 | * PR0 - PR3 start from 0 whereas pHwPathMode->mode.timing.flags.pixel |
@@ -1737,7 +1758,7 @@ static void set_avi_info_frame( | |||
1737 | * barLeft: Pixel Number of End of Left Bar. | 1758 | * barLeft: Pixel Number of End of Left Bar. |
1738 | * barRight: Pixel Number of Start of Right Bar. */ | 1759 | * barRight: Pixel Number of Start of Right Bar. */ |
1739 | hdmi_info->bits.bar_top = stream->public.timing.v_border_top; | 1760 | hdmi_info->bits.bar_top = stream->public.timing.v_border_top; |
1740 | hdmi_info->bits.bar_bottom = (stream->public.timing.v_border_top | 1761 | hdmi_info->bits.bar_bottom = (stream->public.timing.v_total |
1741 | - stream->public.timing.v_border_bottom + 1); | 1762 | - stream->public.timing.v_border_bottom + 1); |
1742 | hdmi_info->bits.bar_left = stream->public.timing.h_border_left; | 1763 | hdmi_info->bits.bar_left = stream->public.timing.h_border_left; |
1743 | hdmi_info->bits.bar_right = (stream->public.timing.h_total | 1764 | hdmi_info->bits.bar_right = (stream->public.timing.h_total |
@@ -1776,6 +1797,10 @@ static void set_vendor_info_packet( | |||
1776 | uint8_t checksum = 0; | 1797 | uint8_t checksum = 0; |
1777 | uint32_t i = 0; | 1798 | uint32_t i = 0; |
1778 | enum dc_timing_3d_format format; | 1799 | enum dc_timing_3d_format format; |
1800 | // Can be different depending on packet content /*todo*/ | ||
1801 | // unsigned int length = pPathMode->dolbyVision ? 24 : 5; | ||
1802 | |||
1803 | info_packet->valid = false; | ||
1779 | 1804 | ||
1780 | format = stream->public.timing.timing_3d_format; | 1805 | format = stream->public.timing.timing_3d_format; |
1781 | if (stream->public.view_format == VIEW_3D_FORMAT_NONE) | 1806 | if (stream->public.view_format == VIEW_3D_FORMAT_NONE) |
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c index daab81bd1773..532c6e638943 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c | |||
@@ -1003,6 +1003,16 @@ static void dce110_stream_encoder_dp_unblank( | |||
1003 | REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, true); | 1003 | REG_UPDATE(DP_VID_STREAM_CNTL, DP_VID_STREAM_ENABLE, true); |
1004 | } | 1004 | } |
1005 | 1005 | ||
1006 | static void dce110_stream_encoder_set_avmute( | ||
1007 | struct stream_encoder *enc, | ||
1008 | bool enable) | ||
1009 | { | ||
1010 | struct dce110_stream_encoder *enc110 = DCE110STRENC_FROM_STRENC(enc); | ||
1011 | unsigned int value = enable ? 1 : 0; | ||
1012 | |||
1013 | REG_UPDATE(HDMI_GC, HDMI_GC_AVMUTE, value); | ||
1014 | } | ||
1015 | |||
1006 | 1016 | ||
1007 | #define DP_SEC_AUD_N__DP_SEC_AUD_N__DEFAULT 0x8000 | 1017 | #define DP_SEC_AUD_N__DP_SEC_AUD_N__DEFAULT 0x8000 |
1008 | #define DP_SEC_TIMESTAMP__DP_SEC_TIMESTAMP_MODE__AUTO_CALC 1 | 1018 | #define DP_SEC_TIMESTAMP__DP_SEC_TIMESTAMP_MODE__AUTO_CALC 1 |
@@ -1582,7 +1592,6 @@ static const struct stream_encoder_funcs dce110_str_enc_funcs = { | |||
1582 | dce110_stream_encoder_dp_blank, | 1592 | dce110_stream_encoder_dp_blank, |
1583 | .dp_unblank = | 1593 | .dp_unblank = |
1584 | dce110_stream_encoder_dp_unblank, | 1594 | dce110_stream_encoder_dp_unblank, |
1585 | |||
1586 | .audio_mute_control = dce110_se_audio_mute_control, | 1595 | .audio_mute_control = dce110_se_audio_mute_control, |
1587 | 1596 | ||
1588 | .dp_audio_setup = dce110_se_dp_audio_setup, | 1597 | .dp_audio_setup = dce110_se_dp_audio_setup, |
@@ -1592,6 +1601,8 @@ static const struct stream_encoder_funcs dce110_str_enc_funcs = { | |||
1592 | .hdmi_audio_setup = dce110_se_hdmi_audio_setup, | 1601 | .hdmi_audio_setup = dce110_se_hdmi_audio_setup, |
1593 | .hdmi_audio_disable = dce110_se_hdmi_audio_disable, | 1602 | .hdmi_audio_disable = dce110_se_hdmi_audio_disable, |
1594 | .setup_stereo_sync = setup_stereo_sync, | 1603 | .setup_stereo_sync = setup_stereo_sync, |
1604 | .set_avmute = dce110_stream_encoder_set_avmute, | ||
1605 | |||
1595 | }; | 1606 | }; |
1596 | 1607 | ||
1597 | bool dce110_stream_encoder_construct( | 1608 | bool dce110_stream_encoder_construct( |
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index 5d64611eb6a6..b691ef956d45 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | |||
@@ -801,6 +801,13 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx, | |||
801 | pipe_ctx->stream_enc->funcs->dp_unblank(pipe_ctx->stream_enc, ¶ms); | 801 | pipe_ctx->stream_enc->funcs->dp_unblank(pipe_ctx->stream_enc, ¶ms); |
802 | } | 802 | } |
803 | 803 | ||
804 | |||
805 | void dce110_set_avmute(struct pipe_ctx *pipe_ctx, bool enable) | ||
806 | { | ||
807 | if (pipe_ctx != NULL && pipe_ctx->stream_enc != NULL) | ||
808 | pipe_ctx->stream_enc->funcs->set_avmute(pipe_ctx->stream_enc, enable); | ||
809 | } | ||
810 | |||
804 | static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id) | 811 | static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id) |
805 | { | 812 | { |
806 | switch (crtc_id) { | 813 | switch (crtc_id) { |
@@ -1095,10 +1102,11 @@ static enum dc_status apply_single_controller_ctx_to_hw( | |||
1095 | (pipe_ctx->stream->signal == SIGNAL_TYPE_DVI_DUAL_LINK) ? | 1102 | (pipe_ctx->stream->signal == SIGNAL_TYPE_DVI_DUAL_LINK) ? |
1096 | true : false); | 1103 | true : false); |
1097 | 1104 | ||
1105 | resource_build_info_frame(pipe_ctx); | ||
1106 | |||
1098 | if (!pipe_ctx_old->stream) { | 1107 | if (!pipe_ctx_old->stream) { |
1099 | core_link_enable_stream(pipe_ctx); | 1108 | core_link_enable_stream(pipe_ctx); |
1100 | 1109 | ||
1101 | resource_build_info_frame(pipe_ctx); | ||
1102 | dce110_update_info_frame(pipe_ctx); | 1110 | dce110_update_info_frame(pipe_ctx); |
1103 | if (dc_is_dp_signal(pipe_ctx->stream->signal)) | 1111 | if (dc_is_dp_signal(pipe_ctx->stream->signal)) |
1104 | dce110_unblank_stream(pipe_ctx, | 1112 | dce110_unblank_stream(pipe_ctx, |
@@ -2600,7 +2608,8 @@ static const struct hw_sequencer_funcs dce110_funcs = { | |||
2600 | .set_static_screen_control = set_static_screen_control, | 2608 | .set_static_screen_control = set_static_screen_control, |
2601 | .reset_hw_ctx_wrap = reset_hw_ctx_wrap, | 2609 | .reset_hw_ctx_wrap = reset_hw_ctx_wrap, |
2602 | .prog_pixclk_crtc_otg = dce110_prog_pixclk_crtc_otg, | 2610 | .prog_pixclk_crtc_otg = dce110_prog_pixclk_crtc_otg, |
2603 | .setup_stereo = NULL | 2611 | .setup_stereo = NULL, |
2612 | .set_avmute = dce110_set_avmute, | ||
2604 | }; | 2613 | }; |
2605 | 2614 | ||
2606 | bool dce110_hw_sequencer_construct(struct core_dc *dc) | 2615 | bool dce110_hw_sequencer_construct(struct core_dc *dc) |
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h index 52462c17b2e9..89782ca1917f 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.h | |||
@@ -54,6 +54,7 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx, | |||
54 | 54 | ||
55 | void dce110_update_info_frame(struct pipe_ctx *pipe_ctx); | 55 | void dce110_update_info_frame(struct pipe_ctx *pipe_ctx); |
56 | 56 | ||
57 | void dce110_set_avmute(struct pipe_ctx *pipe_ctx, bool enable); | ||
57 | void dce110_enable_accelerated_mode(struct core_dc *dc); | 58 | void dce110_enable_accelerated_mode(struct core_dc *dc); |
58 | 59 | ||
59 | void dce110_power_down(struct core_dc *dc); | 60 | void dce110_power_down(struct core_dc *dc); |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index cadc940e7c0e..8284837898d2 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |||
@@ -1867,7 +1867,8 @@ static const struct hw_sequencer_funcs dcn10_funcs = { | |||
1867 | .set_drr = set_drr, | 1867 | .set_drr = set_drr, |
1868 | .get_position = get_position, | 1868 | .get_position = get_position, |
1869 | .set_static_screen_control = set_static_screen_control, | 1869 | .set_static_screen_control = set_static_screen_control, |
1870 | .setup_stereo = dcn10_setup_stereo | 1870 | .setup_stereo = dcn10_setup_stereo, |
1871 | .set_avmute = dce110_set_avmute, | ||
1871 | }; | 1872 | }; |
1872 | 1873 | ||
1873 | 1874 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h index d216522a9989..d75368030917 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h +++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h | |||
@@ -179,6 +179,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx); | |||
179 | 179 | ||
180 | void core_link_disable_stream(struct pipe_ctx *pipe_ctx); | 180 | void core_link_disable_stream(struct pipe_ctx *pipe_ctx); |
181 | 181 | ||
182 | void core_link_set_avmute(struct pipe_ctx *pipe_ctx, bool enable); | ||
182 | /********** DAL Core*********************/ | 183 | /********** DAL Core*********************/ |
183 | #include "display_clock.h" | 184 | #include "display_clock.h" |
184 | #include "transform.h" | 185 | #include "transform.h" |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h index 9fb27bd360ac..6ff90a0fef24 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h | |||
@@ -123,6 +123,9 @@ struct stream_encoder_funcs { | |||
123 | struct stream_encoder *enc, | 123 | struct stream_encoder *enc, |
124 | int tg_inst, | 124 | int tg_inst, |
125 | bool enable); | 125 | bool enable); |
126 | |||
127 | void (*set_avmute)( | ||
128 | struct stream_encoder *enc, bool enable); | ||
126 | }; | 129 | }; |
127 | 130 | ||
128 | #endif /* STREAM_ENCODER_H_ */ | 131 | #endif /* STREAM_ENCODER_H_ */ |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h index 97dbd259f66c..d94e8e446ce5 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | |||
@@ -152,6 +152,8 @@ struct hw_sequencer_funcs { | |||
152 | void (*setup_stereo)( | 152 | void (*setup_stereo)( |
153 | struct pipe_ctx *pipe_ctx, | 153 | struct pipe_ctx *pipe_ctx, |
154 | struct core_dc *dc); | 154 | struct core_dc *dc); |
155 | |||
156 | void (*set_avmute)(struct pipe_ctx *pipe_ctx, bool enable); | ||
155 | }; | 157 | }; |
156 | 158 | ||
157 | void color_space_to_black_color( | 159 | void color_space_to_black_color( |
diff --git a/drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c b/drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c index 8de21d9a8079..7fe6085e6e37 100644 --- a/drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/virtual/virtual_stream_encoder.c | |||
@@ -53,6 +53,9 @@ static void virtual_stream_encoder_update_hdmi_info_packets( | |||
53 | static void virtual_stream_encoder_stop_hdmi_info_packets( | 53 | static void virtual_stream_encoder_stop_hdmi_info_packets( |
54 | struct stream_encoder *enc) {} | 54 | struct stream_encoder *enc) {} |
55 | 55 | ||
56 | static void virtual_stream_encoder_set_avmute( | ||
57 | struct stream_encoder *enc, | ||
58 | bool enable) {} | ||
56 | static void virtual_stream_encoder_update_dp_info_packets( | 59 | static void virtual_stream_encoder_update_dp_info_packets( |
57 | struct stream_encoder *enc, | 60 | struct stream_encoder *enc, |
58 | const struct encoder_info_frame *info_frame) {} | 61 | const struct encoder_info_frame *info_frame) {} |
@@ -94,6 +97,7 @@ static const struct stream_encoder_funcs virtual_str_enc_funcs = { | |||
94 | virtual_stream_encoder_dp_unblank, | 97 | virtual_stream_encoder_dp_unblank, |
95 | 98 | ||
96 | .audio_mute_control = virtual_audio_mute_control, | 99 | .audio_mute_control = virtual_audio_mute_control, |
100 | .set_avmute = virtual_stream_encoder_set_avmute, | ||
97 | }; | 101 | }; |
98 | 102 | ||
99 | bool virtual_stream_encoder_construct( | 103 | bool virtual_stream_encoder_construct( |