mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-01-12 16:45:31 +00:00
gpu: make process_descriptor return Option
In preparation of adding fence support, allow process_descriptor to defer returning the descriptor until later by returning None. BUG=None TEST=build with --features=gpu; null_platform_test Change-Id: I57e4dc438e7f5a925c870e0bd596f89a2ed4e083 Reviewed-on: https://chromium-review.googlesource.com/1073957 Commit-Ready: David Riley <davidriley@chromium.org> Tested-by: David Riley <davidriley@chromium.org> Reviewed-by: David Riley <davidriley@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
af9d7edfb7
commit
4cbaeb7eaa
1 changed files with 7 additions and 5 deletions
|
@ -338,7 +338,9 @@ impl Frontend {
|
|||
&mut self.return_cursor_descriptors);
|
||||
}
|
||||
|
||||
fn process_descriptor(&mut self, mem: &GuestMemory, desc: QueueDescriptor) -> ReturnDescriptor {
|
||||
fn process_descriptor(&mut self,
|
||||
mem: &GuestMemory,
|
||||
desc: QueueDescriptor) -> Option<ReturnDescriptor> {
|
||||
let mut resp = GpuResponse::ErrUnspec;
|
||||
let mut gpu_cmd = None;
|
||||
let mut len = 0;
|
||||
|
@ -384,10 +386,10 @@ impl Frontend {
|
|||
}
|
||||
}
|
||||
}
|
||||
ReturnDescriptor {
|
||||
Some(ReturnDescriptor {
|
||||
index: desc.index,
|
||||
len,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn process_ctrl(&mut self, mem: &GuestMemory) -> Option<ReturnDescriptor> {
|
||||
|
@ -396,7 +398,7 @@ impl Frontend {
|
|||
.or_else(|| {
|
||||
self.ctrl_descriptors
|
||||
.pop_front()
|
||||
.map(|desc| self.process_descriptor(mem, desc))
|
||||
.and_then(|desc| self.process_descriptor(mem, desc))
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -406,7 +408,7 @@ impl Frontend {
|
|||
.or_else(|| {
|
||||
self.cursor_descriptors
|
||||
.pop_front()
|
||||
.map(|desc| self.process_descriptor(mem, desc))
|
||||
.and_then(|desc| self.process_descriptor(mem, desc))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue