drm/amd/display: add detect caps for edp
authorRoman Li <Roman.Li@amd.com>
Wed, 26 Jul 2017 20:27:37 +0000 (16:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:15:50 +0000 (18:15 -0400)
1. The caps detect sequence for edp is different from dp.
   Added separate function for edp.
2. Removed max_link_setting and replaced it with verified
   to avoid confusion.
3. Reverted sink count guard for edp powerdown as unnecessary
   with the changes above.

Signed-off-by: Roman Li <Roman.Li@amd.com>
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h

index 2487046..a983a5e 100644 (file)
@@ -585,7 +585,7 @@ bool dc_link_detect(struct dc_link *link, bool boot)
                }
 
                case SIGNAL_TYPE_EDP: {
-                       detect_dp_sink_caps(link);
+                       detect_edp_sink_caps(link);
                        sink_caps.transaction_type =
                                DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
                        sink_caps.signal = SIGNAL_TYPE_EDP;
index d9754b5..1750634 100644 (file)
@@ -1147,7 +1147,6 @@ bool dp_hbr_verify_link_cap(
                LINK_SPREAD_DISABLED;
        }
 
-       link->max_link_setting = link->verified_link_cap;
 
        return success;
 }
@@ -1466,7 +1465,7 @@ void decide_link_settings(struct dc_stream *stream,
      * 2. could support the b/w requested by the timing
      */
        while (current_link_setting.link_rate <=
-                       link->max_link_setting.link_rate) {
+                       link->verified_link_cap.link_rate) {
                link_bw = bandwidth_in_kbps_from_link_settings(
                                &current_link_setting);
                if (req_bw <= link_bw) {
@@ -1475,7 +1474,7 @@ void decide_link_settings(struct dc_stream *stream,
                }
 
                if (current_link_setting.lane_count <
-                               link->max_link_setting.lane_count) {
+                               link->verified_link_cap.lane_count) {
                        current_link_setting.lane_count =
                                        increase_lane_count(
                                                        current_link_setting.lane_count);
@@ -2294,6 +2293,12 @@ void detect_dp_sink_caps(struct dc_link *link)
        /* TODO save sink caps in link->sink */
 }
 
+void detect_edp_sink_caps(struct dc_link *link)
+{
+       retrieve_link_cap(link);
+       link->verified_link_cap = link->reported_link_cap;
+}
+
 void dc_link_dp_enable_hpd(const struct dc_link *link)
 {
        struct link_encoder *encoder = link->link_enc;
index 76dc169..f2f57a7 100644 (file)
@@ -114,9 +114,7 @@ void dp_disable_link_phy(struct dc_link *link, enum signal_type signal)
 
        if (signal == SIGNAL_TYPE_EDP) {
                link->link_enc->funcs->backlight_control(link->link_enc, false);
-               if (link->dpcd_sink_count)
-                       link->link_enc->funcs->power_control(link->link_enc,
-                                                                       false);
+               link->link_enc->funcs->power_control(link->link_enc, false);
        }
 
        link->link_enc->funcs->disable_output(link->link_enc, signal);
index b20f7bf..58bfb86 100644 (file)
@@ -744,7 +744,6 @@ struct dc_link {
         */
        struct dc_link_settings reported_link_cap;
        struct dc_link_settings verified_link_cap;
-       struct dc_link_settings max_link_setting;
        struct dc_link_settings cur_link_settings;
        struct dc_lane_settings cur_lane_setting;
        struct dc_link_settings preferred_link_setting;
index 5b41850..1a4a605 100644 (file)
@@ -63,6 +63,8 @@ bool is_mst_supported(struct dc_link *link);
 
 void detect_dp_sink_caps(struct dc_link *link);
 
+void detect_edp_sink_caps(struct dc_link *link);
+
 bool is_dp_active_dongle(const struct dc_link *link);
 
 void dp_enable_mst_on_sink(struct dc_link *link, bool enable);