From patchwork Fri Jul 10 09:25:35 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: 11661569 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 13339913 for ; Tue, 14 Jul 2020 07:02:20 +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 E53E8221ED for ; Tue, 14 Jul 2020 07:02:19 +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="GpJ2AfDt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E53E8221ED 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 D55016E8DB; Tue, 14 Jul 2020 07:02:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2C546E082 for ; Fri, 10 Jul 2020 09:25:54 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id k6so5217986wrn.3 for ; Fri, 10 Jul 2020 02:25:54 -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=GpJ2AfDtbHXLCQycXNMvxZwPIi7rXnk/8jSaA9ZZnkKHlUMiNkJvw7EPslgFRbJWgw hav701awxzqvtwNTqjqpHpx8qrNmYkRyx0UvXWW6FY2+NL+rP1GtqwGgC//+uWeEog/+ QSjF/hd+QXKY7Db5KROhJVUhiAqQ2N0m6TLD+jQvrM/puMlAZk+WQHaP+IKDYTWljLfK 5dGWELhdr4++i6PRcD/7+tWe1YiVyXRwgZOY0nWpaGbwdPqdMq+WRy9aZtttYM7yq3OC W23+679XuTQ89ZWtmyWVI0ZQnT8Fgv0og07FCMN58p+CuVXGbv+Gk0WNPc4z7Vy5li+G B8ow== 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=kQVS2Klv7ad5UBosq5/Y7/+PxQOrw2tAM+WCff5OT5A3wPgcylA2qfOcQSn0o5xoh4 Tm3ZrlE46fUDwvG/tYWE94SpGiAcxFCMuLxqTf/vGet069AuXGbWaUXVBfTgVwnlOmQ0 NjaqHfyNYdkGDLDOPd/5E1P/toOUUd+1aSvubfwReR3qliku0pFIQRsU+tZGaVEi1oet 2F6ZeUKJ5lIpqamok0bTDhR8odJmIAPhZbYyRcUMZkbFLF3CSsF2YBCrAvKd5AIgNg0e ZdqW322y2b9ioMTzaVLiDaPKoOO14Yiqa8dBkJikYLU3i5IjU3k/zSdz/XKnYpak25l7 0xjg== X-Gm-Message-State: AOAM533OmE1ur6WX5WNOaHTbIUF+/JFUErMxxCxlf+5Hoo+k5/Az1pAd 6TNV+UlZew1/91hM+50P8no= X-Google-Smtp-Source: ABdhPJztkpwv2u/X8d+I0+14kZgyoIQ8x8qEsfOqO60cJPVWz5ZpmAG7Xk4kWn3hX2rMNDlm4waVTA== X-Received: by 2002:a05:6000:111:: with SMTP id o17mr71160399wrx.178.1594373153543; Fri, 10 Jul 2020 02:25:53 -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 h23sm8179559wmb.3.2020.07.10.02.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 02:25:52 -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 v4 01/14] drm/panfrost: avoid static declaration Date: Fri, 10 Jul 2020 11:25:35 +0200 Message-Id: <20200710092548.316054-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200710092548.316054-1-peron.clem@gmail.com> References: <20200710092548.316054-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);