[PATCH v5 0/4] drm/xe/forcewake: add delayed-release optimization
Zongyao Bai <[email protected]>
| Newsgroups | org.freedesktop.lists.intel-xe |
|---|---|
| Message-ID | <[email protected]> |
Engine-cycle queries used by tools such as VTune and PTI can arrive in bursts. Releasing forcewake immediately after every query makes the next query issue another wake request and wait for its ACK. Add an opt-in delayed-release path that keeps an idle forcewake domain awake for a configurable interval, allowing a subsequent engine-cycle query to reuse it. Other forcewake users retain the existing immediate release behavior. The default hold interval is 100 us and can be changed through configfs before binding the device. The series also synchronizes engine-cycle queries with unplug and flushes pending delayed releases before suspend, shutdown, remove, and probe unwind, ensuring timer callbacks cannot access MMIO after power-off or teardown. On BMG, this reduced the Level Zero timestamp median from approximately 48.5 us to 9.4 us. v5: - Split the original patch into four patches: unplug synchronization, delayed-release infrastructure, power-boundary flushing, and opt-in enablement/configuration. - Preserve a newer hold interval when an older timer callback is running, and settle an outstanding sleep ACK before waking a domain again. (Sashiko, Matt) - Synchronously cancel delayed-release timers during forcewake cleanup. (Sashiko, Matt) - Flush delayed releases during shutdown, device removal, and post-registration probe unwind in addition to system/runtime suspend. (Matt) Zongyao Bai (4): drm/xe/forcewake: synchronize engine-cycle access with unplug drm/xe/forcewake: add delayed-release state machine drm/xe/forcewake: flush delayed release at power boundaries drm/xe/forcewake: enable configurable delayed forcewake release drivers/gpu/drm/xe/xe_configfs.c | 72 ++++++++ drivers/gpu/drm/xe/xe_configfs.h | 5 + drivers/gpu/drm/xe/xe_defaults.h | 1 + drivers/gpu/drm/xe/xe_device.c | 16 +- drivers/gpu/drm/xe/xe_device_types.h | 3 + drivers/gpu/drm/xe/xe_force_wake.c | 211 +++++++++++++++++++++-- drivers/gpu/drm/xe/xe_force_wake.h | 46 ++++- drivers/gpu/drm/xe/xe_force_wake_types.h | 68 +++++++- drivers/gpu/drm/xe/xe_gt.c | 12 +- drivers/gpu/drm/xe/xe_query.c | 36 +++- 10 files changed, 437 insertions(+), 33 deletions(-) -- 2.43.0