From patchwork Sun Dec 7 21:36:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5453541 Return-Path: X-Original-To: patchwork-dri-devel@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 CC2DFBEEA8 for ; Mon, 8 Dec 2014 00:50:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2D0A20121 for ; Mon, 8 Dec 2014 00:50:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C0BE320145 for ; Mon, 8 Dec 2014 00:50:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5ED176E411; Sun, 7 Dec 2014 16:50:02 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by gabe.freedesktop.org (Postfix) with ESMTP id 0792A6E3A9 for ; Sun, 7 Dec 2014 13:33:31 -0800 (PST) Received: by mail-wi0-f169.google.com with SMTP id r20so5623245wiv.0 for ; Sun, 07 Dec 2014 13:33:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m5bX7feU+hj2AJH99D9hYlYE+0jQoAb2+tEprEkuQuc=; b=EySgJFGERLitA/hcq2MVei/4X4zwHev0GsrSKTXNhK7+CwblH0wgp+XHxAz23w6jiR Uhri76+nhvwIyjb4NEHLf8uP24U7TOGZDiV5V1Ns/X8ik5quYPj98QBktAFU2D3hTT5+ iIi8wrNzk1Vx1mZB3Ctbpo7hRu+2LpM66B67nBR2LyEx/u4pH8WIzO/1FPMgIIfcG4gJ Q1ytbREMvPMM0aB+5nrJ3LFQ1I6EtkFOAH8wBWyOaYcN+A9M/N5WPAccuTyeMmFvS9os gxgpGrMLDpgxeFcczJ0LmEeKh4t1VkaBC+zL6C5f/10J1B8HNODM064HnrQ6N82VNY1G XYvw== X-Gm-Message-State: ALoCoQlPKJCWXowqT9AeTkRcjMvBW0bDepDBmQ4N5GdLZxu/idvBOhnYPagwAmHAq6pFbqQnb50M X-Received: by 10.180.107.136 with SMTP id hc8mr19675132wib.32.1417988010625; Sun, 07 Dec 2014 13:33:30 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id wa5sm28329597wjc.8.2014.12.07.13.33.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Dec 2014 13:33:29 -0800 (PST) From: Rickard Strandqvist To: Daniel Vetter , Jani Nikula Subject: [PATCH] gpu: drm: i915: intel_dp.c: Remove unused function Date: Sun, 7 Dec 2014 22:36:10 +0100 Message-Id: <1417988170-17451-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 X-Mailman-Approved-At: Sun, 07 Dec 2014 16:50:00 -0800 Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rickard Strandqvist X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Remove the function intel_dp_set_drrs_state() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/gpu/drm/i915/intel_dp.c | 89 -------------------------------------- drivers/gpu/drm/i915/intel_drv.h | 1 - 2 files changed, 90 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 5ad45bf..6df948b 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4810,95 +4810,6 @@ intel_dp_init_panel_power_sequencer_registers(struct drm_device *dev, I915_READ(pp_div_reg)); } -void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate) -{ - struct drm_i915_private *dev_priv = dev->dev_private; - struct intel_encoder *encoder; - struct intel_dp *intel_dp = NULL; - struct intel_crtc_config *config = NULL; - struct intel_crtc *intel_crtc = NULL; - struct intel_connector *intel_connector = dev_priv->drrs.connector; - u32 reg, val; - enum edp_drrs_refresh_rate_type index = DRRS_HIGH_RR; - - if (refresh_rate <= 0) { - DRM_DEBUG_KMS("Refresh rate should be positive non-zero.\n"); - return; - } - - if (intel_connector == NULL) { - DRM_DEBUG_KMS("DRRS supported for eDP only.\n"); - return; - } - - /* - * FIXME: This needs proper synchronization with psr state. But really - * hard to tell without seeing the user of this function of this code. - * Check locking and ordering once that lands. - */ - if (INTEL_INFO(dev)->gen < 8 && intel_edp_is_psr_enabled(dev)) { - DRM_DEBUG_KMS("DRRS is disabled as PSR is enabled\n"); - return; - } - - encoder = intel_attached_encoder(&intel_connector->base); - intel_dp = enc_to_intel_dp(&encoder->base); - intel_crtc = encoder->new_crtc; - - if (!intel_crtc) { - DRM_DEBUG_KMS("DRRS: intel_crtc not initialized\n"); - return; - } - - config = &intel_crtc->config; - - if (intel_dp->drrs_state.type < SEAMLESS_DRRS_SUPPORT) { - DRM_DEBUG_KMS("Only Seamless DRRS supported.\n"); - return; - } - - if (intel_connector->panel.downclock_mode->vrefresh == refresh_rate) - index = DRRS_LOW_RR; - - if (index == intel_dp->drrs_state.refresh_rate_type) { - DRM_DEBUG_KMS( - "DRRS requested for previously set RR...ignoring\n"); - return; - } - - if (!intel_crtc->active) { - DRM_DEBUG_KMS("eDP encoder disabled. CRTC not Active\n"); - return; - } - - if (INTEL_INFO(dev)->gen > 6 && INTEL_INFO(dev)->gen < 8) { - reg = PIPECONF(intel_crtc->config.cpu_transcoder); - val = I915_READ(reg); - if (index > DRRS_HIGH_RR) { - val |= PIPECONF_EDP_RR_MODE_SWITCH; - intel_dp_set_m_n(intel_crtc); - } else { - val &= ~PIPECONF_EDP_RR_MODE_SWITCH; - } - I915_WRITE(reg, val); - } - - /* - * mutex taken to ensure that there is no race between differnt - * drrs calls trying to update refresh rate. This scenario may occur - * in future when idleness detection based DRRS in kernel and - * possible calls from user space to set differnt RR are made. - */ - - mutex_lock(&intel_dp->drrs_state.mutex); - - intel_dp->drrs_state.refresh_rate_type = index; - - mutex_unlock(&intel_dp->drrs_state.mutex); - - DRM_DEBUG_KMS("eDP Refresh Rate set to : %dHz\n", refresh_rate); -} - static struct drm_display_mode * intel_dp_drrs_init(struct intel_digital_port *intel_dig_port, struct intel_connector *intel_connector, diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index ba71522..6ad239d 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -941,7 +941,6 @@ void intel_edp_panel_on(struct intel_dp *intel_dp); void intel_edp_panel_off(struct intel_dp *intel_dp); void intel_edp_psr_enable(struct intel_dp *intel_dp); void intel_edp_psr_disable(struct intel_dp *intel_dp); -void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate); void intel_edp_psr_invalidate(struct drm_device *dev, unsigned frontbuffer_bits); void intel_edp_psr_flush(struct drm_device *dev,