summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Wang <x.wang@intel.com>2026-06-04 22:19:44 -0700
committerMatt Roper <matthew.d.roper@intel.com>2026-06-11 13:50:27 -0700
commit9f89a6de30f74db97b3f36797a0cabe057b06c2a (patch)
treee96be4b45e6890379b8b79312ce6b5b75efa3050
parent3a11a63cc16660d514ff584e7551589655337e87 (diff)
downloadlinux-9f89a6de30f74db97b3f36797a0cabe057b06c2a.tar.gz
linux-9f89a6de30f74db97b3f36797a0cabe057b06c2a.zip
drm/xe/query: Avoid global forcewake in cycle query path
Engine cycle query is a lightweight timestamp path and should not wake unrelated GT domains. Limit forcewake scope to what the query actually needs. Suggested-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Xin Wang <x.wang@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20260605051944.1541085-1-x.wang@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_query.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 8c7d54498f38..dc975f595368 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -119,6 +119,7 @@ query_engine_cycles(struct xe_device *xe,
struct drm_xe_engine_class_instance *eci;
struct drm_xe_query_engine_cycles resp;
size_t size = sizeof(resp);
+ enum xe_force_wake_domains fw_domain;
__ktime_func_t cpu_clock;
struct xe_hw_engine *hwe;
struct xe_gt *gt;
@@ -154,8 +155,10 @@ query_engine_cycles(struct xe_device *xe,
if (!hwe)
return -EINVAL;
- xe_with_force_wake(fw_ref, gt_to_fw(gt), XE_FORCEWAKE_ALL) {
- if (!xe_force_wake_ref_has_domain(fw_ref.domains, XE_FORCEWAKE_ALL))
+ fw_domain = xe_hw_engine_to_fw_domain(hwe);
+
+ xe_with_force_wake(fw_ref, gt_to_fw(gt), fw_domain) {
+ if (!xe_force_wake_ref_has_domain(fw_ref.domains, fw_domain))
return -EIO;
hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp,