From patchwork Fri Mar 9 07:08:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 10269803 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 7BC7060236 for ; Fri, 9 Mar 2018 07:06:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E75F1FEB1 for ; Fri, 9 Mar 2018 07:06:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6044829B69; Fri, 9 Mar 2018 07:06:38 +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.2 required=2.0 tests=BAYES_00, 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 C16001FEB1 for ; Fri, 9 Mar 2018 07:06:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 35A396E986; Fri, 9 Mar 2018 07:06:37 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C4CE6E986 for ; Fri, 9 Mar 2018 07:06:35 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2018 23:06:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,444,1515484800"; d="scan'208";a="37275484" Received: from labuser-z97x-ud5h.jf.intel.com ([10.54.75.151]) by orsmga001.jf.intel.com with ESMTP; 08 Mar 2018 23:06:34 -0800 From: Manasi Navare To: intel-gfx@lists.freedesktop.org Date: Thu, 8 Mar 2018 23:08:59 -0800 Message-Id: <1520579339-14745-1-git-send-email-manasi.d.navare@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] drm/i915/dp: Do not set the eDP link rate/lane count to max 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 The panels are generally designed to support only a single clock and lane configuration, and typically these values correspond to the native resolution of the panel. But some panels advertise the MAX_LINK_RATE in DPCD higher than what is required to support the native resolution. So optimize and set the link rate and lane count to the least values required by the panel to support the native resolution. This will also be an effective power saving for such eDP panels. Cc: Jani Nikula Cc: Ville Syrjala Cc: Matt Atwood Signed-off-by: Manasi Navare --- drivers/gpu/drm/i915/intel_dp.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 8d1d7af..ba1114b 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1812,15 +1812,14 @@ intel_dp_compute_config(struct intel_encoder *encoder, bpp = dev_priv->vbt.edp.bpp; } - /* - * Use the maximum clock and number of lanes the eDP panel - * advertizes being capable of. The panels are generally - * designed to support only a single clock and lane - * configuration, and typically these values correspond to the - * native resolution of the panel. + /* The panels are generally designed to support only a single + * clock and lane configuration, and typically these values + * correspond to the native resolution of the panel. But some + * panels advertise higher link rates that might not be required + * for the native resolution of the panel. So use the least + * required link rate/lane count for the panel's native + * resolution. */ - min_lane_count = max_lane_count; - min_clock = max_clock; } for (; bpp >= 6*3; bpp -= 2*3) {