From patchwork Tue Sep 16 23:19:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 4921621 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 802DDBEEA5 for ; Tue, 16 Sep 2014 23:19:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8A622015A for ; Tue, 16 Sep 2014 23:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 88AC520142 for ; Tue, 16 Sep 2014 23:19:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07BF66E26A; Tue, 16 Sep 2014 16:19:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F4506E2E7 for ; Tue, 16 Sep 2014 16:19:15 -0700 (PDT) Received: by mail-pd0-f174.google.com with SMTP id v10so765576pde.33 for ; Tue, 16 Sep 2014 16:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=n6tEg4yVxbVPWQBxEAUX2sseX1g/31Yw460y5SSdeBc=; b=RV9Bm964Ma8aMlOHyJlhdhnpqx9Q2qikc6NMc1nd+ZLvD8CBMWJXWrwwjyiuVwozy0 dB4jQPYMtdlw2D0LClSjC8MdZ/VzPbMeb/+So7xdiOGsYaWevqneI7jLwzot5Bf7ONF6 QHJTBnk+Qu6RTjUueTP4dMmLSsbmbDocpjLXAZmXwbNRhO9GYfqK6TgG16FX/X81wg7B BxqGpy1CePIXeCNJQp41Srpi9IQmhef6fZfilSTgZgpG22SNDk87Opnn3quczI4z96tT kONuUa7GsKdFWiab/fJm0h54Nxna8Xz3PFp+isyrDVPAIgshheTIasXmuXPAr6BGgeds 3eFA== X-Received: by 10.68.131.38 with SMTP id oj6mr61098pbb.168.1410909555521; Tue, 16 Sep 2014 16:19:15 -0700 (PDT) Received: from rdvivi-bratislava.home (static-50-43-14-60.bvtn.or.frontiernet.net. [50.43.14.60]) by mx.google.com with ESMTPSA id v1sm15068998pdp.76.2014.09.16.16.19.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 16:19:14 -0700 (PDT) From: Rodrigo Vivi X-Google-Original-From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Tue, 16 Sep 2014 19:19:06 -0400 Message-Id: <1410909548-4945-2-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410909548-4945-1-git-send-email-rodrigo.vivi@intel.com> References: <1410909548-4945-1-git-send-email-rodrigo.vivi@intel.com> Cc: Rodrigo Vivi Subject: [Intel-gfx] [PATCH 2/4] drm/i915: PSR: Organize PSR enable function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.7 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 We don't need to setup everything else if it doesn't match all conditions. Signed-off-by: Rodrigo Vivi Reviewed-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_dp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 271788e..168b3c3 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1912,10 +1912,12 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp) mutex_lock(&dev_priv->psr.lock); if (dev_priv->psr.enabled) { DRM_DEBUG_KMS("PSR already in use\n"); - mutex_unlock(&dev_priv->psr.lock); - return; + goto unlock; } + if (!intel_edp_psr_match_conditions(intel_dp)) + goto unlock; + dev_priv->psr.busy_frontbuffer_bits = 0; intel_edp_psr_setup_vsc(intel_dp); @@ -1924,8 +1926,8 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp) I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP | EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP); - if (intel_edp_psr_match_conditions(intel_dp)) - dev_priv->psr.enabled = intel_dp; + dev_priv->psr.enabled = intel_dp; +unlock: mutex_unlock(&dev_priv->psr.lock); }