drm/amd/display: Adding dm controlled signal type in dc_stream
authorSylvia Tsai <sylvia.tsai@amd.com>
Tue, 4 Apr 2017 21:28:17 +0000 (17:28 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 21:23:22 +0000 (17:23 -0400)
- Adding dm controlled signal type in dc_stream
- Adding fallback to dvi signal when output signal is hdmi and the connector
  type is not

Signed-off-by: Sylvia Tsai <sylvia.tsai@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Sylvia Tsai <Sylvia.Tsai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/dc.h

index 069f588a9e0282da51cf95aceddcec9c2b9e4475..2d40864b7b48675184e6ac4d5eab37622c755590 100644 (file)
@@ -1237,22 +1237,22 @@ static struct audio *find_first_free_audio(struct resource_context *res_ctx)
 
 static void update_stream_signal(struct core_stream *stream)
 {
-       const struct dc_sink *dc_sink = stream->public.sink;
-
-       if (dc_sink->sink_signal == SIGNAL_TYPE_NONE)
-               stream->signal = stream->sink->link->public.connector_signal;
-       else if (dc_sink->sink_signal == SIGNAL_TYPE_DVI_SINGLE_LINK ||
-                       dc_sink->sink_signal == SIGNAL_TYPE_DVI_DUAL_LINK)
-               /* For asic supports dual link DVI, we should adjust signal type
-                * based on timing pixel clock. If pixel clock more than 165Mhz,
-                * signal is dual link, otherwise, single link.
-                */
-               if (stream->public.timing.pix_clk_khz > TMDS_MAX_PIXEL_CLOCK_IN_KHZ)
-                       stream->signal = SIGNAL_TYPE_DVI_DUAL_LINK;
+       if (stream->public.output_signal == SIGNAL_TYPE_NONE) {
+               const struct dc_sink *dc_sink = stream->public.sink;
+
+               if (dc_sink->sink_signal == SIGNAL_TYPE_NONE)
+                       stream->signal =
+                                       stream->sink->link->
+                                       public.connector_signal;
                else
-                       stream->signal = SIGNAL_TYPE_DVI_SINGLE_LINK;
-       else
-               stream->signal = dc_sink->sink_signal;
+                       stream->signal = dc_sink->sink_signal;
+       } else {
+               stream->signal = stream->public.output_signal;
+       }
+
+       if (stream->signal == SIGNAL_TYPE_DVI_SINGLE_LINK &&
+               stream->public.timing.pix_clk_khz > TMDS_MAX_PIXEL_CLOCK_IN_KHZ)
+               stream->signal = SIGNAL_TYPE_DVI_DUAL_LINK;
 }
 
 bool resource_is_stream_unchanged(
index a27a6aba0df16edb6d13f99c0a3a79860eb358e5..97af8f63eec337452b992304d8020b41da1964c4 100644 (file)
@@ -411,6 +411,7 @@ enum surface_update_type {
 struct dc_stream {
        const struct dc_sink *sink;
        struct dc_crtc_timing timing;
+       enum signal_type output_signal;
 
        enum dc_color_space output_color_space;