mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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>
This commit is contained in:
parent
175b9aaba3
commit
667fc27e81
|
|
@ -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,17 +157,14 @@ 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;
|
||||
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;
|
||||
|
||||
hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp,
|
||||
&resp.cpu_delta, cpu_clock);
|
||||
}
|
||||
|
||||
hwe_read_timestamp(hwe, &resp.engine_cycles, &resp.cpu_timestamp,
|
||||
&resp.cpu_delta, cpu_clock);
|
||||
|
||||
xe_force_wake_put(gt_to_fw(gt), fw_ref);
|
||||
|
||||
if (GRAPHICS_VER(xe) >= 20)
|
||||
resp.width = 64;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user