From patchwork Fri Feb 28 23:44:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3745331 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8AE159F35F for ; Fri, 28 Feb 2014 23:45:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B98062024D for ; Fri, 28 Feb 2014 23:45:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D9718201BA for ; Fri, 28 Feb 2014 23:45:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DFF7FBDEA; Fri, 28 Feb 2014 15:45:47 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f46.google.com (mail-yh0-f46.google.com [209.85.213.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C5F4FBDD8 for ; Fri, 28 Feb 2014 15:45:02 -0800 (PST) Received: by mail-yh0-f46.google.com with SMTP id v1so1527399yhn.33 for ; Fri, 28 Feb 2014 15:45:02 -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:in-reply-to:references; bh=JE5MLYxOV3mFafBubhQo3kG6JY+kNNV5MVr5V0A9yC0=; b=TEzzcwuI+yHzIb54CCWwkv/IvRNFybgb+B5NNowDNnz8TZoj2l4/6REtmCIq2tk4q4 kJrw0Ow/am6l8bJttozXYATeNBiwBTWQAiUeDCwKavJCVG7vRULegEF7c0Fi4PETBkEN PkQvS5XUiTZ4sjf+SVVtVMt1PFMoezIicLWaAA7DCCHfNcM/HNlUKDx6Hh8kH4VTVF+J BxVYyWwhXoYJ7rcetP+Mdv5/gD64V1njdMcwSrYIcPQVe1DcU8MTqPRAbWFsbalU9Ztp 9fTGXrajSocbrIWZUoECc0DWJ6g/gQDjoh+7St53pjgBriDtl4T+nsitQFgfy3kz4GUi eKeg== X-Received: by 10.236.125.168 with SMTP id z28mr5017575yhh.59.1393631102125; Fri, 28 Feb 2014 15:45:02 -0800 (PST) Received: from localhost.localdomain ([189.67.129.152]) by mx.google.com with ESMTPSA id h23sm10769779yhc.0.2014.02.28.15.45.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Feb 2014 15:45:01 -0800 (PST) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Fri, 28 Feb 2014 20:44:39 -0300 Message-Id: <1393631086-3880-5-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1393631086-3880-1-git-send-email-rodrigo.vivi@gmail.com> References: <1393631086-3880-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 04/11] drm/i915: Use HAS_PSR to avoid unecessary interactions. 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 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 --- 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 83b3c13..51be6e7 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1741,11 +1741,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"); @@ -1818,6 +1813,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); @@ -1845,6 +1845,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);