Skip to content

Commit

Permalink
drm/panfrost: avoid static declaration
Browse files Browse the repository at this point in the history
This declaration can be avoided so change it.

Reviewed-by: Steven Price <[email protected]>
Reviewed-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: Clément Péron <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
clementperon authored and robherring committed Aug 7, 2020
1 parent 72ef7fe commit 862cc62
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions drivers/gpu/drm/panfrost/panfrost_devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 862cc62

Please sign in to comment.