From patchwork Fri May 16 00:13:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 4186491 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 90496BFF02 for ; Fri, 16 May 2014 00:13:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CE52B20397 for ; Fri, 16 May 2014 00:13:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0937F20395 for ; Fri, 16 May 2014 00:13:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8AF136EF3A; Thu, 15 May 2014 17:13:24 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 2D7CA6EF3B for ; Thu, 15 May 2014 17:13:23 -0700 (PDT) Received: by mail-pa0-f42.google.com with SMTP id rd3so1749091pab.1 for ; Thu, 15 May 2014 17:13:23 -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=bh8b6KTr3PmkhN4PigTdkXWAjJj7U5ejIa6ziIuszLM=; b=XOcBuZ5vXOftMXbAUrRXFEqSMZ2IILka0JUyUs0kSLKMk033CFjUjy3GsGmFE9hGeZ 5fSltVA1yLnRn3qlyXAKMdemmcWVjE8xwPhnF8RnxXm/xJ13Qw7dslw0xEqXWII2WP9E 2flZ4WX3EMprFH7UynLFJJWEtOwlFWeqeT2TxCQj5pGiQVXjpj+Xx8SeuhzpO0pwzS1p IgCa/gMSw+WXjSU5tcwv3nYmvGL+hcCM/aC9PDba/cJLqikilSFdi8e/Ovuk0bogONoK 08CnqxFN7a+nDeYAs3Wfl+z5LyrYo4/6t8ylnrlsFzG2/GeV4+JoClEBpNBVEEKiw9aG zC+w== X-Received: by 10.66.193.104 with SMTP id hn8mr16193826pac.99.1400199203050; Thu, 15 May 2014 17:13:23 -0700 (PDT) Received: from localhost (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by mx.google.com with ESMTPSA id yn4sm11169255pbb.95.2014.05.15.17.13.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 May 2014 17:13:21 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Thu, 15 May 2014 20:13:02 -0400 Message-Id: <1400199190-2424-4-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1400199190-2424-1-git-send-email-rodrigo.vivi@gmail.com> References: <1400199190-2424-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 03/11] drm/i915: Use HAS_PSR to avoid unecessary interactions. 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 Let's be more conservative and protect platforms that don't support PSR from unecessary interactions. Signed-off-by: Rodrigo Vivi Reviewed-by: Vijay Purushothaman --- drivers/gpu/drm/i915/intel_dp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 34e8f7a..58537b7 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1739,11 +1739,6 @@ static bool intel_edp_psr_match_conditions(struct intel_dp *intel_dp) dev_priv->psr.source_ok = false; - if (!HAS_PSR(dev)) { - DRM_DEBUG_KMS("PSR not supported on this platform\n"); - return false; - } - if ((intel_encoder->type != INTEL_OUTPUT_EDP) || (dig_port->port != PORT_A)) { DRM_DEBUG_KMS("HSW ties PSR to DDI A (eDP)\n"); @@ -1816,6 +1811,11 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp) { struct drm_device *dev = intel_dp_to_dev(intel_dp); + if (!HAS_PSR(dev)) { + DRM_DEBUG_KMS("PSR not supported on this platform\n"); + return; + } + if (intel_edp_psr_match_conditions(intel_dp) && !intel_edp_is_psr_enabled(dev)) intel_edp_psr_do_enable(intel_dp); @@ -1843,6 +1843,9 @@ void intel_edp_psr_update(struct drm_device *dev) struct intel_encoder *encoder; struct intel_dp *intel_dp = NULL; + if (!HAS_PSR(dev)) + return; + list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) if (encoder->type == INTEL_OUTPUT_EDP) { intel_dp = enc_to_intel_dp(&encoder->base);