feat(wayland): set output refreshrate to i32::MAX and instrument a bunch of functions

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-07-15 22:15:15 +02:00
parent 81a741ad36
commit 0b4c7edc92
10 changed files with 162 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ pub struct ShmPool {
}
impl ShmPool {
#[tracing::instrument("debug", skip_all)]
pub fn new(fd: OwnedFd, size: i32) -> Result<Self> {
let map = unsafe {
MmapOptions::new()
@@ -30,6 +31,7 @@ impl ShmPool {
})
}
#[tracing::instrument("debug", skip_all)]
pub fn data_lock(&self) -> MappedMutexGuard<RawMutex, [u8]> {
MutexGuard::map(self.inner.lock(), |i| i.as_mut())
}
@@ -37,6 +39,7 @@ impl ShmPool {
impl WlShmPool for ShmPool {
/// https://wayland.app/protocols/wayland#wl_shm_pool:request:create_buffer
#[tracing::instrument("debug", skip_all)]
async fn create_buffer(
&self,
client: &mut Client,
@@ -61,6 +64,7 @@ impl WlShmPool for ShmPool {
}
/// https://wayland.app/protocols/wayland#wl_shm_pool:request:resize
#[tracing::instrument("debug", skip_all)]
async fn resize(&self, _client: &mut Client, _sender_id: ObjectId, size: i32) -> Result<()> {
let mut inner = self.inner.lock();
unsafe { inner.remap(size as usize, RemapOptions::new().may_move(true))? };
@@ -68,6 +72,7 @@ impl WlShmPool for ShmPool {
}
/// https://wayland.app/protocols/wayland#wl_shm_pool:request:destroy
#[tracing::instrument("debug", skip_all)]
async fn destroy(&self, _client: &mut Client, _sender_id: ObjectId) -> Result<()> {
Ok(())
}