From patchwork Mon Feb 19 10:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10227371 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 E905F602B7 for ; Mon, 19 Feb 2018 10:14:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8EBB2894A for ; Mon, 19 Feb 2018 10:14:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD49E2898E; Mon, 19 Feb 2018 10:14:33 +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=ham 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 C8D1F2894A for ; Mon, 19 Feb 2018 10:14:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 100BB6E111; Mon, 19 Feb 2018 10:14:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8FB16E107; Mon, 19 Feb 2018 10:14:29 +0000 (UTC) Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0M9RBC-1euqG50Wi6-00Cfi4; Mon, 19 Feb 2018 11:14:19 +0100 From: Arnd Bergmann To: stable@vger.kernel.org Date: Mon, 19 Feb 2018 11:13:21 +0100 Message-Id: <20180219101343.2922561-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180219101343.2922561-1-arnd@arndb.de> References: <20180219101343.2922561-1-arnd@arndb.de> X-Provags-ID: V03:K0:syI17ig/669v7CKzy4JLez8SJzddAwYBFjG3JNgvz/oGUinw0Be jMduc6xQvGZcXf5FlO/Az9fuwDT0Z9pjz2hm+coBNStTvRmpHTLaf3WD6BuAVLp360ALxwS EwY6KsAqynyE38Y7GFHA4/+OxlQ9+LDLx8ownuXIcSSnJfUxyFPfjTjj5y3ckQmc9su3kQh lIUYFGIkMGVpW9+Aq1uPQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:XHnaQBslcDM=:bGKL52b3bWGd8VrG42bwGR BPodTtPPRufGNi8aVVZ9plBLLVfZNmjPdbUX57vD/JgF2kkLl6gWTA4to+ymI7U+phwKtUrid mRVCN6bMUXVtaxQHJGTSfaoa0QV5r8+gqo94uv989I2mhbQstXVHzsHKnX3oklXfbkMykTB5+ 7Lb7wMUW0D9XRO//UJGMkLSR9Eu7bUyWAw9TMDOj262DxmzF6poNAhHHdf4HlqsqC5BJOigKW 2/JXhO9EUCNuY9K2nPWGZ/4whsUKdUs3yuby/l6wyFFYRvk/HiWuZWuBugKeUpMCAGKXQzvaP oyAaYZtjDs8Cd+SZTeGGFFPqguEDVHHPYCqwlENjFGa9NEZ8mjq0j44CJXw5O7gj6LvfXShVg fvUgkOQmPfxEecA1yDxGfmJRgwZ5VMin5NzIeakd7Aq56JmFCrXZfkRIJ9XWtAGSYpOycJDfj 0R/RvFL8aSeNBZ7p76qzlAjEYYlTZk/yoGUhAxAkcyItCg25pHMTBZDV1I940+XxO+3lcoXVy sqObtMuHRPw1TGtJyVgTz2gLBZ1zbjdXwb1mtqSv4n1VKx8sz3yeLvgtSOeszIBmF28Qy0ZdJ uoEHicz95JKriYltgVueNobjHWceMpb49SKBgRNk6WxWqpZOqwxYor+ZQ2HxgP/g+6tVDCFit yBZgqLMVke9Un5JIQip56UnSv9UanVciBRTrwtEA/QFL5mlTm+X4xgN5A9eLQkQVH76aKvbFk AWN+WHKIETP1igsczYCU3Y+svOX2rQ9K1MnYag== Subject: [Intel-gfx] [4.9-stable 2/9] drm/i915: hide unused intel_panel_set_backlight function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , David Airlie , Greg KH , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Daniel Vetter MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream. 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 Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@arndb.de [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/i915/intel_panel.c | 86 +++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c index be4b4d546fd9..1cb1b01e4471 100644 --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -544,25 +544,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(struct intel_connector *connector, u32 level) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struct intel_connector *connector, u32 level) panel->backlight.set(connector, level); } -/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - 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(connector, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct intel_connector *connector) } #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(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + 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(connector, 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);