[Intel-gfx] [PATCH 9/9] drm/i915/execlists: Report GPU rendering as IO activity to cpufreq.

Francisco Jerez currojerez at riseup.net
Wed Mar 28 06:38:45 UTC 2018


This allows cpufreq governors to realize when the system becomes
non-CPU-bound due to GPU rendering activity, which will cause the
intel_pstate LP controller to behave more conservatively: CPU energy
usage will be reduced when there isn't a good chance for system
performance to scale with CPU frequency.  This leaves additional TDP
budget available for the GPU to reach higher frequencies, which is
translated into an improvement in graphics performance to the extent
that the workload remains TDP-limited (Most non-trivial graphics
benchmarks out there improve significantly in TDP-constrained
platforms, see the cover letter for some numbers).  If the workload
isn't (anymore) TDP-limited performance should stay roughly constant,
but energy usage will be divided by a similar factor.

The intel_pstate LP controller is only enabled on BXT+ small-core
platforms at this point, so this shouldn't have any effect on other
systems.

Signed-off-by: Francisco Jerez <currojerez at riseup.net>
---
 drivers/gpu/drm/i915/intel_lrc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 3a69b367e565..721f915115bd 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -132,6 +132,7 @@
  *
  */
 #include <linux/interrupt.h>
+#include <linux/cpufreq.h>
 
 #include <drm/drmP.h>
 #include <drm/i915_drm.h>
@@ -379,11 +380,13 @@ execlists_context_schedule_in(struct i915_request *rq)
 {
 	execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_IN);
 	intel_engine_context_in(rq->engine);
+	cpufreq_io_active_begin();
 }
 
 static inline void
 execlists_context_schedule_out(struct i915_request *rq)
 {
+	cpufreq_io_active_end();
 	intel_engine_context_out(rq->engine);
 	execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_OUT);
 }
@@ -726,6 +729,7 @@ execlists_cancel_port_requests(struct intel_engine_execlists * const execlists)
 		struct i915_request *rq = port_request(port);
 
 		GEM_BUG_ON(!execlists->active);
+		cpufreq_io_active_end();
 		intel_engine_context_out(rq->engine);
 
 		execlists_context_status_change(rq,
-- 
2.16.1



More information about the Intel-gfx mailing list