diff mbox series

[CI,5/5] drm/i915/gt: Only kick the scheduler on timeslice/preemption change

Message ID 20210206012019.27451-5-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series [CI,1/5] drm/i915: Wrap access to intel_engine.active | expand

Commit Message

Chris Wilson Feb. 6, 2021, 1:20 a.m. UTC
Kick the scheduler to allow it to see the timeslice duration change,
don't peek into execlists.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gt/sysfs_engines.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/sysfs_engines.c b/drivers/gpu/drm/i915/gt/sysfs_engines.c
index 57ef5383dd4e..70506f43d6be 100644
--- a/drivers/gpu/drm/i915/gt/sysfs_engines.c
+++ b/drivers/gpu/drm/i915/gt/sysfs_engines.c
@@ -222,9 +222,7 @@  timeslice_store(struct kobject *kobj, struct kobj_attribute *attr,
 		return -EINVAL;
 
 	WRITE_ONCE(engine->props.timeslice_duration_ms, duration);
-
-	if (execlists_active(&engine->execlists))
-		set_timer_ms(&engine->execlists.timer, duration);
+	intel_engine_kick_scheduler(engine);
 
 	return count;
 }
@@ -326,9 +324,7 @@  preempt_timeout_store(struct kobject *kobj, struct kobj_attribute *attr,
 		return -EINVAL;
 
 	WRITE_ONCE(engine->props.preempt_timeout_ms, timeout);
-
-	if (READ_ONCE(engine->execlists.pending[0]))
-		set_timer_ms(&engine->execlists.preempt, timeout);
+	intel_engine_kick_scheduler(engine);
 
 	return count;
 }