dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
To: dri-devel@lists.freedesktop.org
Cc: andrey.gusakov@cogentembedded.com, cphealy@gmail.com
Subject: [PATCH v2 6/7] drm/bridge: tc358767: fix 1-lane behavior
Date: Fri,  3 Nov 2017 20:01:33 +0300	[thread overview]
Message-ID: <1509728494-23508-7-git-send-email-andrey.gusakov@cogentembedded.com> (raw)
In-Reply-To: <1509728494-23508-1-git-send-email-andrey.gusakov@cogentembedded.com>

Use drm_dp_channel_eq_ok helper
---
 drivers/gpu/drm/bridge/tc358767.c |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 4394131..1e677be 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -819,8 +819,6 @@ static int tc_main_link_setup(struct tc_data *tc)
 	unsigned int rate;
 	u32 dp_phy_ctrl;
 	int timeout;
-	bool aligned;
-	bool ready;
 	u32 value;
 	int ret;
 	u8 tmp[8];
@@ -965,16 +963,15 @@ static int tc_main_link_setup(struct tc_data *tc)
 		ret = drm_dp_dpcd_read_link_status(aux, tmp + 2);
 		if (ret < 0)
 			goto err_dpcd_read;
-		ready = (tmp[2] == ((DP_CHANNEL_EQ_BITS << 4) | /* Lane1 */
-				     DP_CHANNEL_EQ_BITS));      /* Lane0 */
-		aligned = tmp[4] & DP_INTERLANE_ALIGN_DONE;
-	} while ((--timeout) && !(ready && aligned));
+	} while ((--timeout) &&
+		 !(drm_dp_channel_eq_ok(tmp + 2,  tc->link.base.num_lanes)));
 
 	if (timeout == 0) {
 		/* Read DPCD 0x200-0x201 */
 		ret = drm_dp_dpcd_read(aux, DP_SINK_COUNT, tmp, 2);
 		if (ret < 0)
 			goto err_dpcd_read;
+		dev_err(dev, "channel(s) EQ not ok\n");
 		dev_info(dev, "0x0200 SINK_COUNT: 0x%02x\n", tmp[0]);
 		dev_info(dev, "0x0201 DEVICE_SERVICE_IRQ_VECTOR: 0x%02x\n",
 			 tmp[1]);
@@ -985,10 +982,6 @@ static int tc_main_link_setup(struct tc_data *tc)
 		dev_info(dev, "0x0206 ADJUST_REQUEST_LANE0_1: 0x%02x\n",
 			 tmp[6]);
 
-		if (!ready)
-			dev_err(dev, "Lane0/1 not ready\n");
-		if (!aligned)
-			dev_err(dev, "Lane0/1 not aligned\n");
 		return -EAGAIN;
 	}
 
-- 
1.7.10.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-11-03 17:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20171103170146epcas2p320108013d3b9c998fc97a7e705c73e15@epcas2p3.samsung.com>
2017-11-03 17:01 ` [PATCH v2 0/7] drm/bridge: tc358767: fixes and improvements (resend) Andrey Gusakov
2017-11-03 17:01   ` [PATCH v2 1/7] drm/bridge: tc358767: do no fail on hi-res displays Andrey Gusakov
2017-11-06  7:25     ` Andrzej Hajda
2017-11-03 17:01   ` [PATCH v2 2/7] drm/bridge: tc358767: filter out too high modes Andrey Gusakov
2017-11-06  7:50     ` Andrzej Hajda
2017-11-03 17:01   ` [PATCH v2 3/7] drm/bridge: tc358767: fix DP0_MISC register set Andrey Gusakov
2017-11-03 17:01   ` [PATCH v2 4/7] drm/bridge: tc358767: fix timing calculations Andrey Gusakov
2017-11-03 17:01   ` [PATCH v2 5/7] drm/bridge: tc358767: fix AUXDATAn registers access Andrey Gusakov
2017-11-03 17:01   ` Andrey Gusakov [this message]
2017-11-03 17:01   ` [PATCH v2 7/7] drm/bridge: tc358767: add copyright lines Andrey Gusakov
2017-11-06  7:58   ` [PATCH v2 0/7] drm/bridge: tc358767: fixes and improvements (resend) Andrzej Hajda
2017-11-07  4:41     ` Archit Taneja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1509728494-23508-7-git-send-email-andrey.gusakov@cogentembedded.com \
    --to=andrey.gusakov@cogentembedded.com \
    --cc=cphealy@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).