From patchwork Wed Jan 8 13:12:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3453601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D96F8C02DC for ; Wed, 8 Jan 2014 13:13:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D640620144 for ; Wed, 8 Jan 2014 13:13:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4477220131 for ; Wed, 8 Jan 2014 13:13:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1498FA6FE for ; Wed, 8 Jan 2014 05:13:15 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com [209.85.216.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D015FAB0C for ; Wed, 8 Jan 2014 05:12:51 -0800 (PST) Received: by mail-qa0-f46.google.com with SMTP id j5so1693177qaq.19 for ; Wed, 08 Jan 2014 05:12:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gCLlmooMQo1qBOZQ5j3YC+UD1I5CzAsNIWpcg4JvN1E=; b=HIOAEVeHMRDjQNJKWmtrvooU2IPIFdOITOgpaRNeMpD4X5TiGELbSeJM3El/7gTqix oDiLHSVBdpUAcc0kcE/qKGSfxseaB16jCBm0vmbhsDcN8cf+Qh6E5XVvUbeumolSwKQz hagIpZYXvWQ15fvsbbziboisgLaxBC0j1Ebvz3+et+XEpMW2Z7jwOLYeT3splhtZac/X aOC+1XzbjtqwhA+BW7DvBzMiVDoUERmuHEb11/uGFLyb6djuXOifibaWYvXEKTcIvUUX NWo+b9cKBHL2uXE/7dJG1KFWjQbGLxWciIP5fVsFynND3Bf+ATWjOTSefWhW2iVvzHt/ mMmw== X-Received: by 10.49.101.9 with SMTP id fc9mr211960764qeb.42.1389186771193; Wed, 08 Jan 2014 05:12:51 -0800 (PST) Received: from localhost.localdomain ([177.16.32.203]) by mx.google.com with ESMTPSA id nk1sm1038988qeb.8.2014.01.08.05.12.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Jan 2014 05:12:50 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Jan 2014 11:12:27 -0200 Message-Id: <1389186748-1954-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.4.2 Cc: Paulo Zanoni , stable@vger.kernel.org Subject: [Intel-gfx] [PATCH 1/2] drm/i915: fix DDI PLLs HW state readout code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Paulo Zanoni Properly zero the refcounts and crtc->ddi_pll_set so the previous HW state doesn't affect the result of reading the current HW state. This fixes WARNs about WRPLL refcount if we have an HDMI monitor on HSW and then suspend/resume. Cc: stable@vger.kernel.org Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64379 Tested-by: Qingshuai Tian Signed-off-by: Paulo Zanoni Reviewed-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_ddi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c index 4ec1665..0def5ef 100644 --- a/drivers/gpu/drm/i915/intel_ddi.c +++ b/drivers/gpu/drm/i915/intel_ddi.c @@ -1136,12 +1136,18 @@ void intel_ddi_setup_hw_pll_state(struct drm_device *dev) enum pipe pipe; struct intel_crtc *intel_crtc; + dev_priv->ddi_plls.spll_refcount = 0; + dev_priv->ddi_plls.wrpll1_refcount = 0; + dev_priv->ddi_plls.wrpll2_refcount = 0; + for_each_pipe(pipe) { intel_crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); - if (!intel_crtc->active) + if (!intel_crtc->active) { + intel_crtc->ddi_pll_sel = PORT_CLK_SEL_NONE; continue; + } intel_crtc->ddi_pll_sel = intel_ddi_get_crtc_pll(dev_priv, pipe);