Skip to content

Commit f1430f1

Browse files
icklerodrigovivi
authored andcommitted
drm/i915: Kick the rps worker when changing the boost frequency
The boost frequency is only applied from the RPS worker while someone is waiting on a request and requested a boost. As such, when the user wishes to change the frequency, we have to kick the worker in order to re-evaluate whether to apply the boost frequency. v2: Check num_waiters to decide if we should kick the worker to handle boosting. Fixes: 29ecd78 ("drm/i915: Define a separate variable and control for RPS waitboost frequency") Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 59cd31f) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 82813ba commit f1430f1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/gpu/drm/i915/i915_sysfs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
304304
{
305305
struct drm_i915_private *dev_priv = kdev_minor_to_i915(kdev);
306306
struct intel_rps *rps = &dev_priv->gt_pm.rps;
307-
u32 val;
307+
bool boost = false;
308308
ssize_t ret;
309+
u32 val;
309310

310311
ret = kstrtou32(buf, 0, &val);
311312
if (ret)
@@ -317,8 +318,13 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
317318
return -EINVAL;
318319

319320
mutex_lock(&dev_priv->pcu_lock);
320-
rps->boost_freq = val;
321+
if (val != rps->boost_freq) {
322+
rps->boost_freq = val;
323+
boost = atomic_read(&rps->num_waiters);
324+
}
321325
mutex_unlock(&dev_priv->pcu_lock);
326+
if (boost)
327+
schedule_work(&rps->work);
322328

323329
return count;
324330
}

0 commit comments

Comments
 (0)