cargo fmt
This commit is contained in:
parent
524057418e
commit
5d6fadcea8
|
@ -410,9 +410,7 @@ impl<A: AsRawFd + 'static> DrmDevice<A> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Ok(1) =
|
if let Ok(1) = self.get_driver_capability(DriverCapability::AddFB2Modifiers) {
|
||||||
self.get_driver_capability(DriverCapability::AddFB2Modifiers)
|
|
||||||
{
|
|
||||||
let set = self.get_properties(plane).map_err(|source| Error::Access {
|
let set = self.get_properties(plane).map_err(|source| Error::Access {
|
||||||
errmsg: "Failed to query properties",
|
errmsg: "Failed to query properties",
|
||||||
dev: self.dev_path(),
|
dev: self.dev_path(),
|
||||||
|
@ -420,7 +418,9 @@ impl<A: AsRawFd + 'static> DrmDevice<A> {
|
||||||
})?;
|
})?;
|
||||||
let (handles, _) = set.as_props_and_values();
|
let (handles, _) = set.as_props_and_values();
|
||||||
// for every handle ...
|
// for every handle ...
|
||||||
let prop = handles.iter().find(|handle| {
|
let prop = handles
|
||||||
|
.iter()
|
||||||
|
.find(|handle| {
|
||||||
// get information of that property
|
// get information of that property
|
||||||
if let Some(info) = self.get_property(**handle).ok() {
|
if let Some(info) = self.get_property(**handle).ok() {
|
||||||
// to find out, if we got the handle of the "IN_FORMATS" property ...
|
// to find out, if we got the handle of the "IN_FORMATS" property ...
|
||||||
|
@ -430,7 +430,8 @@ impl<A: AsRawFd + 'static> DrmDevice<A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
}).copied();
|
})
|
||||||
|
.copied();
|
||||||
if let Some(prop) = prop {
|
if let Some(prop) = prop {
|
||||||
let prop_info = self.get_property(prop).map_err(|source| Error::Access {
|
let prop_info = self.get_property(prop).map_err(|source| Error::Access {
|
||||||
errmsg: "Failed to query property",
|
errmsg: "Failed to query property",
|
||||||
|
@ -505,7 +506,9 @@ impl<A: AsRawFd + 'static> DrmDevice<A> {
|
||||||
|
|
||||||
trace!(
|
trace!(
|
||||||
self.logger,
|
self.logger,
|
||||||
"Supported scan-out formats for plane ({:?}): {:?}", plane, formats
|
"Supported scan-out formats for plane ({:?}): {:?}",
|
||||||
|
plane,
|
||||||
|
formats
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(DrmSurface {
|
Ok(DrmSurface {
|
||||||
|
|
|
@ -4,7 +4,10 @@ use std::sync::{
|
||||||
Arc, Weak,
|
Arc, Weak,
|
||||||
};
|
};
|
||||||
|
|
||||||
use drm::{Device as BasicDevice, control::{crtc, Device as ControlDevice}};
|
use drm::{
|
||||||
|
control::{crtc, Device as ControlDevice},
|
||||||
|
Device as BasicDevice,
|
||||||
|
};
|
||||||
use nix::libc::dev_t;
|
use nix::libc::dev_t;
|
||||||
use nix::sys::stat;
|
use nix::sys::stat;
|
||||||
|
|
||||||
|
@ -140,8 +143,8 @@ impl<A: AsRawFd + 'static> DrmSurfaceObserver<A> {
|
||||||
SessionSignal::ActivateSession => self.activate(None),
|
SessionSignal::ActivateSession => self.activate(None),
|
||||||
SessionSignal::ActivateDevice { major, minor, new_fd } => {
|
SessionSignal::ActivateDevice { major, minor, new_fd } => {
|
||||||
self.activate(Some((major, minor, new_fd)))
|
self.activate(Some((major, minor, new_fd)))
|
||||||
},
|
}
|
||||||
_ => {},
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +165,10 @@ impl<A: AsRawFd + 'static> DrmSurfaceObserver<A> {
|
||||||
DrmSurfaceInternal::Atomic(surf) => surf.reset_state(fd.as_ref()),
|
DrmSurfaceInternal::Atomic(surf) => surf.reset_state(fd.as_ref()),
|
||||||
DrmSurfaceInternal::Legacy(surf) => surf.reset_state(fd.as_ref()),
|
DrmSurfaceInternal::Legacy(surf) => surf.reset_state(fd.as_ref()),
|
||||||
} {
|
} {
|
||||||
warn!(self.logger, "Failed to reset state of surface ({:?}/{:?}): {}", self.dev_id, self.crtc, err);
|
warn!(
|
||||||
|
self.logger,
|
||||||
|
"Failed to reset state of surface ({:?}/{:?}): {}", self.dev_id, self.crtc, err
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,11 @@ pub struct State {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl State {
|
impl State {
|
||||||
fn current_state<A: AsRawFd + ControlDevice>(fd: &A, crtc: crtc::Handle, prop_mapping: &Mapping) -> Result<Self, Error> {
|
fn current_state<A: AsRawFd + ControlDevice>(
|
||||||
|
fd: &A,
|
||||||
|
crtc: crtc::Handle,
|
||||||
|
prop_mapping: &Mapping,
|
||||||
|
) -> Result<Self, Error> {
|
||||||
let crtc_info = fd.get_crtc(crtc).map_err(|source| Error::Access {
|
let crtc_info = fd.get_crtc(crtc).map_err(|source| Error::Access {
|
||||||
errmsg: "Error loading crtc info",
|
errmsg: "Error loading crtc info",
|
||||||
dev: fd.dev_path(),
|
dev: fd.dev_path(),
|
||||||
|
@ -767,8 +771,10 @@ impl<A: AsRawFd + 'static> AtomicDrmSurface<A> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn reset_state<B: AsRawFd + ControlDevice + 'static>(
|
||||||
pub(crate) fn reset_state<B: AsRawFd + ControlDevice + 'static>(&self, fd: Option<&B>) -> Result<(), Error> {
|
&self,
|
||||||
|
fd: Option<&B>,
|
||||||
|
) -> Result<(), Error> {
|
||||||
*self.state.write().unwrap() = if let Some(fd) = fd {
|
*self.state.write().unwrap() = if let Some(fd) = fd {
|
||||||
State::current_state(fd, self.crtc, &self.prop_mapping)?
|
State::current_state(fd, self.crtc, &self.prop_mapping)?
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -403,7 +403,10 @@ impl<A: AsRawFd + 'static> LegacyDrmSurface<A> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn reset_state<B: AsRawFd + ControlDevice + 'static>(&self, fd: Option<&B>) -> Result<(), Error> {
|
pub(crate) fn reset_state<B: AsRawFd + ControlDevice + 'static>(
|
||||||
|
&self,
|
||||||
|
fd: Option<&B>,
|
||||||
|
) -> Result<(), Error> {
|
||||||
*self.state.write().unwrap() = if let Some(fd) = fd {
|
*self.state.write().unwrap() = if let Some(fd) = fd {
|
||||||
State::current_state(fd, self.crtc)?
|
State::current_state(fd, self.crtc)?
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
//! Implementation of the rendering traits using OpenGL ES 2
|
//! Implementation of the rendering traits using OpenGL ES 2
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
use std::convert::TryFrom;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
@ -10,7 +11,6 @@ use std::sync::{
|
||||||
mpsc::{channel, Receiver, Sender},
|
mpsc::{channel, Receiver, Sender},
|
||||||
};
|
};
|
||||||
use std::{collections::HashSet, os::raw::c_char};
|
use std::{collections::HashSet, os::raw::c_char};
|
||||||
use std::convert::TryFrom;
|
|
||||||
|
|
||||||
use cgmath::{prelude::*, Matrix3};
|
use cgmath::{prelude::*, Matrix3};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue