From patchwork Sat Jul 4 10:25:22 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: 11645015 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 4B12B912 for ; Mon, 6 Jul 2020 07:19:35 +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 2923E2070C for ; Mon, 6 Jul 2020 07:19:35 +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="LLw6z/lP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2923E2070C 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 2B9C26E25A; Mon, 6 Jul 2020 07:19:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id EC8D889711 for ; Sat, 4 Jul 2020 10:25:44 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id a6so35320854wrm.4 for ; Sat, 04 Jul 2020 03:25:44 -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=3PPcg5UlBRq0w4LR6ro2v8Q7Hq7d6jVFUN9WJytznf0=; b=LLw6z/lPBPk9eRudhoD2GhCQN2yf6/vRH7B9bzbbvt2rZyBFg8i4afsacJl2VCxxyc MU0WnqLFBci4J72OOA4qlyc0wdPBMIWoIZ9ReADOe4aljTU0XwPrvP8EC8hqKHZCDzgU C2K/kDDkHUVzv91aW+wkI2ttYeiEox+KJyE1GtTxCjFXZI8K4FhT0hgP1X5aSi/YapAq 2uwI6rtvxeqQT0mXOj0Nqc1+Igpxur2KwJVPbvxg1ATtPzz2yWaM1M9kTm+CoP9c9f6n m92vefWCiZ4APg7m/P4884EKsdpJoSfnZ5EAY9SQyjyovpc0FR3mol9XeEm2PfAhyxs/ cbyg== 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=3PPcg5UlBRq0w4LR6ro2v8Q7Hq7d6jVFUN9WJytznf0=; b=FUMchqA2wSqC7ET3gCuI1F3cKbpZebZ6Gd/htgVj+3UD6CwqwwLhK7/uFyogaGSXcM MiL/XBDhkyfO+ZkEHbqtFrUw3Ntj5Ffketf+xXAUGfdfiAiWZAKBB4GsDjdml0QTPxGL pgv8DNe3gCkrvbWGeOYUd0rF1Bd6mHVJIHI0MUNHijLOn9nfuDc7HKox0/LmZPjX5RvC E4LGHCgQv1nDCnMmMMWstSK8Wmz9EdjhC4uKt3PCMAvGs2SiVi9sAasLxRh/hwkJHc8H pU85fpkjBbLI7kN7qBAZ/B3mokJeNmBen23mGdiriP2Q+Bx97tfBP5Rqlyy7chb2wvIy sUhQ== X-Gm-Message-State: AOAM530Vl/lVb2d5BllxHioyvdf7uHTco5/oKawHQVmD1H9CBzYbCRwC 88qG8UjsttVAsM1pltjPE3M= X-Google-Smtp-Source: ABdhPJwgyjK4HfdOdlAHjlrwJp3kauA7Q5SEnSmInR4v0bMUWpQskG8gyIQp4x8u4GgxMvdShnulTQ== X-Received: by 2002:a5d:4a45:: with SMTP id v5mr40632842wrs.228.1593858343437; Sat, 04 Jul 2020 03:25:43 -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 g14sm16421428wrm.93.2020.07.04.03.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 03:25:42 -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 v2 01/14] drm/panfrost: avoid static declaration Date: Sat, 4 Jul 2020 12:25:22 +0200 Message-Id: <20200704102535.189647-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200704102535.189647-1-peron.clem@gmail.com> References: <20200704102535.189647-1-peron.clem@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 06 Jul 2020 07:19:17 +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. Signed-off-by: Clément Péron Reviewed-by: Steven Price --- 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);