From patchwork Wed Apr 6 11:54:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: durgadoss.r@intel.com X-Patchwork-Id: 8760941 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 154B09F3D1 for ; Wed, 6 Apr 2016 11:13:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 44F832021F for ; Wed, 6 Apr 2016 11:13:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CC06120219 for ; Wed, 6 Apr 2016 11:13:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 592126E8CE; Wed, 6 Apr 2016 11:13:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 717EA6E8CE for ; Wed, 6 Apr 2016 11:13:40 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP; 06 Apr 2016 04:13:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="80073307" Received: from dr3-desktop.iind.intel.com ([10.223.26.125]) by fmsmga004.fm.intel.com with ESMTP; 06 Apr 2016 04:13:38 -0700 From: Durgadoss R To: intel-gfx@lists.freedesktop.org Date: Wed, 6 Apr 2016 17:24:00 +0530 Message-Id: <1459943641-12179-4-git-send-email-durgadoss.r@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459943641-12179-1-git-send-email-durgadoss.r@intel.com> References: <1459943641-12179-1-git-send-email-durgadoss.r@intel.com> Cc: ander.conselvan.de.oliveira@intel.com Subject: [Intel-gfx] [PATCHv3 3/4] drm/i915: Update dpll_hw_state if mask is same X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the dpll_hw_state of a particular pll config is not updated if the crtc_mask is non-zero, indicating possibly shared dpll. But for things like upfront link training, dpll_hw_state of a pll config needs to be updated multiple times (for every new link_clock calculation). This patch does that by letting the update happen as long as the crtc_mask stays same. Signed-off-by: Durgadoss R --- drivers/gpu/drm/i915/intel_dpll_mgr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c index cad10f2..f1ca753 100644 --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c @@ -235,13 +235,14 @@ intel_reference_shared_dpll(struct intel_shared_dpll *pll, { struct intel_shared_dpll_config *shared_dpll; struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc); + unsigned int crtc_mask = 1 << drm_crtc_index(&crtc->base); enum intel_dpll_id i = pll->id; shared_dpll = intel_atomic_get_shared_dpll_state(crtc_state->base.state); - if (shared_dpll[i].crtc_mask == 0) - shared_dpll[i].hw_state = - crtc_state->dpll_hw_state; + if (shared_dpll[i].crtc_mask == 0 || + shared_dpll[i].crtc_mask == crtc_mask) + shared_dpll[i].hw_state = crtc_state->dpll_hw_state; crtc_state->shared_dpll = pll; DRM_DEBUG_DRIVER("using %s for pipe %c\n", pll->name,