drm legacy: small cleanups + additional logging

This commit is contained in:
Victor Brekenfeld 2020-04-19 01:38:59 +02:00
parent 1b259e2deb
commit e8cb940aab
2 changed files with 10 additions and 10 deletions

View File

@ -95,7 +95,7 @@ impl<A: AsRawFd + 'static> LegacyDrmDevice<A> {
L: Into<Option<::slog::Logger>>, L: Into<Option<::slog::Logger>>,
{ {
let log = crate::slog_or_stdlog(logger).new(o!("smithay_module" => "backend_drm")); let log = crate::slog_or_stdlog(logger).new(o!("smithay_module" => "backend_drm"));
info!(log, "DrmDevice initializing"); info!(log, "LegacyDrmDevice initializing");
let dev_id = fstat(dev.as_raw_fd()) let dev_id = fstat(dev.as_raw_fd())
.map_err(Error::UnableToGetDeviceId)? .map_err(Error::UnableToGetDeviceId)?
@ -268,7 +268,11 @@ impl<A: AsRawFd + 'static> Device for LegacyDrmDevice<A> {
} else { } else {
self.backends.borrow_mut().remove(&event.crtc); self.backends.borrow_mut().remove(&event.crtc);
} }
} else {
debug!(self.logger, "Device not active. Ignoring PageFlip");
} }
} else {
trace!(self.logger, "Unrelated event");
} }
} }
} }
@ -294,22 +298,19 @@ impl<A: AsRawFd + 'static> Device for LegacyDrmDevice<A> {
}) })
} }
fn get_connector_info(&self, conn: connector::Handle) -> std::result::Result<connector::Info, DrmError> { fn get_connector_info(&self, conn: connector::Handle) -> Result<connector::Info, DrmError> {
self.get_connector(conn) self.get_connector(conn)
} }
fn get_crtc_info(&self, crtc: crtc::Handle) -> std::result::Result<crtc::Info, DrmError> { fn get_crtc_info(&self, crtc: crtc::Handle) -> Result<crtc::Info, DrmError> {
self.get_crtc(crtc) self.get_crtc(crtc)
} }
fn get_encoder_info(&self, enc: encoder::Handle) -> std::result::Result<encoder::Info, DrmError> { fn get_encoder_info(&self, enc: encoder::Handle) -> Result<encoder::Info, DrmError> {
self.get_encoder(enc) self.get_encoder(enc)
} }
fn get_framebuffer_info( fn get_framebuffer_info(&self, fb: framebuffer::Handle) -> Result<framebuffer::Info, DrmError> {
&self,
fb: framebuffer::Handle,
) -> std::result::Result<framebuffer::Info, DrmError> {
self.get_framebuffer(fb) self.get_framebuffer(fb)
} }
fn get_plane_info(&self, plane: plane::Handle) -> std::result::Result<plane::Info, DrmError> { fn get_plane_info(&self, plane: plane::Handle) -> Result<plane::Info, DrmError> {
self.get_plane(plane) self.get_plane(plane)
} }
} }

View File

@ -275,7 +275,6 @@ impl<A: AsRawFd + 'static> RawSurface for LegacyDrmSurfaceInternal<A> {
&[PageFlipFlags::PageFlipEvent], &[PageFlipFlags::PageFlipEvent],
None, None,
) )
.map_err(|x| dbg!(x))
.map_err(|_| SwapBuffersError::ContextLost) .map_err(|_| SwapBuffersError::ContextLost)
} }
} }