From patchwork Wed Sep 12 22:57:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 10598427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2767C112B for ; Wed, 12 Sep 2018 22:55:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15B992AC76 for ; Wed, 12 Sep 2018 22:55:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A37C2AC7B; Wed, 12 Sep 2018 22:55:17 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 C21F92AC76 for ; Wed, 12 Sep 2018 22:55:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B91E26E500; Wed, 12 Sep 2018 22:55:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 644786E4B7 for ; Wed, 12 Sep 2018 22:55:11 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 15:55:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,366,1531810800"; d="scan'208";a="85487931" Received: from labuser-z97x-ud5h.jf.intel.com ([10.54.75.151]) by fmsmga002.fm.intel.com with ESMTP; 12 Sep 2018 15:55:09 -0700 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Date: Wed, 12 Sep 2018 15:57:19 -0700 Message-Id: <20180912225719.17574-4-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180912225719.17574-1-manasi.d.navare@intel.com> References: <20180912225719.17574-1-manasi.d.navare@intel.com> Subject: [Intel-gfx] [PATCH v2 4/4] drm/i915/dp: Check eDP fallback link BW against downclock mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP If link training fails on eDP then we fallback to lower link rate and lane count. If the fallback link BW cannot fit the panel's native mode and if the downclock mode exists then we should check if the fallback BW can fit this downclock mode. Suggested-by: Jani Nikula Cc: Jani Nikula Cc: Ville Syrjala Signed-off-by: Manasi Navare --- drivers/gpu/drm/i915/intel_dp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0e400629e85c..bfc56e778d0f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -562,12 +562,21 @@ static bool intel_dp_can_link_train_fallback_for_edp(struct intel_dp *intel_dp, uint8_t lane_count) { struct drm_display_mode *fixed_mode = intel_dp->attached_connector->panel.fixed_mode; + struct drm_display_mode *downclock_mode = + intel_dp->attached_connector->panel.downclock_mode; int mode_rate, max_rate; mode_rate = intel_dp_link_required(fixed_mode->clock, 18); max_rate = intel_dp_max_data_rate(link_rate, lane_count); - if (mode_rate > max_rate) + if (mode_rate > max_rate) { + if (downclock_mode) { + mode_rate = intel_dp_link_required(downclock_mode->clock, + 18); + if (mode_rate > max_rate) + return false; + } return false; + } return true; }