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:
David Riley 2018-05-22 15:36:31 -07:00 committed by chrome-bot
parent f89e0b50e2
commit c9ce2da943
3 changed files with 10 additions and 0 deletions

View file

@ -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();
}
}

View file

@ -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())

View file

@ -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.