From patchwork Thu Jul 27 12:47:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Gusakov X-Patchwork-Id: 9866733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 747A6603FA for ; Thu, 27 Jul 2017 12:46:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66DE128815 for ; Thu, 27 Jul 2017 12:46:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C0E928817; Thu, 27 Jul 2017 12:46:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C1EA628822 for ; Thu, 27 Jul 2017 12:46:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 591286ECDF; Thu, 27 Jul 2017 12:46:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 226EA6ECDB for ; Thu, 27 Jul 2017 12:46:19 +0000 (UTC) Received: by mail-lf0-x22a.google.com with SMTP id d17so11972981lfe.0 for ; Thu, 27 Jul 2017 05:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vnosjFzxhL+p+6DSE3n7OOvFh6F7nw87VlC+RfgpwZY=; b=bxKBEGcmYGqgSJNfff2De1Mr0Lkx7JyhAh0NDCb5pvEDwrPCXi4MfqjWKzxELb6hmK DMAGOldWJDPdLpCV1HXAAGlKnVJboyR0ZyhyaSQ/Orxgw5GRn6OVF4LLCl1OZjcCsWvz BHfb6z7FD0YE/TIpAUGboUE/9S4vtakcBvHBe2omKCENXVdydB9ODiRZnAEjODUh4aes NHel2n/9W/wvmE+fKiajVthwa9qotpr1PwHBojip8VklzZ75CcZzVZBwdwD//M+PsCkW wQjrACdAK0tzPj6bmpubRz5SQcVJ1DjVTq8QcAbNkDhOKRhGd1VogGIc2V4t1sNXSvo9 loFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vnosjFzxhL+p+6DSE3n7OOvFh6F7nw87VlC+RfgpwZY=; b=Hr7bB//PjG6kqfMXT5+ybrIXcdHVNIw82uXNa73zVeQxCsblkpe1r6iXAgUsG9rMoj HRkA1KKl07s1lchY5selz8QLGVvs/9c3QHAujKM202eODUUdUD5xTLDnz5owqCXQhz87 luLPKIuiMYvgGifRnQ4GKxzVxE5wp4ri5RxE5UNsMAcVOufWWUTh5+OM5c874qEXjHHA Vi5tRX8K6bfvnWPoGlchXaHY8lvherAVp/BzrvpanjHSj9o9kdJc7jsJ4KJtDzE6pVBZ A0Au1/PH+sTGP6Vn02/B9ZjCtlX+bTYiBt6wAOsNNzXApNsLQOlRApkCoq/WfJvJG7B0 8Iog== X-Gm-Message-State: AIVw110XYU8WRL6JRpiv+0o4L1zkT5dgW+y+FZfrG3sgn6OfhzLtwfHD YV7Ey5UAt/YXGf0n2UxfQg== X-Received: by 10.25.192.2 with SMTP id q2mr1562923lff.120.1501159577337; Thu, 27 Jul 2017 05:46:17 -0700 (PDT) Received: from localhost.localdomain (178-16-155-142.obit.ru. [178.16.155.142]) by smtp.gmail.com with ESMTPSA id y10sm3889518lja.49.2017.07.27.05.46.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 05:46:16 -0700 (PDT) From: Andrey Gusakov To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/bridge: tc358767: fix 1-lane behavior Date: Thu, 27 Jul 2017 15:47:36 +0300 Message-Id: <20170727124736.3854-7-andrey.gusakov@cogentembedded.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170727124736.3854-1-andrey.gusakov@cogentembedded.com> References: <20170727124736.3854-1-andrey.gusakov@cogentembedded.com> Cc: Andrey Gusakov , cphealy@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use drm_dp_channel_eq_ok helper Signed-off-by: Andrey Gusakov Acked-by: Philipp Zabel --- 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 84b0b0fff854..24abffae6edb 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; }