chore: smithay update
This commit is contained in:
parent
2112e02fc9
commit
bb7a6a7113
7 changed files with 55 additions and 61 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -4732,7 +4732,7 @@ checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
|
|||
[[package]]
|
||||
name = "smithay"
|
||||
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 = [
|
||||
"aliasable",
|
||||
"appendlist",
|
||||
|
|
|
|||
|
|
@ -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" }
|
||||
|
||||
[patch.crates-io]
|
||||
smithay = { git = "https://github.com/smithay/smithay.git", rev = "aaa1966" }
|
||||
smithay = { git = "https://github.com/smithay/smithay.git", rev = "c03c373" }
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ impl State {
|
|||
gbm.clone(),
|
||||
GbmBufferFlags::RENDERING | GbmBufferFlags::SCANOUT,
|
||||
),
|
||||
GbmFramebufferExporter::new(gbm.clone(), Some(drm_node)),
|
||||
GbmFramebufferExporter::new(gbm.clone(), drm_node.into()),
|
||||
Some(gbm.clone()),
|
||||
[
|
||||
Fourcc::Abgr2101010,
|
||||
|
|
@ -692,38 +692,31 @@ impl Device {
|
|||
.map(|(crtc, surface)| (*crtc, surface.output.clone()))
|
||||
.collect::<HashMap<_, _>>();
|
||||
|
||||
self.drm.with_compositors::<Result<()>>(|map| {
|
||||
for (crtc, compositor) in map.iter() {
|
||||
let elements = match output_map.get(crtc) {
|
||||
Some(output) => output_elements(
|
||||
Some(&self.render_node),
|
||||
renderer,
|
||||
shell,
|
||||
now,
|
||||
&output,
|
||||
CursorMode::All,
|
||||
None,
|
||||
)
|
||||
.with_context(|| "Failed to render outputs")?,
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
let mut compositor = compositor.lock().unwrap();
|
||||
compositor.render_frame(
|
||||
let mut drm = self.drm.lock();
|
||||
let map = drm.compositors();
|
||||
for (crtc, compositor) in map.iter() {
|
||||
let elements = match output_map.get(crtc) {
|
||||
Some(output) => output_elements(
|
||||
Some(&self.render_node),
|
||||
renderer,
|
||||
&elements,
|
||||
CLEAR_COLOR,
|
||||
FrameFlags::empty(),
|
||||
)?;
|
||||
if let Err(err) = compositor.commit_frame() {
|
||||
if !matches!(err, FrameError::EmptyFrame) {
|
||||
return Err(err.into());
|
||||
}
|
||||
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, &elements, CLEAR_COLOR, FrameFlags::empty())?;
|
||||
if let Err(err) = compositor.commit_frame() {
|
||||
if !matches!(err, FrameError::EmptyFrame) {
|
||||
return Err(err.into());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
@ -760,27 +753,27 @@ impl Device {
|
|||
shell,
|
||||
)?;
|
||||
|
||||
self.drm.with_compositors(|comps| {
|
||||
for (crtc, comp) in comps {
|
||||
let Some(surface) = self.surfaces.get_mut(crtc) else {
|
||||
continue;
|
||||
};
|
||||
let comp = comp.lock().unwrap();
|
||||
surface.primary_plane_formats = if flag {
|
||||
comp.surface().plane_info().formats.clone()
|
||||
} else {
|
||||
// This certainly isn't perfect and might still miss the happy path,
|
||||
// but it is surprisingly difficult to hack an api into smithay,
|
||||
// to get the actual framebuffer format
|
||||
let code = comp.format();
|
||||
FormatSet::from_iter(comp.modifiers().iter().map(|mo| Format {
|
||||
code,
|
||||
modifier: *mo,
|
||||
}))
|
||||
};
|
||||
surface.feedback.clear();
|
||||
}
|
||||
});
|
||||
let mut drm = self.drm.lock();
|
||||
let maps = drm.compositors();
|
||||
for (crtc, comp) in maps {
|
||||
let Some(surface) = self.surfaces.get_mut(crtc) else {
|
||||
continue;
|
||||
};
|
||||
let comp = comp.lock().unwrap();
|
||||
surface.primary_plane_formats = if flag {
|
||||
comp.surface().plane_info().formats.clone()
|
||||
} else {
|
||||
// This certainly isn't perfect and might still miss the happy path,
|
||||
// but it is surprisingly difficult to hack an api into smithay,
|
||||
// to get the actual framebuffer format
|
||||
let code = comp.format();
|
||||
FormatSet::from_iter(comp.modifiers().iter().map(|mo| Format {
|
||||
code,
|
||||
modifier: *mo,
|
||||
}))
|
||||
};
|
||||
surface.feedback.clear();
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ impl State {
|
|||
}
|
||||
// active drm, resume leases
|
||||
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");
|
||||
}
|
||||
if let Some(lease_state) = device.leasing_global.as_mut() {
|
||||
|
|
@ -771,7 +771,7 @@ impl KmsState {
|
|||
for (crtc, surface) in device.surfaces.iter_mut() {
|
||||
let output_config = surface.output.config();
|
||||
|
||||
let drm = &mut device.drm;
|
||||
let drm = &mut device.drm.lock();
|
||||
let conn = surface.connector;
|
||||
let conn_info = drm.device().get_connector(conn, false)?;
|
||||
let mode = conn_info
|
||||
|
|
@ -956,6 +956,7 @@ impl KmsState {
|
|||
|
||||
if let Err(err) = device
|
||||
.drm
|
||||
.lock()
|
||||
.try_to_restore_modifiers(&mut renderer, &elements)
|
||||
{
|
||||
warn!(?err, "Failed to restore modifiers");
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use smithay::{
|
|||
};
|
||||
|
||||
impl DataControlHandler for State {
|
||||
fn data_control_state(&self) -> &DataControlState {
|
||||
self.common.data_control_state.as_ref().unwrap()
|
||||
fn data_control_state(&mut self) -> &mut DataControlState {
|
||||
self.common.data_control_state.as_mut().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ impl ClientDndGrabHandler for State {
|
|||
}
|
||||
impl ServerDndGrabHandler for State {}
|
||||
impl DataDeviceHandler for State {
|
||||
fn data_device_state(&self) -> &DataDeviceState {
|
||||
&self.common.data_device_state
|
||||
fn data_device_state(&mut self) -> &mut DataDeviceState {
|
||||
&mut self.common.data_device_state
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ use smithay::{
|
|||
};
|
||||
|
||||
impl PrimarySelectionHandler for State {
|
||||
fn primary_selection_state(&self) -> &PrimarySelectionState {
|
||||
&self.common.primary_selection_state
|
||||
fn primary_selection_state(&mut self) -> &mut PrimarySelectionState {
|
||||
&mut self.common.primary_selection_state
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue