From patchwork Mon Nov 27 15:10:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10077005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EDE4E6028E for ; Mon, 27 Nov 2017 15:13:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE6B28F13 for ; Mon, 27 Nov 2017 15:13:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D475828F1C; Mon, 27 Nov 2017 15:13:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8B1E928F10 for ; Mon, 27 Nov 2017 15:13:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A2E36E2F7; Mon, 27 Nov 2017 15:13:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 687E26E2F2; Mon, 27 Nov 2017 15:13:13 +0000 (UTC) Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M9Gfu-1ePLcn45kM-00Cjn2; Mon, 27 Nov 2017 16:13:04 +0100 From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie Subject: [PATCH 2/2] drm/i915: hide unused intel_panel_set_backlight function Date: Mon, 27 Nov 2017 16:10:28 +0100 Message-Id: <20171127151239.1813673-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171127151239.1813673-1-arnd@arndb.de> References: <20171127151239.1813673-1-arnd@arndb.de> X-Provags-ID: V03:K0:pRFKnrAZz94U2cXf4uM0lQwa/JPyC+flRBmuG2FjhEcT4mE1hh5 cZd1EzLfOtu/VRv1orDK45VQSkh7x5XlwDisoZoHqNEkzvp6iaaDsLAsacv3rDjdJOIcLSF fnOKc1MZRlyX1V15mwELaEujllD8iei51W1Spu4rCa7LVBZ7cduYzVtdIXZuvBhZqKmYsv1 01ZA4HtA4Qhf6LCObqQjg== X-UI-Out-Filterresults: notjunk:1; V01:K0:52HZ2BY2YM8=:R8GCWpcpDH4G24asRPKWNF cncQNhpHDQBS1PNItgwP9ic8Aq81pqVnOfiXlRmo7HbLATRzXJwe3kEkuCfYSx7NLQ93AcLJa f/bkuHYLxryn72ieFWud3EcYl/QWuuIwRbQ5A4koxk7b8VOPbPyG18nciZ2eqWn08EVZyiefB nUnCkYOi+yyudykWPKqJb9wfHzHqxY4WlZDyMdXQH6VZG0jIw6In5jK9mVdmxGTQFLr8BTDax /fdpg0bY9BgHwVIfb1KJh3m55BEFpVoQsQyTTSGzlPg7JhxFcfrREDsj97q9ZYZvL3x/10R2K 7HF0wp5ZKGxFCAcE4nao/0ZxGZMOtMCQsLBbMwq37eU1Ipk8EH4xcVVykFxrJqrG2Gu0ZQELy AqgXIgmamCqrLE5u9yWr+rbE6n6OA94kmGX5ssJy+t13JWZt+ZM+kR/z1BKlXKsxAHQou+udF v+KMw7hhw2ydSwZpZ2dcGyKjbxpVIEAKQv10P2ZFs/qij9UG+42F2z1fKH5+iCIZiJ5Ri4jgz b+LP3yP768ZZPIdtPuidvK3STh+6kMl5JZ8slOey9D10AqiTx4126RxCN6SsPrus0WOkq/u+G vmq/HnlTkB1Bze+/Nc9mXpMA2QtENXcUR51JugwaRHekdig/EPFvRol9Yb4ZCc2GzjqTO5KGj oquhbzc3ZvtoJbj2Pr0DCYfOffW+zWOTvX7xeuVWZEZeURNvgy5z+PKQxX8A/38FQ8p4TfMlb QS6VHvMGOAgi0lQblAQi5MNKT93jW0xb+TUpag== Cc: Vidya Srinivas , Arnd Bergmann , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Mika Kahola , "Lee, Shawn C" 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-Virus-Scanned: ClamAV using ClamSMTP Building i915 without backlight support results in a harmless warning for intel_panel_set_backlight: drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function] This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that its caller is in. Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/i915/intel_panel.c | 88 +++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index adc51e452e3e..fa6831f8c004 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -543,25 +543,6 @@ static u32 pwm_get_backlight(struct intel_connector *connector) return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); } -static u32 intel_panel_get_backlight(struct intel_connector *connector) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 val = 0; - - mutex_lock(&dev_priv->backlight_lock); - - if (panel->backlight.enabled) { - val = panel->backlight.get(connector); - val = intel_panel_compute_brightness(connector, val); - } - - mutex_unlock(&dev_priv->backlight_lock); - - DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); - return val; -} - static void lpt_set_backlight(const struct drm_connector_state *conn_state, u32 level) { struct intel_connector *connector = to_intel_connector(conn_state->connector); @@ -649,31 +630,6 @@ intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, panel->backlight.set(conn_state, level); } -/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(const struct drm_connector_state *conn_state, - u32 user_level, u32 user_max) -{ - struct intel_connector *connector = to_intel_connector(conn_state->connector); - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 hw_level; - - if (!panel->backlight.present) - return; - - mutex_lock(&dev_priv->backlight_lock); - - WARN_ON(panel->backlight.max == 0); - - hw_level = scale_user_to_hw(connector, user_level, user_max); - panel->backlight.level = hw_level; - - if (panel->backlight.enabled) - intel_panel_actually_set_backlight(conn_state, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1182,6 +1138,50 @@ void intel_panel_enable_backlight(const struct intel_crtc_state *crtc_state, } #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +static u32 intel_panel_get_backlight(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 val = 0; + + mutex_lock(&dev_priv->backlight_lock); + + if (panel->backlight.enabled) { + val = panel->backlight.get(connector); + val = intel_panel_compute_brightness(connector, val); + } + + mutex_unlock(&dev_priv->backlight_lock); + + DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); + return val; +} + +/* set backlight brightness to level in range [0..max], scaling wrt hw min */ +static void intel_panel_set_backlight(const struct drm_connector_state *conn_state, + u32 user_level, u32 user_max) +{ + struct intel_connector *connector = to_intel_connector(conn_state->connector); + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 hw_level; + + if (!panel->backlight.present) + return; + + mutex_lock(&dev_priv->backlight_lock); + + WARN_ON(panel->backlight.max == 0); + + hw_level = scale_user_to_hw(connector, user_level, user_max); + panel->backlight.level = hw_level; + + if (panel->backlight.enabled) + intel_panel_actually_set_backlight(conn_state, hw_level); + + mutex_unlock(&dev_priv->backlight_lock); +} + static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd);