From patchwork Fri Jul 10 09:53:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 11661575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43EFE913 for ; Tue, 14 Jul 2020 07:02:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20518221ED for ; Tue, 14 Jul 2020 07:02:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="apjndRlz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20518221ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0830A6E8E6; Tue, 14 Jul 2020 07:02:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id E88FC6EBBD for ; Fri, 10 Jul 2020 09:54:14 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id q15so5471302wmj.2 for ; Fri, 10 Jul 2020 02:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WimOihJEoGFrQflh5MG/QpMyDue9zSaiyBZVUVInhdA=; b=apjndRlzBADzjx/tKuL/n6DCF1QhTME/JWIr6K5Qr5g2IRZGeLMo/t/MyBZdlS4Wv7 k5bf8mqevDciEgy3gqH2+aIkTYToN0Zy1EZxDhoBehAtKeI+1tgSgDLhN7+/ne4RbQMk nxMUmPsxsj19A86Y1Jx+mlVe3Gs5ZYfyYGWBMdubz+qz+moVhkUKvftySUIQHimrukhE +aVrPiZYuvS5yHfxTERpS4FDfJUCshHX1JhRkOxz5K9hfiAbzgZpu6uNa3rSJHVUC9jU js5CnMsPWyGmIwH7i7TB16ow/aTQ6jsyl6DplG+JVru9fzexAymN2Hv0CciWGaQx/q70 UooA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WimOihJEoGFrQflh5MG/QpMyDue9zSaiyBZVUVInhdA=; b=YKxSEn1wF5F5b/odPICmhG0dLfnYY71iO1jt8oeBPhkqWHEsFuzGOxHCdyHApN3cJL 15ubDWNirWk+hfPZQso5kh9RxXx36ho6QsfiKCIG/dDZbflk328yzfKev679Mqvl+IXU XaOb5gEY5XE6hYsze/3Q/Jd2SeOMx/6pMHsbBSi7wiXad9viFC+2WPcFHxgrpAODQRgM mdWatDQ2JW1N7c8epmjM+6lslM8m2a9+OHc30Y4jn1jYls5YovdF8pXFJ/nmSkGhH8g0 zY92aGdDrO+DG5KaHt7YqVcGBEZMLsnbnVeAXocOJm/IWBTPz63+OPqbJTlEEEvxwFUu nVFw== X-Gm-Message-State: AOAM530uQFV5ZubMEBBr7AGVvjBJ9KNTmU/5uYUyPFJnl7QIWugZs/Ho U+hM/Ic7B8UOAJO5DcPP6us= X-Google-Smtp-Source: ABdhPJxxIn8oYAxTV1peSwC8T66wTnW21RfMcb22cRnGtDFyLhEPQ7Ua941ytDhox3rI2N/NIlkm0A== X-Received: by 2002:a1c:48:: with SMTP id 69mr4576752wma.32.1594374853553; Fri, 10 Jul 2020 02:54:13 -0700 (PDT) Received: from clement-Latitude-7490.numericable.fr (213-245-241-245.rev.numericable.fr. [213.245.241.245]) by smtp.gmail.com with ESMTPSA id u23sm10176092wru.94.2020.07.10.02.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 02:54:12 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Viresh Kumar , Nishanth Menon , Stephen Boyd , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v5 01/14] drm/panfrost: avoid static declaration Date: Fri, 10 Jul 2020 11:53:56 +0200 Message-Id: <20200710095409.407087-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710095409.407087-1-peron.clem@gmail.com> References: <20200710095409.407087-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 14 Jul 2020 07:02:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This declaration can be avoided so change it. Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig Signed-off-by: Clément Péron --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 38 ++++++++++----------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 413987038fbf..1b560b903ea6 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -14,7 +14,24 @@ #include "panfrost_gpu.h" #include "panfrost_regs.h" -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev); +static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) +{ + ktime_t now; + ktime_t last; + + if (!pfdev->devfreq.devfreq) + return; + + now = ktime_get(); + last = pfdev->devfreq.time_last_update; + + if (atomic_read(&pfdev->devfreq.busy_count) > 0) + pfdev->devfreq.busy_time += ktime_sub(now, last); + else + pfdev->devfreq.idle_time += ktime_sub(now, last); + + pfdev->devfreq.time_last_update = now; +} static int panfrost_devfreq_target(struct device *dev, unsigned long *freq, u32 flags) @@ -139,25 +156,6 @@ void panfrost_devfreq_suspend(struct panfrost_device *pfdev) devfreq_suspend_device(pfdev->devfreq.devfreq); } -static void panfrost_devfreq_update_utilization(struct panfrost_device *pfdev) -{ - ktime_t now; - ktime_t last; - - if (!pfdev->devfreq.devfreq) - return; - - now = ktime_get(); - last = pfdev->devfreq.time_last_update; - - if (atomic_read(&pfdev->devfreq.busy_count) > 0) - pfdev->devfreq.busy_time += ktime_sub(now, last); - else - pfdev->devfreq.idle_time += ktime_sub(now, last); - - pfdev->devfreq.time_last_update = now; -} - void panfrost_devfreq_record_busy(struct panfrost_device *pfdev) { panfrost_devfreq_update_utilization(pfdev);