1
0
Fork 0
forked from wry/wry

all: set rust edition to 2024

This commit is contained in:
Julian Orth 2025-02-21 10:44:29 +01:00
parent 02a18f620b
commit 3338909170
515 changed files with 1225 additions and 1187 deletions

View file

@ -24,13 +24,13 @@ use {
},
},
libinput::{
LibInput, LibInputAdapter, LibInputError,
consts::{
AccelProfile, LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE,
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT, LIBINPUT_DEVICE_CAP_TABLET_PAD,
LIBINPUT_DEVICE_CAP_TABLET_TOOL,
},
device::{LibInputDevice, RegisteredDevice},
LibInput, LibInputAdapter, LibInputError,
},
logind::{LogindError, Session},
state::State,
@ -46,7 +46,7 @@ use {
syncqueue::SyncQueue,
},
video::{
drm::{DrmError, DRM_MODE_ATOMIC_ALLOW_MODESET},
drm::{DRM_MODE_ATOMIC_ALLOW_MODESET, DrmError},
gbm::GbmError,
},
},
@ -61,7 +61,7 @@ use {
rc::Rc,
},
thiserror::Error,
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
#[derive(Debug, Error)]

View file

@ -2,8 +2,8 @@ use {
crate::{
backend::{BackendEvent, ConnectorEvent},
backends::metal::{
video::{FrontState, MetalDrmDeviceData, PendingDrmDevice},
MetalBackend, MetalDevice, MetalError, MetalInputDevice,
video::{FrontState, MetalDrmDeviceData, PendingDrmDevice},
},
dbus::{DbusError, TRUE},
udev::UdevDevice,
@ -20,7 +20,7 @@ use {
},
bstr::ByteSlice,
std::{cell::Cell, rc::Rc},
uapi::{c, OwnedFd},
uapi::{OwnedFd, c},
};
const DRM: &[u8] = b"drm";

View file

@ -2,14 +2,14 @@ use {
crate::{
backend::Connector,
backends::metal::{
MetalError,
video::{
MetalConnector, MetalCrtc, MetalHardwareCursorChange, MetalPlane, RenderBuffer,
},
MetalError,
},
gfx_api::{
create_render_pass, AcquireSync, BufferResv, GfxApiOpt, GfxRenderPass, GfxTexture,
ReleaseSync, SyncFile,
AcquireSync, BufferResv, GfxApiOpt, GfxRenderPass, GfxTexture, ReleaseSync, SyncFile,
create_render_pass,
},
rect::Region,
theme::Color,
@ -20,8 +20,8 @@ use {
video::{
dmabuf::DmaBufId,
drm::{
DrmError, DrmFramebuffer, DRM_MODE_ATOMIC_NONBLOCK, DRM_MODE_PAGE_FLIP_ASYNC,
DRM_MODE_PAGE_FLIP_EVENT,
DRM_MODE_ATOMIC_NONBLOCK, DRM_MODE_PAGE_FLIP_ASYNC, DRM_MODE_PAGE_FLIP_EVENT,
DrmError, DrmFramebuffer,
},
},
},
@ -248,7 +248,9 @@ impl MetalConnector {
if let Err(e) = res {
reset_damage();
if let MetalError::Commit(DrmError::Atomic(OsError(c::EACCES))) = e {
log::debug!("Could not perform atomic commit, likely because we're no longer the DRM master");
log::debug!(
"Could not perform atomic commit, likely because we're no longer the DRM master"
);
return Ok(());
}
Err(e)

View file

@ -8,18 +8,18 @@ use {
HardwareCursorUpdate, Mode, MonitorInfo,
},
backends::metal::{
present::{
DirectScanoutCache, PresentFb, DEFAULT_POST_COMMIT_MARGIN,
DEFAULT_PRE_COMMIT_MARGIN, POST_COMMIT_MARGIN_DELTA,
},
MetalBackend, MetalError,
present::{
DEFAULT_POST_COMMIT_MARGIN, DEFAULT_PRE_COMMIT_MARGIN, DirectScanoutCache,
POST_COMMIT_MARGIN_DELTA, PresentFb,
},
},
drm_feedback::DrmFeedback,
edid::{CtaDataBlock, Descriptor, EdidExtension},
format::{Format, ARGB8888, XRGB8888},
format::{ARGB8888, Format, XRGB8888},
gfx_api::{
needs_render_usage, AcquireSync, GfxContext, GfxFramebuffer, GfxTexture, ReleaseSync,
SyncFile,
AcquireSync, GfxContext, GfxFramebuffer, GfxTexture, ReleaseSync, SyncFile,
needs_render_usage,
},
ifs::{
wl_output::OutputId,
@ -35,22 +35,22 @@ use {
numcell::NumCell, on_change::OnChange, opaque_cell::OpaqueCell, oserror::OsError,
},
video::{
INVALID_MODIFIER, Modifier,
dmabuf::DmaBufId,
drm::{
drm_mode_modeinfo, Change, ConnectorStatus, ConnectorType, DrmBlob, DrmConnector,
DrmCrtc, DrmEncoder, DrmError, DrmEvent, DrmFramebuffer, DrmLease, DrmMaster,
DrmModeInfo, DrmObject, DrmPlane, DrmProperty, DrmPropertyDefinition,
DrmPropertyType, DrmVersion, PropBlob, DRM_CLIENT_CAP_ATOMIC,
DRM_MODE_ATOMIC_ALLOW_MODESET,
Change, ConnectorStatus, ConnectorType, DRM_CLIENT_CAP_ATOMIC,
DRM_MODE_ATOMIC_ALLOW_MODESET, DrmBlob, DrmConnector, DrmCrtc, DrmEncoder,
DrmError, DrmEvent, DrmFramebuffer, DrmLease, DrmMaster, DrmModeInfo, DrmObject,
DrmPlane, DrmProperty, DrmPropertyDefinition, DrmPropertyType, DrmVersion,
PropBlob, drm_mode_modeinfo,
},
gbm::{GbmBo, GbmDevice, GBM_BO_USE_LINEAR, GBM_BO_USE_RENDERING, GBM_BO_USE_SCANOUT},
Modifier, INVALID_MODIFIER,
gbm::{GBM_BO_USE_LINEAR, GBM_BO_USE_RENDERING, GBM_BO_USE_SCANOUT, GbmBo, GbmDevice},
},
},
ahash::{AHashMap, AHashSet},
arrayvec::ArrayVec,
bstr::{BString, ByteSlice},
indexmap::{indexset, IndexMap, IndexSet},
indexmap::{IndexMap, IndexSet, indexset},
isnt::std_1::collections::IsntHashMap2Ext,
jay_config::video::GfxApi,
std::{
@ -64,8 +64,8 @@ use {
rc::Rc,
},
uapi::{
c::{self, dev_t},
OwnedFd,
c::{self, dev_t},
},
};
@ -213,7 +213,9 @@ impl BackendDrmDevice for MetalDrmDevice {
}
}
_ => {
log::error!("Connector is logically available for leasing, has a lease ID, and has no entry in leases_to_break");
log::error!(
"Connector is logically available for leasing, has a lease ID, and has no entry in leases_to_break"
);
}
}
}
@ -1477,7 +1479,7 @@ fn create_plane(plane: DrmPlane, master: &Rc<DrmMaster>) -> Result<MetalPlane, D
_ => {
return Err(DrmError::MissingProperty(
"type".to_string().into_boxed_str(),
))
));
}
};
let default_properties = create_default_properties(
@ -2292,14 +2294,18 @@ impl MetalBackend {
}
if let Some(plane) = c.primary_plane.get() {
if plane.crtc_id.value.get() != crtc.id {
log::warn!("Cannot preserve connector whose primary plane is attached to a different crtc");
log::warn!(
"Cannot preserve connector whose primary plane is attached to a different crtc"
);
fail!(c.id);
}
}
if let Some(plane) = c.cursor_plane.get() {
let crtc_id = plane.crtc_id.value.get();
if crtc_id.is_some() && crtc_id != crtc.id {
log::warn!("Cannot preserve connector whose cursor plane is attached to a different crtc");
log::warn!(
"Cannot preserve connector whose cursor plane is attached to a different crtc"
);
fail!(c.id);
}
}

View file

@ -3,10 +3,10 @@ use {
allocator::BufferObject,
async_engine::{Phase, SpawnedFuture},
backend::{
AxisSource, Backend, BackendDrmDevice, BackendEvent, Connector, ConnectorEvent,
ConnectorId, ConnectorKernelId, DrmDeviceId, DrmEvent, InputDevice,
AXIS_120, AxisSource, Backend, BackendDrmDevice, BackendEvent, Connector,
ConnectorEvent, ConnectorId, ConnectorKernelId, DrmDeviceId, DrmEvent, InputDevice,
InputDeviceAccelProfile, InputDeviceCapability, InputDeviceId, InputEvent, KeyState,
Mode, MonitorInfo, ScrollAxis, TransformMatrix, AXIS_120,
Mode, MonitorInfo, ScrollAxis, TransformMatrix,
},
fixed::Fixed,
format::XRGB8888,
@ -20,7 +20,7 @@ use {
},
video::{
drm::{ConnectorType, Drm, DrmError, DrmVersion},
gbm::{GbmBo, GbmDevice, GbmError, GBM_BO_USE_RENDERING},
gbm::{GBM_BO_USE_RENDERING, GbmBo, GbmDevice, GbmError},
},
wire_xcon::{
ChangeProperty, ChangeWindowAttributes, ConfigureNotify, CreateCursor, CreatePixmap,
@ -33,6 +33,7 @@ use {
XkbPerClientFlags, XkbUseExtension,
},
xcon::{
Event, XEvent, Xcon, XconError,
consts::{
ATOM_STRING, ATOM_WM_CLASS, EVENT_MASK_EXPOSURE, EVENT_MASK_STRUCTURE_NOTIFY,
EVENT_MASK_VISIBILITY_CHANGE, GRAB_MODE_ASYNC, GRAB_STATUS_SUCCESS,
@ -46,7 +47,6 @@ use {
XI_EVENT_MASK_TOUCH_BEGIN, XI_EVENT_MASK_TOUCH_END, XI_EVENT_MASK_TOUCH_UPDATE,
XKB_PER_CLIENT_FLAG_DETECTABLE_AUTO_REPEAT,
},
Event, XEvent, Xcon, XconError,
},
},
jay_config::video::GfxApi,