From patchwork Thu Jul 27 12:47:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Gusakov X-Patchwork-Id: 9866739 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 8953160382 for ; Thu, 27 Jul 2017 12:46:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BEA028815 for ; Thu, 27 Jul 2017 12:46:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 710C828817; Thu, 27 Jul 2017 12:46:36 +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 B5DA72881C 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 362356ECD6; Thu, 27 Jul 2017 12:46:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) by gabe.freedesktop.org (Postfix) with ESMTPS id 60F276ECD5 for ; Thu, 27 Jul 2017 12:46:12 +0000 (UTC) Received: by mail-lf0-x234.google.com with SMTP id m86so72591123lfi.4 for ; Thu, 27 Jul 2017 05:46:12 -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=X3TpLen9MzyX/g/cTRwxp2LTz3kevnVYSC0yHhrUlBQ=; b=mZ/ANGe7JAHfr7Bldjc7Vel8W1pD3AwD6uqVcpj+ZZcZIGJICMcB9jyhJ9YirczkgA 5vvlo2vBPofPF4Mwy+oL+9nz1AGCjmS5wdnHQv3tJVOjk3JbfFonwkY/+mI3FCMT7xr/ 5HEXcdVDYMnNbGaVGb1gU//gvtPhtZ3q0PKAt2iAhX7laN6mIQ8PBYm6HltjqR46+vzH 19NmeuGAdbIZCEGpklszb4AlQ00VKXi0LqlJ58eTD4SK671JSUOsOoAfVFbmg0BoR8gk YIur5yk4H8LqmpXB7LkHtsoG0C0hFB8dtRdOC7aRSBU2vOQlVzx8SxdQuzvXJduxnACR xWpw== 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=X3TpLen9MzyX/g/cTRwxp2LTz3kevnVYSC0yHhrUlBQ=; b=bJppxcBhlTo0H20MgaQEsL4Td6GR29SfD3Z7Gehc6ZoDDBKbVwDKR6V/AzRYBDf9Y7 KOm0vTY1bnnf49A5M/z5/mtIc7kYuuMYMn6ytikRIzDWUmiYrfG33TGCRvO2koBVzD2y 2G5o9jNNnqOI24Cb5Nn2XsGmsZy+01TY+2PKmDvoucqzVIppmhhk1PDLTiOKas0E0+ls TaoRVRJX675rhdeRsw/Vf9BxJDHFbfi/wEqmAtGnjVmfo7JHSEVsbY9TShT/sW7aYwof 9B0474XtdaqSKNYXxkFjT/ifQ313Om+eNNB5+wPr2KtxoqwTn+ui6iQEjEO9/QRl1eVZ 5a0Q== X-Gm-Message-State: AIVw111z5NgMj7ZpR0K6DTJ/b8pXlR7s4wmFgbMujY9eo/WlB2lhVM8I x/01r0CLByysOf++h/VlPg== X-Received: by 10.46.8.1 with SMTP id 1mr1765602lji.48.1501159570585; Thu, 27 Jul 2017 05:46:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 05:46:10 -0700 (PDT) From: Andrey Gusakov To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] drm/bridge: tc358767: do no fail on hi-res displays Date: Thu, 27 Jul 2017 15:47:31 +0300 Message-Id: <20170727124736.3854-2-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 Do not fail data rates higher than 2.7 and more than 2 lanes. Try to fall back to 2.7Gbps and 2 lanes. Signed-off-by: Andrey Gusakov Acked-by: Philipp Zabel --- drivers/gpu/drm/bridge/tc358767.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 5c26488e7a2d..f605bb7d1aa3 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -603,8 +603,15 @@ static int tc_get_display_props(struct tc_data *tc) ret = drm_dp_link_probe(&tc->aux, &tc->link.base); if (ret < 0) goto err_dpcd_read; - if ((tc->link.base.rate != 162000) && (tc->link.base.rate != 270000)) - goto err_dpcd_inval; + if ((tc->link.base.rate != 162000) && (tc->link.base.rate != 270000)) { + dev_dbg(tc->dev, "Falling to 2.7 Gbps rate\n"); + tc->link.base.rate = 270000; + } + + if (tc->link.base.num_lanes > 2) { + dev_dbg(tc->dev, "Falling to 2 lanes\n"); + tc->link.base.num_lanes = 2; + } ret = drm_dp_dpcd_readb(&tc->aux, DP_MAX_DOWNSPREAD, tmp); if (ret < 0) @@ -637,9 +644,6 @@ static int tc_get_display_props(struct tc_data *tc) err_dpcd_read: dev_err(tc->dev, "failed to read DPCD: %d\n", ret); return ret; -err_dpcd_inval: - dev_err(tc->dev, "invalid DPCD\n"); - return -EINVAL; } static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode)