feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
|
|
use smithay::{
|
|
|
|
|
backend::{
|
|
|
|
|
allocator::gbm::GbmAllocator,
|
|
|
|
|
drm::{
|
2026-03-10 22:43:43 +00:00
|
|
|
DrmDeviceFd, DrmNode,
|
feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
exporter::gbm::GbmFramebufferExporter,
|
|
|
|
|
output::{DrmOutput, DrmOutputManager},
|
|
|
|
|
},
|
|
|
|
|
renderer::{
|
|
|
|
|
gles::GlesRenderer,
|
2026-03-10 22:43:43 +00:00
|
|
|
multigpu::{GpuManager, gbm::GbmGlesBackend},
|
feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
},
|
|
|
|
|
session::libseat::LibSeatSession,
|
|
|
|
|
},
|
|
|
|
|
desktop::utils::OutputPresentationFeedback,
|
|
|
|
|
output::Output,
|
|
|
|
|
reexports::{
|
|
|
|
|
calloop::RegistrationToken,
|
|
|
|
|
drm::control::crtc,
|
2026-03-10 22:43:43 +00:00
|
|
|
wayland_server::{DisplayHandle, backend::GlobalId},
|
feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
use smithay_drm_extras::drm_scanner::DrmScanner;
|
|
|
|
|
|
|
|
|
|
pub type WeftAllocator = GbmAllocator<DrmDeviceFd>;
|
|
|
|
|
pub type WeftExporter = GbmFramebufferExporter<DrmDeviceFd>;
|
2026-03-10 22:43:43 +00:00
|
|
|
pub type WeftDrmOutput =
|
|
|
|
|
DrmOutput<WeftAllocator, WeftExporter, Option<OutputPresentationFeedback>, DrmDeviceFd>;
|
|
|
|
|
pub type WeftDrmOutputManager =
|
|
|
|
|
DrmOutputManager<WeftAllocator, WeftExporter, Option<OutputPresentationFeedback>, DrmDeviceFd>;
|
feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
pub type WeftGpuManager = GpuManager<GbmGlesBackend<GlesRenderer, DrmDeviceFd>>;
|
|
|
|
|
|
2026-03-10 22:43:43 +00:00
|
|
|
#[allow(dead_code)]
|
feat(compositor): implement DRM/KMS rendering path
Add full DRM/KMS backend with libseat session, GBM allocation, EGL
display initialisation, and a GpuManager-driven rendering loop.
- drm_device.rs: type aliases and per-device/per-output state structs
(WeftDrmDevice, WeftOutputSurface, WeftDrmData)
- drm.rs: replace skeleton with complete backend libseat session,
udev device enumeration, libinput event source, connector scanning
via smithay-drm-extras DrmScanner, DrmOutputManager initialisation
per CRTC, VBlank-driven render_output, sd_notify(READY=1)
- state.rs: add drm: Option<WeftDrmData> field; route dmabuf import
through GPU manager when the DRM path is active
- Cargo.toml: add renderer_multi, use_system_lib Smithay features;
add smithay-drm-extras and sd-notify Linux dependencies
render_output submits a clear-colour-only frame to establish
the VBlank pipeline. Surface compositing is wired up in a subsequent commit.
2026-03-10 21:32:21 +00:00
|
|
|
pub struct WeftOutputSurface {
|
|
|
|
|
pub output: Output,
|
|
|
|
|
pub drm_output: WeftDrmOutput,
|
|
|
|
|
pub device_id: DrmNode,
|
|
|
|
|
pub global: GlobalId,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub struct WeftDrmDevice {
|
|
|
|
|
pub drm_output_manager: WeftDrmOutputManager,
|
|
|
|
|
pub drm_scanner: DrmScanner,
|
|
|
|
|
pub surfaces: HashMap<crtc::Handle, WeftOutputSurface>,
|
|
|
|
|
pub render_node: Option<DrmNode>,
|
|
|
|
|
pub registration_token: RegistrationToken,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub struct WeftDrmData {
|
|
|
|
|
pub session: LibSeatSession,
|
|
|
|
|
pub primary_gpu: DrmNode,
|
|
|
|
|
pub gpu_manager: WeftGpuManager,
|
|
|
|
|
pub devices: HashMap<DrmNode, WeftDrmDevice>,
|
|
|
|
|
pub keyboards: Vec<smithay::reexports::input::Device>,
|
|
|
|
|
pub display_handle: DisplayHandle,
|
|
|
|
|
}
|