Commit 667fc27e authored by Matt Roper's avatar Matt Roper
Browse files

drm/xe/query: Use scope-based forcewake



Use scope-based forcewake handling for consistency with other parts of
the driver.

Reviewed-by: default avatarGustavo Sousa <gustavo.sousa@intel.com>
Link: https://patch.msgid.link/20251118164338.3572146-47-matthew.d.roper@intel.com


Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
parent 175b9aab
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -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);
	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);

	xe_force_wake_put(gt_to_fw(gt), fw_ref);
	}

	if (GRAPHICS_VER(xe) >= 20)
		resp.width = 64;