aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-07backend/x11: remove swapchainSimon Ser
Rely on wlr_output's generic swapchain handling. We still need a renderer for cursor readback, sadly.
2021-06-07backend/x11: implement get_dmabuf_primary_formatsSimon Ser
2021-06-07backend/headless: remove swapchainSimon Ser
Rely on wlr_output's generic swapchain support instead of creating our own. The headless output now simply keeps a reference to the front buffer and does nothing else.
2021-06-07output: make attach_render and rollback_render optionalSimon Ser
If these aren't provided by the backend, allocate a swapchain for the output.
2021-06-07output: split output_pick_cursor_formatSimon Ser
Introduce output_pick_format that can be re-used for the primary buffer too.
2021-06-07output: add get_primary_formats to interfaceSimon Ser
This function returns the set of formats the backend can use for the primary buffer. It can be used to allocate a buffer suitable for scan-out.
2021-06-07buffer: use wlr_texture_from_buffer for wl_shm_bufferSimon Ser
2021-06-07buffer: introduce wlr_shm_client_bufferSimon Ser
Introduce wlr_shm_client_buffer, which provides a wlr_buffer wrapper around wl_shm_buffer. Because the client can destroy the wl_buffer while we still are using it, we need to do some libwayland tricks to still be able to continue accessing its underlying storage. We need to reference the wl_shm_pool and save the data pointer.
2021-06-07render/pixman: implement texture_from_bufferSimon Ser
2021-06-07render/gles2: add support for DATA_PTR buffers in texture_from_bufferSimon Ser
2021-06-07buffer: replace get_data_ptr with {begin,end}_data_ptr_accessSimon Ser
This new API allows buffer implementations to know when a user is actively accessing the buffer's underlying storage. This is important for the upcoming client-backed wlr_buffer implementation.
2021-06-03surface: allow placing subsurfaces below parentSimon Ser
Prior to this commit, subsurfaces could only be placed above their parent. Any place_{above,below} request involving the parent would fail with a protocol error. However the Wayland protocol allows using the parent surface in the place_{above,below} requests, and allows subsurfaces to be placed below their parent. Weston's implementation adds a dummy wl_list node in the subsurface list. However this is potentially dangerous: iterating the list requires making sure the dummy wl_list node is checked for, otherwise memory corruption will happen. Instead, split the list in two: one for subsurfaces above the parent, the other for subsurfaces below. Tested with wleird's subsurfaces demo client. Closes: https://github.com/swaywm/wlroots/issues/1865
2021-06-03Make the xdg_popup_get_position to publiczccrs
Rename the xdg_popup_get_position to wlr_xdg_popup_get_position
2021-06-02xdg-activation-v1: add token timeoutSimon Ser
There isn't always a good time to prune old tokens. Compositors which only implement a "give focus on activation" logic can prune tokens on focus change. However other compositors might want to implement other semantics, e.g. "mark urgent on activation". In this case a focus change shouldn't invalidate other tokens. Additionally, some tokens aren't necessarily tied to a seat. To avoid ending up with an ever-growing list of tokens, add a timeout.
2021-06-02xdg-activation-v1: new protocol implementationSimon Ser
This implements the new xdg-activation-v1 protocol [1]. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/50
2021-06-02backend/drm: move cursor fields to wlr_drm_connectorSimon Ser
Doesn't make a lot of sense to split the cursor fields between wlr_drm_plane and wlr_drm_connector. Let's just move everything to wlr_drm_connector.
2021-06-02output: take a wlr_buffer in set_cursorSimon Ser
Instead of passing a wlr_texture to the backend, directly pass a wlr_buffer. Use get_cursor_size and get_cursor_formats to create a wlr_buffer that can be used as a cursor. We don't want to pass a wlr_texture because we want to remove as many rendering bits from the backend as possible.
2021-06-02backend/drm: introduce drm_plane_pick_render_formatSimon Ser
This is a new helper function to pick a render format suitable for a plane. The next commit will use it to initialize the cursor multi-GPU surface.
2021-06-02backend/drm: remove format arg from drm_plane_init_surfaceSimon Ser
This was always set to ARGB8888.
2021-06-02backend/drm: implement get_cursor_formats and get_cursor_sizeSimon Ser
2021-06-02backend/wayland: implement get_cursor_formatsSimon Ser
2021-06-02output: add get_cursor_formats and get_cursor_size to interfaceSimon Ser
2021-06-01render: add wlr_renderer_begin_with_bufferSimon Ser
This allows compositors to choose a wlr_buffer to render to. This is a less awkward interface than having to call bind_buffer() before and after begin() and end(). Closes: https://github.com/swaywm/wlroots/issues/2618
2021-06-01render: disallow wlr_renderer_destroy while renderingSimon Ser
This probably already felt apart, but let's make it explicit that this is not allowed.
2021-05-31backend: stop using renderer to get the buffer typeSimon Ser
When picking a format, the backend needs to know whether the buffers allocated by the allocator will be DMA-BUFs or shared memory. So far, the backend used the renderer's supported buffer types to guess this information. This is pretty fragile: renderers in general don't care about the SHM cap (they only care about the DATA_PTR one). Additionally, nothing stops a renderer from supporting both DMA-BUFs and shared memory, but this would break the backend's guess. Instead, use wlr_allocator.buffer_caps. This is more reliable since the buffers created with the allocator are guaranteed to have these caps.
2021-05-31render/allocator: add wlr_allocator.buffer_capsSimon Ser
This allows users to know the capabilities of the buffers that will be allocated. The buffer capability is important to know when negotiating buffer formats.
2021-05-31render/drm_dumb_allocator: check for DRM masterSimon Ser
If we aren't the DRM master, allocating dumb buffers will fail with EPERM.
2021-05-31xwm: prevent X11 clients from blowing our stack by opening too many windowsTudor Brindus
Allocate window arrays for list property updates on the heap instead.
2021-05-31xwm: implement _NET_CLIENT_LIST_STACKINGTudor Brindus
This property is present on all modern X11 instances. The nonpresence of it requires applications to fall back to XQueryTree-based logic to determine stacking logic (e.g., to determine what surface should get Xdnd events). These code paths are effectively untested nowadays, so this makes it more likely for wlroots to "break" applications. For instance, the XQueryTree fallback path has been broken in Chromium for the last 10 years. It's easy enough to maintain this property, so let's just do it. Fixes #2889.
2021-05-31xwm: use correct list link when iterating over `unpaired_surfaces`Tudor Brindus
2021-05-30render/gles2: fix texture cleanup on destroySimon Ser
When importing a DMA-BUF wlr_buffer as a wlr_texture, the GLES2 renderer caches the result, in case the buffer is used for texturing again in the future. When the wlr_texture is destroyed by the caller, the wlr_buffer is unref'ed, but the wlr_gles2_texture is kept around. This is fine because wlr_gles2_texture listens for wlr_buffer's destroy event to avoid any use-after-free. However, with this logic wlr_texture_destroy doesn't "really" destroy the wlr_gles2_texture. It just decrements the wlr_buffer ref'count. Each wlr_texture_destroy call must have a matching prior wlr_texture_create_from_buffer call or the ref'counting will go south. Wehn destroying the renderer, we don't want to decrement any wlr_buffer ref'count. Instead, we want to go through any cached wlr_gles2_texture and destroy our GL state. So instead of calling wlr_texture_destroy, we need to call our internal gles2_texture_destroy function. Closes: https://github.com/swaywm/wlroots/issues/2941
2021-05-26contributing: add link to IRC web chatSimon Ser
2021-05-26readme: fix broken IRC web client linkSimon Ser
Previous commit has tweaked the link name.
2021-05-26readme: add link to IRC web clientSimon Ser
2021-05-24Update IRC linksSimon Zeni
2021-05-22Flush events in virtual pointer exampleBrian McKenna
2021-05-21backend/x11: use common renderer and allocatorSimon Ser
Instead of managing our own renderer and allocator, let the common code do it.
2021-05-21backend/headless: use common renderer and allocatorSimon Ser
Instead of managing our own renderer and allocator, let the common code do it. Because wlr_headless_backend_create_with_renderer needs to re-use the parent renderer, we have to hand-roll some of the renderer initialization.
2021-05-21backend/wayland: use common renderer and allocatorSimon Ser
Instead of managing our own renderer and allocator, let the common code do it.
2021-05-21backend: automatically create allocatorSimon Ser
Introduce a new backend_get_allocator function that automatically creates an allocator for the backend if the backend has a renderer.
2021-05-21backend: automatically create rendererSimon Ser
If a backend accepts buffers (as indicated by get_buffer_caps) but doesn't implement get_renderer, automatically create a renderer.
2021-05-21backend: introduce wlr_backend_finishSimon Ser
This new functions cleans up the common backend state. While this currently only emits the destroy signal, this will also clean up the renderer and allocator in upcoming patches.
2021-05-19render: relax stride check in wlr_texture_from_pixelsSimon Ser
Some formats have a byte-per-pixel lower than 1. Let's not encode an arbitrary limitation into the wlr_renderer API.
2021-05-19render/pixman: avoid sqrt() in render_quad without rotationSimon Ser
When the matrix doesn't have a rotation, we can avoid a sqrt() call. Tested with Sway's tabbed containers.
2021-05-19render/gbm_allocator: add support for gbm_bo_get_fd_for_planeSimon Ser
See [1]. This allows us to remove the workaround for GBM API limitations. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5442
2021-05-17backend/drm: use wlr_texture_from_bufferSimon Ser
2021-05-17screencopy-v1: stop using wlr_client_bufferSimon Ser
We can just use the wlr_dmabuf_v1_buffer directly, no need to wrap it in a wlr_client_buffer.
2021-05-17buffer: use wlr_texture_from_buffer for DMA-BUFsSimon Ser
2021-05-17render/gles2: implement texture_from_bufferSimon Ser
Make it so wlr_gles2_texture is ref'counted (via wlr_buffer). This is similar to wlr_gles2_buffer or wlr_drm_fb work. When creating a wlr_texture from a wlr_buffer, first check if we already have a texture for the buffer. If so, increase the wlr_buffer ref'count and make sure any changes made by an external process are made visible (by invalidating the texture). When destroying a wlr_texture created from a wlr_buffer, decrease the ref'count, but keep the wlr_texture around in case the caller uses it again. When the wlr_buffer is destroyed, cleanup the wlr_texture.
2021-05-17render: introduce wlr_texture_from_bufferSimon Ser
This adds a a function to create a wlr_texture from a wlr_buffer. The main motivation for this is to allow the renderer to create a single wlr_texture per wlr_buffer. This can avoid needless imports by re-using existing textures.