<div dir="auto">This seems to lack a commit msg<div dir="auto"><br></div><div dir="auto">Dave.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 Sep. 2017 4:15 am, "Harry Wentland" <<a href="mailto:harry.wentland@amd.com">harry.wentland@amd.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Hersen Wu <<a href="mailto:hersenxs.wu@amd.com">hersenxs.wu@amd.com</a>><br>
<br>
Signed-off-by: Hersen Wu <<a href="mailto:hersenxs.wu@amd.com">hersenxs.wu@amd.com</a>><br>
Reviewed-by: Tony Cheng <<a href="mailto:Tony.Cheng@amd.com">Tony.Cheng@amd.com</a>><br>
Acked-by: Harry Wentland <<a href="mailto:Harry.Wentland@amd.com">Harry.Wentland@amd.com</a>><br>
---<br>
 drivers/gpu/drm/amd/display/<wbr>amdgpu_dm/amdgpu_dm.c |  9 ++++---<br>
 drivers/gpu/drm/amd/display/<wbr>dc/core/dc_link.c     | 32 +++++++++++++++--------<br>
 drivers/gpu/drm/amd/display/<wbr>dc/dc.h               |  8 +++++-<br>
 3 files changed, 33 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/<wbr>amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/<wbr>amdgpu_dm/amdgpu_dm.c<br>
index 7a408d753be8..9b5158cceece 100644<br>
--- a/drivers/gpu/drm/amd/display/<wbr>amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/<wbr>amdgpu_dm/amdgpu_dm.c<br>
@@ -639,7 +639,7 @@ int amdgpu_dm_display_resume(<wbr>struct amdgpu_device *adev )<br>
                        continue;<br>
<br>
                mutex_lock(&aconnector->hpd_<wbr>lock);<br>
-               dc_link_detect(aconnector->dc_<wbr>link, false);<br>
+               dc_link_detect(aconnector->dc_<wbr>link, DETECT_REASON_HPD);<br>
                aconnector->dc_sink = NULL;<br>
                amdgpu_dm_update_connector_<wbr>after_detect(aconnector);<br>
                mutex_unlock(&aconnector->hpd_<wbr>lock);<br>
@@ -870,7 +870,7 @@ static void handle_hpd_irq(void *param)<br>
         * since (for MST case) MST does this in it's own context.<br>
         */<br>
        mutex_lock(&aconnector->hpd_<wbr>lock);<br>
