mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-01-27 10:36:40 +00:00
gpu: add force_ctx_0 calls prior to each gpu command
BUG=None TEST=build with --features=gpu; null_platform_test Change-Id: Ib7aab8b2f0d7e1523df49360ab99677b59ce6052 Reviewed-on: https://chromium-review.googlesource.com/1073960 Commit-Ready: David Riley <davidriley@chromium.org> Tested-by: David Riley <davidriley@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
f89e0b50e2
commit
c9ce2da943
3 changed files with 10 additions and 0 deletions
|
@ -937,4 +937,8 @@ impl Backend {
|
|||
pub fn fence_poll(&mut self) -> u32 {
|
||||
self.renderer.poll()
|
||||
}
|
||||
|
||||
pub fn force_ctx_0(&mut self) {
|
||||
self.renderer.force_ctx_0();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,6 +92,8 @@ impl Frontend {
|
|||
cmd: GpuCommand,
|
||||
data: Option<VolatileSlice>)
|
||||
-> GpuResponse {
|
||||
self.backend.force_ctx_0();
|
||||
|
||||
match cmd {
|
||||
GpuCommand::GetDisplayInfo(_) => {
|
||||
GpuResponse::OkDisplayInfo(self.backend.display_info().to_vec())
|
||||
|
|
|
@ -594,6 +594,10 @@ impl Renderer {
|
|||
};
|
||||
ret_to_res(ret)
|
||||
}
|
||||
|
||||
pub fn force_ctx_0(&self) {
|
||||
unsafe { virgl_renderer_force_ctx_0() };
|
||||
}
|
||||
}
|
||||
|
||||
/// A context in which resources can be attached/detached and commands can be submitted.
|
||||
|
|
Loading…
Reference in a new issue