diff options
| author | Lucas De Marchi <lucas.demarchi@intel.com> | 2025-01-07 12:26:11 -0800 |
|---|---|---|
| committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2025-01-10 07:20:02 -0800 |
| commit | 1a42e60820dacba4e7253c402759ce4f25c12390 (patch) | |
| tree | 0df81d3d4893924e91055ac166fd6453db9cb003 /lib/xe/xe_util.h | |
| parent | 9ef7df27d72d395c42206c1d346b359de606c114 (diff) | |
lib/xe: Split nsec to ticks abstraction
There are 2 things happening here: one is converting time in nanoseconds
to ticks by using the refclock, and another asserting a spin duration is
not so close to the maximum duration since there needs to be room for
context switch.
Move the time conversion to xe_util.c and adjust it to maintain
namespace and have better names. Places that do the time conversion to
pass to xe_spin then use the xe_spin_nsec_to_ticks() wrapper to
calculate the ticks.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20250107202615.1306306-4-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'lib/xe/xe_util.h')
| -rw-r--r-- | lib/xe/xe_util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/xe/xe_util.h b/lib/xe/xe_util.h index c544d912f..06ebd3c2a 100644 --- a/lib/xe/xe_util.h +++ b/lib/xe/xe_util.h @@ -47,4 +47,6 @@ void xe_bind_unbind_async(int fd, uint32_t vm, uint32_t bind_engine, struct igt_list_head *obj_list, uint32_t sync_in, uint32_t sync_out); +uint32_t xe_nsec_to_ticks(int fd, int gt_id, uint64_t ns); + #endif /* XE_UTIL_H */ |
