diff mbox

[19/41] drm/bridge: analogix_dp: Wait for HPD signal before configuring link

Message ID 20170310043305.17216-20-seanpaul@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Paul March 10, 2017, 4:32 a.m. UTC
From: zain wang <wzz@rock-chips.com>

According to DP spec v1.3 chap 3.5.1.2 Link Training, Link Policy Maker
must first detect that the HPD signal is asserted high by the Downstream
Device before establishing a link with it.

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Andrzej Hajda March 16, 2017, 2:51 p.m. UTC | #1
On 10.03.2017 05:32, Sean Paul wrote:
> From: zain wang <wzz@rock-chips.com>
>
> According to DP spec v1.3 chap 3.5.1.2 Link Training, Link Policy Maker
> must first detect that the HPD signal is asserted high by the Downstream
> Device before establishing a link with it.
>
> Cc: Stéphane Marchesin <marcheu@chromium.org>
> Signed-off-by: zain wang <wzz@rock-chips.com>
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> index f3eea7636a2e..048b6f7c9b6e 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
> @@ -1172,6 +1172,15 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
>  	if (ret)
>  		goto out_dp_init;
>  
> +	/* According to DP spec v1.3 chap 3.5.1.2 Link Training,
> +	 * We should first make sure the HPD signal is asserted high by device
> +	 * when we want to establish a link with it. */
> +	ret = analogix_dp_detect_hpd(dp);
> +	if (ret) {
> +		DRM_ERROR("failed to get hpd single ret = %d\n", ret);
> +		goto out_dp_init;
> +	}
> +

With previous patch analogix_dp_set_bridge will be repeated even if hpd
is low, is it desired behavior?

Regards
Andrzej


>  	ret = analogix_dp_commit(dp);
>  	if (ret)
>  		goto out_dp_init;
diff mbox

Patch

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index f3eea7636a2e..048b6f7c9b6e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1172,6 +1172,15 @@  static int analogix_dp_set_bridge(struct analogix_dp_device *dp)
 	if (ret)
 		goto out_dp_init;
 
+	/* According to DP spec v1.3 chap 3.5.1.2 Link Training,
+	 * We should first make sure the HPD signal is asserted high by device
+	 * when we want to establish a link with it. */
+	ret = analogix_dp_detect_hpd(dp);
+	if (ret) {
+		DRM_ERROR("failed to get hpd single ret = %d\n", ret);
+		goto out_dp_init;
+	}
+
 	ret = analogix_dp_commit(dp);
 	if (ret)
 		goto out_dp_init;