From patchwork Wed Sep 12 22:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Navare, Manasi" X-Patchwork-Id: 10598425 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 07BA4112B for ; Wed, 12 Sep 2018 22:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA6D62AC76 for ; Wed, 12 Sep 2018 22:55:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD7C22AC7B; Wed, 12 Sep 2018 22:55:15 +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 91C8C2AC76 for ; Wed, 12 Sep 2018 22:55:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DD016E4BC; 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 8B2DF6E4FF 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="85487930" 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:17 -0700 Message-Id: <20180912225719.17574-2-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 2/4] drm/i915/dp: Disconnect eDP downclock mode from DRRS 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 Downclock mode of the panel needs to be set independently of DRRS so that the user can set the downclock mode on the panel without enabling DRRS. This patch sets the downclock mode in edp_init as opposed to drrs_init to achieve this. Suggested-by: Jani Nikula Cc: Jani Nikula Cc: Ville Syrjala Signed-off-by: Manasi Navare --- drivers/gpu/drm/i915/intel_dp.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e4de5257cd87..30526c02b343 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -6371,44 +6371,30 @@ void intel_edp_drrs_flush(struct drm_i915_private *dev_priv, * This function is called only once at driver load to initialize basic * DRRS stuff. * - * Returns: - * Downclock mode if panel supports it, else return NULL. - * DRRS support is determined by the presence of downclock mode (apart - * from VBT setting). */ -static struct drm_display_mode * +static void intel_dp_drrs_init(struct intel_connector *connector, struct drm_display_mode *fixed_mode) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct drm_display_mode *downclock_mode = NULL; INIT_DELAYED_WORK(&dev_priv->drrs.work, intel_edp_drrs_downclock_work); mutex_init(&dev_priv->drrs.mutex); if (INTEL_GEN(dev_priv) <= 6) { DRM_DEBUG_KMS("DRRS supported for Gen7 and above\n"); - return NULL; + return; } if (dev_priv->vbt.drrs_type != SEAMLESS_DRRS_SUPPORT) { DRM_DEBUG_KMS("VBT doesn't support DRRS\n"); - return NULL; - } - - downclock_mode = intel_find_panel_downclock(dev_priv, fixed_mode, - &connector->base); - - if (!downclock_mode) { - DRM_DEBUG_KMS("Downclock mode is not found. DRRS not supported\n"); - return NULL; + return; } dev_priv->drrs.type = dev_priv->vbt.drrs_type; dev_priv->drrs.refresh_rate_type = DRRS_HIGH_RR; DRM_DEBUG_KMS("seamless DRRS supported for eDP panel.\n"); - return downclock_mode; } static bool intel_edp_init_connector(struct intel_dp *intel_dp, @@ -6476,8 +6462,13 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, list_for_each_entry(scan, &connector->probed_modes, head) { if ((scan->type & DRM_MODE_TYPE_PREFERRED)) { fixed_mode = drm_mode_duplicate(dev, scan); - downclock_mode = intel_dp_drrs_init( - intel_connector, fixed_mode); + downclock_mode = intel_find_panel_downclock(dev_priv, + fixed_mode, + connector); + if (downclock_mode) + intel_dp_drrs_init(intel_connector, fixed_mode); + else + DRM_DEBUG_KMS("Downclock mode is not found. DRRS not supported\n"); break; } }