Giter Club home page Giter Club logo

gbm.rs's Introduction

Smithay

Crates.io docs.rs Build Status Join the chat on matrix at #smithay:matrix.org Join the chat via bridge on #smithay on libera.chat

A smithy for rusty wayland compositors

Goals

Smithay aims to provide building blocks to create wayland compositors in Rust. While not being a full-blown compositor, it'll provide objects and interfaces implementing common functionalities that pretty much any compositor will need, in a generic fashion.

It supports the core Wayland protocols, the official protocol extensions, and some external extensions, such as those made by and for wlroots and KDE

Also:

  • Documented: Smithay strives to maintain a clear and detailed documentation of its API and its functionalities. Compiled documentations are available on docs.rs for released versions, and here for the master branch.
  • Safety: Smithay will target to be safe to use, because Rust.
  • Modularity: Smithay is not a framework, and will not be constraining. If there is a part you don't want to use, you should not be forced to use it.
  • High-level: You should be able to not have to worry about gory low-level stuff (but Smithay won't stop you if you really want to dive into it).

Anvil

Smithay as a compositor library has its own sample compositor: anvil.

To get informations about it and how you can run it visit anvil README

Other compositors that use Smithay

  • Cosmic: Next generation Cosmic desktop environment
  • Catacomb: A Wayland Mobile Compositor
  • MagmaWM: A versatile and customizable Wayland Compositor
  • Niri: A scrollable-tiling Wayland compositor
  • Strata: A cutting-edge, robust and sleek Wayland compositor
  • Pinnacle: A WIP Wayland compositor, inspired by AwesomeWM
  • Sudbury: Compositor designed for ChromeOS
  • wprs: Like xpra, but for Wayland, and written in Rust.

System Dependencies

(This list can depend on features you enable)

  • libwayland
  • libxkbcommon
  • libudev
  • libinput
  • libgbm
  • libseat
  • xwayland

Contact us

If you have questions or want to discuss the project with us, our main chatroom is on Matrix: #smithay:matrix.org.

gbm.rs's People

Contributors

cmeissl avatar dextero avatar drakulix avatar elinorbgr avatar ids1024 avatar intrepidpig avatar katyo avatar marijns95 avatar polymeilex avatar tronical avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gbm.rs's Issues

Segmentation Fault when gbm device doesn't outlive gbm buffer object

$ uname -a
Linux ayrtonslaptop 6.3.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 14 Jun 2023 20:10:31 +0000 x86_64 GNU/Linux

ffi: Ptr::<ffi::gbm_bo>::new(ffi, |ptr| ffi::gbm_bo_destroy(ptr)),

Is causing a segmentation fault on my system when the gbm::Device is dropped before the buffer object. I'm not using any unsafe code so I don't think this should be allowed to happen.

Let me know if you need any more details.

Why does mapping require a function?

Why does mapping require a function to be passed instead of mapping then unmapping on drop?

gbm.rs/src/buffer_object.rs

Lines 299 to 310 in 8fd2021

pub fn map<'a, D, F, S>(
&'a self,
device: &Device<D>,
x: u32,
y: u32,
width: u32,
height: u32,
f: F,
) -> Result<IoResult<S>, WrongDeviceError>
where
D: AsFd + 'static,
F: FnOnce(&MappedBufferObject<'a, T>) -> S,

[Question] Minimal example with drm-rs(dev) and gbm.rs

I want to use code in dev branch of drm-rs (which seems to be far ahead from master) with gbm.rs lib. It should be pretty straightforward I beleive (given that the draft already exists on gmb page), but just in case: is there any example that already does this?

`Surface::lock_front_buffer` fails when `ffi::gbm_surface_lock_front_buffer` succeeds

I'm trying to use gbm.rs on an i.mx 8 series device with a Vivante GPU and corresponding drivers (6.4.3.p4.4). These come now with DRM support and a GBM backend (libgbm_viv.so).

C/C++ based programs like Weston, kmscube, mutter, or Qt's eglfs renderer work perfectly well on the device, but I noticed that using gbm.rs always fails in one spot:

Surface::lock_front_buffer() works the first time it is called, but the second time it is called it always fails. I tracked it down to the call to gbm_surface_has_free_buffers failing.

I noticed that the above mentioned never call gbm_surface_has_free_buffers before calling gbm_surface_lock_front_buffer but go straight to gbm_surface_lock_front_buffer and check the return value.

If I change gbm.rs to do the same, i.e. omit the explicit call to gbm_surface_has_free_buffers, everything works expected (acquisition of buffers from the surface, rendering into it, posting, waiting for page flip event, etc.).

My feeling is that that has_free_buffers should return true (so this might be a driver bug), but it's hard to find exact document semantics, and it's strange that nobody else is calling it.

I'd be happy to make a PR to remove the call (and enum variant), but I wanted to check with you first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.