rusticl/event: check the queue timed to detect enabled profiling in call

Gets rid of an unwrap and the dependency on the queue.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35672>
This commit is contained in:
Karol Herbst 2025-06-21 17:22:42 +02:00 committed by Marge Bot
parent 815373fe62
commit 8291331c43

View file

@ -222,12 +222,11 @@ impl Event {
pub fn call(&self, ctx: &QueueContext) -> cl_int {
let mut lock = self.state();
let mut status = lock.status;
let queue = self.queue.as_ref().unwrap();
let profiling_enabled = queue.is_profiling_enabled();
let profiling_enabled = lock.time_queued != 0;
if status == CL_QUEUED as cl_int {
if profiling_enabled {
// We already have the lock so can't call set_time on the event
lock.time_submit = queue.device.screen().get_timestamp();
lock.time_submit = ctx.dev.screen().get_timestamp();
}
let mut query_start = None;
let mut query_end = None;