[core] move normalize from Global into Queue::get_timestamp_period

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and Teodor Tanasoaia committed 2026-08-12 18:54:48 +02:00
1 parent 60e606781c
commit a3105e5bf9
2 files changed
+10 -6

No files matched your search

+9 -5
View File
@@ -1841,10 +1841,18 @@ impl Queue {
Ok(SubmissionResult { snatch_guard })
}
pub fn get_timestamp_period(&self) -> f32 {
pub(crate) fn get_raw_timestamp_period(&self) -> f32 {
unsafe { self.raw().get_timestamp_period() }
}
pub fn get_timestamp_period(&self) -> f32 {
if self.device.timestamp_normalizer.get().unwrap().enabled() {
return 1.0;
}
self.get_raw_timestamp_period()
}
/// `closure` is guaranteed to be called.
pub fn on_submitted_work_done(
&self,
@@ -2101,10 +2109,6 @@ impl Global {
pub fn queue_get_timestamp_period(&self, queue_id: QueueId) -> f32 {
let queue = self.hub.queues.get(queue_id);
if queue.device.timestamp_normalizer.get().unwrap().enabled() {
return 1.0;
}
queue.get_timestamp_period()
}
+1 -1
View File
@@ -765,7 +765,7 @@ impl Device {
let timestamp_normalizer = crate::timestamp_normalization::TimestampNormalizer::new(
self,
queue.get_timestamp_period(),
queue.get_raw_timestamp_period(),
)?;
self.timestamp_normalizer