From 38d3db565a44c1692768eb19469ae4f3afcf6f1c Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Fri, 22 May 2020 22:59:32 +0200 Subject: [PATCH] anvil: do not double initialize surfaces with multiple matching encoders --- anvil/src/udev.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index 6f54a68..2579b7b 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -301,7 +301,7 @@ impl UdevHandlerImpl { .filter_map(|e| *e) .flat_map(|encoder_handle| device.get_encoder_info(encoder_handle)) .collect::>(); - for encoder_info in encoder_infos { + 'outer: for encoder_info in encoder_infos { for crtc in res_handles.filter_crtcs(encoder_info.possible_crtcs()) { if let Entry::Vacant(entry) = backends.entry(crtc) { let renderer = GliumDrawer::init( @@ -313,7 +313,7 @@ impl UdevHandlerImpl { ); entry.insert(Rc::new(renderer)); - break; + break 'outer; } } } @@ -349,14 +349,14 @@ impl UdevHandlerImpl { .filter_map(|e| *e) .flat_map(|encoder_handle| device.get_encoder_info(encoder_handle)) .collect::>(); - for encoder_info in encoder_infos { + 'outer: for encoder_info in encoder_infos { for crtc in res_handles.filter_crtcs(encoder_info.possible_crtcs()) { if !backends.contains_key(&crtc) { let renderer = GliumDrawer::init(device.create_surface(crtc).unwrap(), logger.clone()); backends.insert(crtc, Rc::new(renderer)); - break; + break 'outer; } } }