forge
Explore
Log in

Don't you dare go Hollow

B17: cros-libva DrmDeviceIterator: skip missing renderD nodes instead of stopping at the first gap (scan renderD128..renderD191)

Browse files at this commit

e521131fb21e520e8c7261cde36697aee672d81dAhmet Kaan GümüşParent: 4ec7fdc
shims/cros-libva/src/display.rsmodified+6 -10
@@ -45,18 +45,14 @@ impl Iterator for DrmDeviceIterator {
4545 type Item = PathBuf;
4646
4747 fn next(&mut self) -> Option<Self::Item> {
48- match self.cur_idx {
49- idx if idx >= DRM_RENDER_NODE_START + DRM_NUM_NODES => None,
50- idx => {
51- let path = PathBuf::from(format!("{}{}", DRM_NODE_DEFAULT_PREFIX, idx));
52- if !path.exists() {
53- None
54- } else {
55- self.cur_idx += 1;
56- Some(path)
57- }
48+ while self.cur_idx < DRM_RENDER_NODE_START + DRM_NUM_NODES {
49+ let path = PathBuf::from(format!("{}{}", DRM_NODE_DEFAULT_PREFIX, self.cur_idx));
50+ self.cur_idx += 1;
51+ if path.exists() {
52+ return Some(path);
5853 }
5954 }
55+ None
6056 }
6157 }
6258