diff --git a/anvil/src/udev.rs b/anvil/src/udev.rs index 5fc1c81..b6bf30d 100644 --- a/anvil/src/udev.rs +++ b/anvil/src/udev.rs @@ -411,9 +411,29 @@ impl UdevHandler for UdevHandlerImpl OFlag::O_RDWR | OFlag::O_CLOEXEC | OFlag::O_NOCTTY | OFlag::O_NONBLOCK, ) .ok() - .and_then(|fd| LegacyDrmDevice::new(SessionFd(fd), self.logger.clone()).ok()) - .and_then(|drm| GbmDevice::new(drm, self.logger.clone()).ok()) - .and_then(|gbm| EglDevice::new(gbm, self.logger.clone()).ok()) + .and_then( + |fd| match LegacyDrmDevice::new(SessionFd(fd), self.logger.clone()) { + Ok(drm) => Some(drm), + Err(err) => { + error!(self.logger, "Skipping drm device, because of error: {}", err); + None + } + }, + ) + .and_then(|drm| match GbmDevice::new(drm, self.logger.clone()) { + Ok(gbm) => Some(gbm), + Err(err) => { + error!(self.logger, "Skipping gbm device, because of error: {}", err); + None + } + }) + .and_then(|gbm| match EglDevice::new(gbm, self.logger.clone()) { + Ok(egl) => Some(egl), + Err(err) => { + error!(self.logger, "Skipping egl device, because of error: {}", err); + None + } + }) { // init hardware acceleration on the primary gpu. #[cfg(feature = "egl")]