]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
drm/i915/gt: Schedule request retirement when timeline idles
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 25 Nov 2019 10:58:58 +0000 (10:58 +0000)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 24 Feb 2020 20:36:05 +0000 (21:36 +0100)
commitf7b63c999b31b09d6cdc3c7a7aa4da1ad9480589
tree0d7f3eb1f7fe8d064980c0560d4b7d915a6107b0
parent14cb294ef0ce748d6cdc7f175f370fc468ca3962
drm/i915/gt: Schedule request retirement when timeline idles

BugLink: https://bugs.launchpad.net/bugs/1853044
The major drawback of commit 7e34f4e4aad3 ("drm/i915/gen8+: Add RC6 CTX
corruption WA") is that it disables RC6 while Skylake (and friends) is
active, and we do not consider the GPU idle until all outstanding
requests have been retired and the engine switched over to the kernel
context. If userspace is idle, this task falls onto our background idle
worker, which only runs roughly once a second, meaning that userspace has
to have been idle for a couple of seconds before we enable RC6 again.
Naturally, this causes us to consume considerably more energy than
before as powersaving is effectively disabled while a display server
(here's looking at you Xorg) is running.

As execlists will get a completion event as each context is completed,
we can use this interrupt to queue a retire worker bound to this engine
to cleanup idle timelines. We will then immediately notice the idle
engine (without userspace intervention or the aid of the background
retire worker) and start parking the GPU. Thus during light workloads,
we will do much more work to idle the GPU faster...  Hopefully with
commensurate power saving!

v2: Watch context completions and only look at those local to the engine
when retiring to reduce the amount of excess work we perform.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112315
References: 7e34f4e4aad3 ("drm/i915/gen8+: Add RC6 CTX corruption WA")
References: 2248a28384fe ("drm/i915/gen8+: Add RC6 CTX corruption WA")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191125105858.1718307-3-chris@chris-wilson.co.uk
(cherry picked from commit 4f88f8747fa43c97c3b3712d8d87295ea757cc51)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/gt/intel_engine_cs.c
drivers/gpu/drm/i915/gt/intel_engine_types.h
drivers/gpu/drm/i915/gt/intel_gt_requests.c [new file with mode: 0644]
drivers/gpu/drm/i915/gt/intel_gt_requests.h [new file with mode: 0644]
drivers/gpu/drm/i915/gt/intel_lrc.c
drivers/gpu/drm/i915/gt/intel_timeline.c
drivers/gpu/drm/i915/gt/intel_timeline_types.h
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/i915_request.h