-       if (dc_link_detect(aconnector-><wbr>dc_link, false)) {<br>
+       if (dc_link_detect(aconnector-><wbr>dc_link, DETECT_REASON_HPD)) {<br>
                amdgpu_dm_update_connector_<wbr>after_detect(aconnector);<br>
<br>
<br>
@@ -980,7 +980,7 @@ static void handle_hpd_rx_irq(void *param)<br>
        if (dc_link_handle_hpd_rx_irq(<wbr>aconnector->dc_link, NULL) &&<br>
                        !is_mst_root_connector) {<br>
                /* Downstream Port status changed. */<br>
-               if (dc_link_detect(aconnector-><wbr>dc_link, false)) {<br>
+               if (dc_link_detect(aconnector-><wbr>dc_link, DETECT_REASON_HPDRX)) {<br>
                        amdgpu_dm_update_connector_<wbr>after_detect(aconnector);<br>
<br>
<br>
@@ -1368,7 +1368,8 @@ int amdgpu_dm_initialize_drm_<wbr>device(struct amdgpu_device *adev)<br>
                        goto fail_free_encoder;<br>
                }<br>
<br>
-               if (dc_link_detect(dc_get_link_<wbr>at_index(dm->dc, i), true))<br>
+               if (dc_link_detect(dc_get_link_<wbr>at_index(dm->dc, i),<br>
+                               DETECT_REASON_BOOT))<br>
                        amdgpu_dm_update_connector_<wbr>after_detect(aconnector);<br>
        }<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/<wbr>dc/core/dc_link.c b/drivers/gpu/drm/amd/display/<wbr>dc/core/dc_link.c<br>
index cea8dafd2edc..845ec421d861 100644<br>
--- a/drivers/gpu/drm/amd/display/<wbr>dc/core/dc_link.c<br>
+++ b/drivers/gpu/drm/amd/display/<wbr>dc/core/dc_link.c<br>
@@ -355,7 +355,9 @@ static bool is_dp_sink_present(struct dc_link *link)<br>
  * @brief<br>
  * Detect output sink type<br>
  */<br>
-static enum signal_type link_detect_sink(struct dc_link *link)<br>
+static enum signal_type link_detect_sink(<br>
+       struct dc_link *link,<br>
+       enum dc_detect_reason reason)<br>
 {<br>
        enum signal_type result = get_basic_signal_type(<br>
                link->link_enc->id, link->link_id);<br>
@@ -388,12 +390,17 @@ static enum signal_type link_detect_sink(struct dc_link *link)<br>
        }<br>
        break;<br>
        case CONNECTOR_ID_DISPLAY_PORT: {<br>
-<br>
-               /* Check whether DP signal detected: if not -<br>
-                * we assume signal is DVI; it could be corrected<br>
-                * to HDMI after dongle detection */<br>
-               if (!is_dp_sink_present(link))<br>
-                       result = SIGNAL_TYPE_DVI_SINGLE_LINK;<br>
+               /* DP HPD short pulse. Passive DP dongle will not<br>
+                * have short pulse<br>
+                */<br>
+               if (reason != DETECT_REASON_HPDRX) {<br>
+                       /* Check whether DP signal detected: if not -<br>
+                        * we assume signal is DVI; it could be corrected<br>
+                        * to HDMI after dongle detection<br>
+                        */<br>
+                       if (!is_dp_sink_present(link))<br>
+                               result = SIGNAL_TYPE_DVI_SINGLE_LINK;<br>
+               }<br>
        }<br>
        break;<br>
        default:<br>
@@ -460,9 +467,10 @@ static void detect_dp(<br>
        struct display_sink_capability *sink_caps,<br>
        bool *converter_disable_audio,<br>
        struct audio_support *audio_support,<br>
-       bool boot)<br>
+       enum dc_detect_reason reason)<br>
 {<br>
-       sink_caps->signal = link_detect_sink(link);<br>
+       bool boot = false;<br>
+       sink_caps->signal = link_detect_sink(link, reason);<br>
        sink_caps->transaction_type =<br>
                get_ddc_transaction_type(sink_<wbr>caps->signal);<br>
<br>
@@ -513,6 +521,8 @@ static void detect_dp(<br>
                         * Need check ->sink usages in case ->sink = NULL<br>
                         * TODO: s3 resume check<br>
                         */<br>
+                       if (reason == DETECT_REASON_BOOT)<br>
+                               boot = true;<br>
<br>
                        if (dm_helpers_dp_mst_start_top_<wbr>mgr(<br>
                                link->ctx,<br>
@@ -531,7 +541,7 @@ static void detect_dp(<br>
        }<br>
 }<br>
<br>
-bool dc_link_detect(struct dc_link *link, bool boot)<br>
+bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)<br>
 {<br>
        struct dc_sink_init_data sink_init_data = { 0 };<br>
        struct display_sink_capability sink_caps = { 0 };<br>
@@ -596,7 +606,7 @@ bool dc_link_detect(struct dc_link *link, bool boot)<br>
                                link,<br>
                                &sink_caps,<br>
                                &converter_disable_audio,<br>
-                               aud_support, boot);<br>
+                               aud_support, reason);<br>
<br>
                        /* Active dongle downstream unplug */<br>
                        if (link->type == dc_connection_active_dongle<br>
diff --git a/drivers/gpu/drm/amd/display/<wbr>dc/dc.h b/drivers/gpu/drm/amd/display/<wbr>dc/dc.h<br>
index f005add1aba3..bf2d42561362 100644<br>
--- a/drivers/gpu/drm/amd/display/<wbr>dc/dc.h<br>
+++ b/drivers/gpu/drm/amd/display/<wbr>dc/dc.h<br>
@@ -884,7 +884,13 @@ bool dc_link_setup_psr(struct dc_link *dc_link,<br>
  * true otherwise. True meaning further action is required (status update<br>
  * and OS notification).<br>
  */<br>
-bool dc_link_detect(struct dc_link *dc_link, bool boot);<br>
+enum dc_detect_reason {<br>
+       DETECT_REASON_BOOT,<br>
+       DETECT_REASON_HPD,<br>
+       DETECT_REASON_HPDRX,<br>
+};<br>
+<br>
+bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);<br>
<br>
 /* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).<br>
  * Return:<br>
--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/amd-gfx</a><br>
</blockquote></div></div>