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: 119718 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp401735qgn; Mon, 27 Nov 2017 07:13:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMaJVXTA5/1EZi0ebQhixjtVE8COTSTveuScHH7EBAbwtydc0jkrKKa/ZsgPgz/PAfUiAmMC X-Received: by 10.159.231.22 with SMTP id w22mr10019551plq.45.1511795599075; Mon, 27 Nov 2017 07:13:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511795599; cv=none; d=google.com; s=arc-20160816; b=KCnj6uioVgv797V1LWbMCPT4D+7iuItHPHd75L5q4xXVw1/Ha8H4Z+gsUN7SclHiU4 1dZKDk4ufJVYkbK3YZcXI8tYw4f6sbPh479/o5pO/6lyztvoRnFbA0y/4lZPVfRrk0xK VZnXLZCiQ271E9RKgZZDzYD0j/RWffs/0R5l0GZe410P5x9tYetz/NoVuREP6vkPjtRK T1GhoGxEDr84GQfprovNjo8ve6SdEY+j+gDVyMgqDhmhPjXBu4ZUp3RPUn++W3+6MF6h Jz6r0YEeYG0DI2ywntALg5ZWW1MacNsxNxk1YIJxbUdyWhPnRbSH0xtSRUS1yhdh9gv9 N6hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gHtFy4IGF2XaC4IfkgS7lw1nvbjroDNtCd/IN2Uhm90=; b=xkuSUsT2Ikba0LM2KyQkFnUr8u38NwZAJiCeitjmArpUyEMn6G5o3ZDoZLJkWFPgr4 PBM0yv1fAx25mMEci4eie/sgEvdH9PMVXX1aw0huAB3pYlhxHGsbxdENIJCzPLG95T12 k+XsTai+U22fLMuo9n81sTbpVm0+RggAvR9XMkwtWxQnkfhl8/+gkJDp1x/pwVsgtoE6 G99IxE2p7U7rhmPNFyByO3cL+VABYFcCLKdDICw3WG5cyFyTgSy2CFIV69fzR+YpvXnI YJLDh6w4d2fLuttg2P/50Iu8MjIClKhSfI1AFp0BM5O2JLjrHdLsLstMYNlByKy1ww13 AnFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si7803686pgd.708.2017.11.27.07.13.18; Mon, 27 Nov 2017 07:13:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752743AbdK0PNR (ORCPT + 28 others); Mon, 27 Nov 2017 10:13:17 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:55010 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbdK0PNP (ORCPT ); Mon, 27 Nov 2017 10:13:15 -0500 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 Cc: Arnd Bergmann , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , "Lee, Shawn C" , Maarten Lankhorst , Mika Kahola , Vidya Srinivas , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.9.0 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);