chore: smithay update

This commit is contained in:
Victoria Brekenfeld 2025-07-16 21:12:02 +02:00 committed by Victoria Brekenfeld
parent 2112e02fc9
commit bb7a6a7113
7 changed files with 55 additions and 61 deletions

2
Cargo.lock generated
View file

@ -4732,7 +4732,7 @@ checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
[[package]] [[package]]
name = "smithay" name = "smithay"
version = "0.7.0" version = "0.7.0"
source = "git+https://github.com/smithay/smithay.git?rev=aaa1966#aaa19668d31cbc9d73561dc0ea8423fc41574d6c" source = "git+https://github.com/smithay/smithay.git?rev=c03c373#c03c373e351243168a24dea695ba3e603c04392b"
dependencies = [ dependencies = [
"aliasable", "aliasable",
"appendlist", "appendlist",

View file

@ -124,4 +124,4 @@ cosmic-protocols = { git = "https://github.com/pop-os//cosmic-protocols", branch
cosmic-client-toolkit = { git = "https://github.com/pop-os//cosmic-protocols", branch = "main" } cosmic-client-toolkit = { git = "https://github.com/pop-os//cosmic-protocols", branch = "main" }
[patch.crates-io] [patch.crates-io]
smithay = { git = "https://github.com/smithay/smithay.git", rev = "aaa1966" } smithay = { git = "https://github.com/smithay/smithay.git", rev = "c03c373" }

View file

@ -264,7 +264,7 @@ impl State {
gbm.clone(), gbm.clone(),
GbmBufferFlags::RENDERING | GbmBufferFlags::SCANOUT, GbmBufferFlags::RENDERING | GbmBufferFlags::SCANOUT,
), ),
GbmFramebufferExporter::new(gbm.clone(), Some(drm_node)), GbmFramebufferExporter::new(gbm.clone(), drm_node.into()),
Some(gbm.clone()), Some(gbm.clone()),
[ [
Fourcc::Abgr2101010, Fourcc::Abgr2101010,
@ -692,38 +692,31 @@ impl Device {
.map(|(crtc, surface)| (*crtc, surface.output.clone())) .map(|(crtc, surface)| (*crtc, surface.output.clone()))
.collect::<HashMap<_, _>>(); .collect::<HashMap<_, _>>();
self.drm.with_compositors::<Result<()>>(|map| { let mut drm = self.drm.lock();
for (crtc, compositor) in map.iter() { let map = drm.compositors();
let elements = match output_map.get(crtc) { for (crtc, compositor) in map.iter() {
Some(output) => output_elements( let elements = match output_map.get(crtc) {
Some(&self.render_node), Some(output) => output_elements(
renderer, Some(&self.render_node),
shell,
now,
&output,
CursorMode::All,
None,
)
.with_context(|| "Failed to render outputs")?,
None => Vec::new(),
};
let mut compositor = compositor.lock().unwrap();
compositor.render_frame(
renderer, renderer,
&elements, shell,
CLEAR_COLOR, now,
FrameFlags::empty(), &output,
)?; CursorMode::All,
if let Err(err) = compositor.commit_frame() { None,
if !matches!(err, FrameError::EmptyFrame) { )
return Err(err.into()); .with_context(|| "Failed to render outputs")?,
} None => Vec::new(),
};
let mut compositor = compositor.lock().unwrap();
compositor.render_frame(renderer, &elements, CLEAR_COLOR, FrameFlags::empty())?;
if let Err(err) = compositor.commit_frame() {
if !matches!(err, FrameError::EmptyFrame) {
return Err(err.into());
} }
} }
}
Ok(())
})?;
} }
Ok(()) Ok(())
@ -760,27 +753,27 @@ impl Device {
shell, shell,
)?; )?;
self.drm.with_compositors(|comps| { let mut drm = self.drm.lock();
for (crtc, comp) in comps { let maps = drm.compositors();
let Some(surface) = self.surfaces.get_mut(crtc) else { for (crtc, comp) in maps {
continue; let Some(surface) = self.surfaces.get_mut(crtc) else {
}; continue;
let comp = comp.lock().unwrap(); };
surface.primary_plane_formats = if flag { let comp = comp.lock().unwrap();
comp.surface().plane_info().formats.clone() surface.primary_plane_formats = if flag {
} else { comp.surface().plane_info().formats.clone()
// This certainly isn't perfect and might still miss the happy path, } else {
// but it is surprisingly difficult to hack an api into smithay, // This certainly isn't perfect and might still miss the happy path,
// to get the actual framebuffer format // but it is surprisingly difficult to hack an api into smithay,
let code = comp.format(); // to get the actual framebuffer format
FormatSet::from_iter(comp.modifiers().iter().map(|mo| Format { let code = comp.format();
code, FormatSet::from_iter(comp.modifiers().iter().map(|mo| Format {
modifier: *mo, code,
})) modifier: *mo,
}; }))
surface.feedback.clear(); };
} surface.feedback.clear();
}); }
Ok(()) Ok(())
} }

View file

@ -310,7 +310,7 @@ impl State {
} }
// active drm, resume leases // active drm, resume leases
for device in backend.drm_devices.values_mut() { for device in backend.drm_devices.values_mut() {
if let Err(err) = device.drm.activate(true) { if let Err(err) = device.drm.lock().activate(true) {
error!(?err, "Failed to resume drm device"); error!(?err, "Failed to resume drm device");
} }
if let Some(lease_state) = device.leasing_global.as_mut() { if let Some(lease_state) = device.leasing_global.as_mut() {
@ -771,7 +771,7 @@ impl KmsState {
for (crtc, surface) in device.surfaces.iter_mut() { for (crtc, surface) in device.surfaces.iter_mut() {
let output_config = surface.output.config(); let output_config = surface.output.config();
let drm = &mut device.drm; let drm = &mut device.drm.lock();
let conn = surface.connector; let conn = surface.connector;
let conn_info = drm.device().get_connector(conn, false)?; let conn_info = drm.device().get_connector(conn, false)?;
let mode = conn_info let mode = conn_info
@ -956,6 +956,7 @@ impl KmsState {
if let Err(err) = device if let Err(err) = device
.drm .drm
.lock()
.try_to_restore_modifiers(&mut renderer, &elements) .try_to_restore_modifiers(&mut renderer, &elements)
{ {
warn!(?err, "Failed to restore modifiers"); warn!(?err, "Failed to restore modifiers");

View file

@ -7,8 +7,8 @@ use smithay::{
}; };
impl DataControlHandler for State { impl DataControlHandler for State {
fn data_control_state(&self) -> &DataControlState { fn data_control_state(&mut self) -> &mut DataControlState {
self.common.data_control_state.as_ref().unwrap() self.common.data_control_state.as_mut().unwrap()
} }
} }

View file

@ -103,8 +103,8 @@ impl ClientDndGrabHandler for State {
} }
impl ServerDndGrabHandler for State {} impl ServerDndGrabHandler for State {}
impl DataDeviceHandler for State { impl DataDeviceHandler for State {
fn data_device_state(&self) -> &DataDeviceState { fn data_device_state(&mut self) -> &mut DataDeviceState {
&self.common.data_device_state &mut self.common.data_device_state
} }
} }

View file

@ -7,8 +7,8 @@ use smithay::{
}; };
impl PrimarySelectionHandler for State { impl PrimarySelectionHandler for State {
fn primary_selection_state(&self) -> &PrimarySelectionState { fn primary_selection_state(&mut self) -> &mut PrimarySelectionState {
&self.common.primary_selection_state &mut self.common.primary_selection_state
} }
} }