drm: allow crate internal impls to access crtc and plane

This commit is contained in:
Victor Brekenfeld 2020-05-18 20:16:32 +02:00
parent f9aef43ac2
commit 997895b3c7
3 changed files with 12 additions and 8 deletions

View File

@ -61,7 +61,7 @@ type Mapping = (
HashMap<plane::Handle, HashMap<String, property::Handle>>,
);
struct Dev<A: AsRawFd + 'static> {
pub(in crate::backend::drm) struct Dev<A: AsRawFd + 'static> {
fd: A,
privileged: bool,
active: Arc<AtomicBool>,

View File

@ -38,11 +38,11 @@ pub struct Planes {
pub cursor: plane::Handle,
}
pub(super) struct AtomicDrmSurfaceInternal<A: AsRawFd + 'static> {
pub(in crate::backend::drm) struct AtomicDrmSurfaceInternal<A: AsRawFd + 'static> {
pub(super) dev: Rc<Dev<A>>,
pub(super) crtc: crtc::Handle,
pub(super) cursor: CursorState,
pub(super) planes: Planes,
pub(in crate::backend::drm) planes: Planes,
pub(super) state: RwLock<State>,
pub(super) pending: RwLock<State>,
pub(super) logger: ::slog::Logger,
@ -918,7 +918,7 @@ impl<A: AsRawFd + 'static> AtomicDrmSurfaceInternal<A> {
))
}
pub(crate) fn clear_plane(&self, plane: plane::Handle) -> Result<(), Error> {
pub(super) fn clear_plane(&self, plane: plane::Handle) -> Result<(), Error> {
let mut req = AtomicModeReq::new();
req.add_property(
@ -948,7 +948,9 @@ impl<A: AsRawFd + 'static> AtomicDrmSurfaceInternal<A> {
}
/// Open raw crtc utilizing atomic mode-setting
pub struct AtomicDrmSurface<A: AsRawFd + 'static>(pub(super) Rc<AtomicDrmSurfaceInternal<A>>);
pub struct AtomicDrmSurface<A: AsRawFd + 'static>(
pub(in crate::backend::drm) Rc<AtomicDrmSurfaceInternal<A>>,
);
impl<A: AsRawFd + 'static> AsRawFd for AtomicDrmSurface<A> {
fn as_raw_fd(&self) -> RawFd {

View File

@ -23,9 +23,9 @@ pub struct State {
pub connectors: HashSet<connector::Handle>,
}
pub(super) struct LegacyDrmSurfaceInternal<A: AsRawFd + 'static> {
pub(in crate::backend::drm) struct LegacyDrmSurfaceInternal<A: AsRawFd + 'static> {
pub(super) dev: Rc<Dev<A>>,
pub(super) crtc: crtc::Handle,
pub(in crate::backend::drm) crtc: crtc::Handle,
pub(super) state: RwLock<State>,
pub(super) pending: RwLock<State>,
pub(super) logger: ::slog::Logger,
@ -454,7 +454,9 @@ impl<A: AsRawFd + 'static> Drop for LegacyDrmSurfaceInternal<A> {
}
/// Open raw crtc utilizing legacy mode-setting
pub struct LegacyDrmSurface<A: AsRawFd + 'static>(pub(super) Rc<LegacyDrmSurfaceInternal<A>>);
pub struct LegacyDrmSurface<A: AsRawFd + 'static>(
pub(in crate::backend::drm) Rc<LegacyDrmSurfaceInternal<A>>,
);
impl<A: AsRawFd + 'static> AsRawFd for LegacyDrmSurface<A> {
fn as_raw_fd(&self) -> RawFd {