mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
rusticl/mesa: wire up fence_server
We need this to wait on imported fences.
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36249>
(cherry picked from commit 8617cf46d6)
This commit is contained in:
parent
e7d7d10d0a
commit
5e39ac7bc8
3 changed files with 21 additions and 2 deletions
|
|
@ -6264,7 +6264,7 @@
|
|||
"description": "rusticl/mesa: wire up fence_server",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -681,6 +681,11 @@ impl PipeContext {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn has_fence_server(&self) -> bool {
|
||||
let pipe = unsafe { self.pipe().as_ref() };
|
||||
pipe.fence_server_signal.is_some() && pipe.fence_server_sync.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for PipeContext {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::pipe::screen::*;
|
||||
use crate::pipe::{context::PipeContext, screen::*};
|
||||
|
||||
use libc_rust_gen::close;
|
||||
use mesa_rust_gen::*;
|
||||
|
|
@ -30,6 +30,20 @@ impl PipeFence {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn gpu_signal(&self, ctx: &PipeContext) {
|
||||
debug_assert!(ctx.has_fence_server());
|
||||
unsafe {
|
||||
ctx.pipe().as_ref().fence_server_signal.unwrap()(ctx.pipe().as_ptr(), self.fence, 0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn gpu_wait(&self, ctx: &PipeContext) {
|
||||
debug_assert!(ctx.has_fence_server());
|
||||
unsafe {
|
||||
ctx.pipe().as_ref().fence_server_sync.unwrap()(ctx.pipe().as_ptr(), self.fence, 0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wait(&self) {
|
||||
self.screen.fence_finish(self.fence);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue