From patchwork Mon Feb 5 19:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10201613 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 3FC5A602CA for ; Mon, 5 Feb 2018 19:38:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FC0F205FC for ; Mon, 5 Feb 2018 19:38:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 245A3287DA; Mon, 5 Feb 2018 19:38:55 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 B17E7205FC for ; Mon, 5 Feb 2018 19:38:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C47616E330; Mon, 5 Feb 2018 19:38:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 480696E32B for ; Mon, 5 Feb 2018 19:38:47 +0000 (UTC) Received: by mail-qk0-x241.google.com with SMTP id d72so3930890qkc.6 for ; Mon, 05 Feb 2018 11:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=fo6+tcKSkSnOpHVwoNg78Y00StS8iTPfxhjElrzIrSo=; b=WUw67pmrJQImMUAl58Mvq5MryWGWkjywWoUFSqBAv/tYmGkUAV2fUvAqK/JersBwkX 4xVhMR9U5icoWgOYWx0y9r2ccqobmI/ZP7DCsdRGwPXhTKHCWMGEOoMIy9fgCSeSMlTJ 3zq8lm/RHXPdmVjZ/4uJfk+VPL0LcloTFZ3bAC28akSndCgDrWK7cBGOMPl0+8wnVQOG Uh8+pf3ZWJbVLVT+SaaNNooyuiWmbBfhCGvFQ4KhchAYylvnt1AMV3nRK9SZAWqRhiXw Pnub8c9d6CW6aUZhOLuCCNXYerSS/3Ouv2dbPh7ve/+4GZHcICmqj8qYan/nTQp40Gkd /qwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=fo6+tcKSkSnOpHVwoNg78Y00StS8iTPfxhjElrzIrSo=; b=rnY1Ls9R/oMUhBglnGMjj10UVOAo5g9qFpIONgNt+uQAGH9V2bPwKBhlAYTs9bgwZ/ EROZCCBAiwT3eFBazC0SJ5zWAPrEH7WCPFcqmNu9doqQLs0a5pQ+cqdjzDiBk0VeAarb xbzm0rOw7V3uoztGvh2dlbKzu5ELIYkWhWQ/KfXO/w0ui62FOPUkyKNfnh+N4IXrB+F8 4KLA3Dpmz0rCIbwty/L/sgLF0XityfPzx2iSO6XU3qFJVU2j/q1ql9TQSMjWxYDwUqDa DZZQihz6ihaE/Q1N867u0SG7N4AImee6NqlxVlzVn6DnVn6relmvkQn79GFcvlgK9sIw /jaA== X-Gm-Message-State: AKwxytffmf4Zrtz6M9F/943uYh4HCYgRFKheg0RSLJIs4j8/kYsyIFU5 lDr5cPmDU1wstRbrYULJWAoVuw== X-Google-Smtp-Source: AH8x227EkOy/USMMmIN5oBvBfXPcjG57wGpEefZ2Uc9Dxsfc7WV+7FJ9yn98uq5KI8VsZC3zptcMPg== X-Received: by 10.233.221.197 with SMTP id r188mr77698721qkf.107.1517859526246; Mon, 05 Feb 2018 11:38:46 -0800 (PST) Received: from localhost (p200300E41F41B00009B231EAB1BE76D4.dip0.t-ipconnect.de. [2003:e4:1f41:b000:9b2:31ea:b1be:76d4]) by smtp.gmail.com with ESMTPSA id u67sm3721907qkc.4.2018.02.05.11.38.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Feb 2018 11:38:45 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH 06/17] drm/dp: Read fast training capability from link Date: Mon, 5 Feb 2018 20:38:16 +0100 Message-Id: <20180205193827.20374-7-thierry.reding@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180205193827.20374-1-thierry.reding@gmail.com> References: <20180205193827.20374-1-thierry.reding@gmail.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 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 From: Thierry Reding While probing the DisplayPort link, query the fast training capability. If supported, drivers can use the fast link training sequence instead of the more involved full link training sequence. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_dp_helper.c | 3 +++ include/drm/drm_dp_helper.h | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 982dd9febb1c..2d56aeda1b75 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -334,12 +334,14 @@ EXPORT_SYMBOL(drm_dp_dpcd_read_link_status); static void drm_dp_link_caps_reset(struct drm_dp_link_caps *caps) { caps->enhanced_framing = false; + caps->fast_training = false; } void drm_dp_link_caps_copy(struct drm_dp_link_caps *dest, const struct drm_dp_link_caps *src) { dest->enhanced_framing = src->enhanced_framing; + dest->fast_training = src->fast_training; } EXPORT_SYMBOL(drm_dp_link_caps_copy); @@ -385,6 +387,7 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link) link->max_lanes = drm_dp_max_lane_count(values); link->caps.enhanced_framing = drm_dp_enhanced_frame_cap(values); + link->caps.fast_training = drm_dp_fast_training_cap(values); link->rate = link->max_rate; link->lanes = link->max_lanes; diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 85ff67958875..680d6719d463 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -976,6 +976,13 @@ drm_dp_is_branch(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) return dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT; } +static inline bool +drm_dp_fast_training_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE]) +{ + return dpcd[DP_DPCD_REV] >= 0x11 && + (dpcd[DP_MAX_DOWNSPREAD] & DP_NO_AUX_HANDSHAKE_LINK_TRAINING); +} + /* * DisplayPort AUX channel */ @@ -1103,9 +1110,11 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, /** * struct drm_dp_link_caps - DP link capabilities * @enhanced_framing: enhanced framing capability (mandatory as of DP 1.2) + * @fast_training: AUX CH handshake not required for link training */ struct drm_dp_link_caps { bool enhanced_framing; + bool fast_training; }; void drm_dp_link_caps_copy(struct drm_dp_link_caps *dest,