diff options
| author | Matt Roper <matthew.d.roper@intel.com> | 2025-11-18 08:43:57 -0800 |
|---|---|---|
| committer | Matt Roper <matthew.d.roper@intel.com> | 2025-11-19 11:58:58 -0800 |
| commit | 667fc27e81bc4bd0aae008b6c3f16df9e707707e (patch) | |
| tree | 7dd62b9a82dfbb3d4548e2db4a57efbe565b2619 /drivers/gpu/drm | |
| parent | 175b9aaba3e2b32935204b46ff1ea6356b775801 (diff) | |
drm/xe/query: Use scope-based forcewake
Use scope-based forcewake handling for consistency with other parts of
the driver.
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251118164338.3572146-47-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/xe/xe_query.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c index 1c0915e2cc16..a7bf1fd6dd6a 100644 --- a/drivers/gpu/drm/xe/xe_query.c +++ b/drivers/gpu/drm/xe/xe_query.c @@ -122,7 +122,6 @@ query_engine_cycles(struct xe_device *xe, __ktime_func_t cpu_clock; struct xe_hw_engine *hwe; struct xe_gt *gt; - unsigned int fw_ref; if (IS_SRIOV_VF(xe)) return -EOPNOTSUPP; @@ -158,16 +157,13 @@ query_engine_cycles(struct xe_device *xe, if (!hwe) return -EINVAL; - fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL); - if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) { - xe_force_wake_put(gt_to_fw(gt), fw_ref); - return -EIO; - } - - hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp, - &resp.cpu_delta, cpu_clock); + 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)) + return -EIO; - xe_force_wake_put(gt_to_fw(gt), fw_ref); + hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp, + &resp.cpu_delta, cpu_clock); + } if (GRAPHICS_VER(xe) >= 20) resp.width = 64; |
