Age | Commit message (Collapse) | Author |
|
Previously, we were copying wlr_output_state on the stack and
patching it up to be guaranteed to have a proper drmModeModeInfo
stored in it (and not a custom mode). Also, we had a bunch of
helpers deriving DRM-specific information from the generic
wlr_output_state.
Copying the wlr_output_state worked fine so far, but with output
layers we'll be getting a wl_list in there. An empty wl_list stores
two pointers to itself, copying it on the stack blindly results in
infinite loops in wl_list_for_each.
To fix this, rework our DRM backend to stop copying wlr_output_state,
instead add a new struct wlr_drm_connector_state which holds both
the wlr_output_state and additional DRM-specific information.
|
|
"state" is easily confused with wlr_output_state.
|
|
Fixes: ba0525c5c08b ("surface: drop wlr_surface_state.buffer_resource")
Closes: https://github.com/swaywm/wlroots/issues/3173
|
|
Instead, use wlr_surface_state.buffer only.
|
|
When surface_state_move processes a NULL commit, make sure to
reset state->buffer to NULL instead of leaving behind an old
wlr_buffer.
|
|
This is an internal struct.
|
|
|
|
We always return the same wlr_client_buffer as the one passed in,
so no need to return anything.
|
|
Instead of taking a wl_resource as argument, take a wlr_buffer.
|
|
|
|
|
|
This makes the naming consistent with other resource implementations.
|
|
|
|
Move the wlr_subsurface parent link to the subsurface state.
This is a dumb find/replace operation. This shouldn't result in
any behavior change.
|
|
Add a comment to explain the difference.
|
|
Caching frame callback lists is actually the correct behavior, because
if a surface is locked because of e.g. subsurface synchronization,
clients would expect to receive frame done events only after the
pending state is actually committed.
|
|
We can just send a read-only file descriptor instead.
|
|
This exposes a read-only FD with the keymap.
|
|
This function behaves like allocate_shm_file, except it also
returns a read-only FD. This is useful to share the same segment
of memory with many Wayland clients.
|
|
Makes it easier to find out which branch is taken when debugging
issues like [1].
[1]: https://github.com/swaywm/wlroots/issues/3156
|
|
drm_surface_blit returns NULL on error. This can happen e.g. when
the source buffer cannot be imported into EGL.
Closes: https://github.com/swaywm/wlroots/issues/3154
|
|
Closes: https://github.com/swaywm/wlroots/issues/3156
|
|
|
|
Add RECT nodes to the scene-graph demo to illustrate how they are used.
Here, we add a solid rectangle behind each surface as a quick-and-dirty
border, handling surface.commit in order to size it appropriately.
|
|
With the addition of a non-surface node type, it was unclear how such
nodes should interact with scene_node_surface_at(). For example, if the
topmost node at the given point is a RECT, should the function treat
that node as transparent and continue searching, or as opaque and return
(probably) NULL?
Instead, replace the function with one returning a scene_node, which
will allow for more consistent behavior across different node types.
Compositors can downcast scene_surface nodes via the now-public
wlr_scene_surface_from_node() if they need access to the surface itself.
|
|
RECT is a solid-colored rectangle, useful for simple borders or other
decoration. This can be rendered directly using the wlr_renderer,
without needing to create a surface.
|
|
This will allow us to create node types which are rendered but not
surface-based, such as a solid color or image.
|
|
Commits named "Fix #XXX" make it pretty complicated to figure out
exactly what the commit is doing from the shortlog. A better place
for issue references is in the extended commit message.
|
|
Depends on [1].
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/84
|
|
|
|
Fixes: d9d8fc1ab9b7 ("render/allocator: re-open GBM FD")
|
|
Using the same DRM file description for the DRM backend and for the
GBM allocator will result in GEM handle ref'counting issues [1].
Re-open the DRM FD to fix these issues.
[1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
|
|
gamja offers a better experience than Kiwi.
|
|
For consistency with the rest of the scene-graph API, prevent detaching
a subtree by giving NULL for the new parent, and don't allow ROOT nodes
to be grafted into another tree.
|
|
|
|
|
|
If nodes are arranged in a tree rather than at a single level, then it
makes sense that there should be a way to move them to a completely
different parent in addition to moving up or down among siblings.
|
|
|
|
HTTPS URLs aren't writable.
|
|
This avoids cluttering the prose with URLs.
|
|
This is shamelessly stolen from Weston [1].
It's been a while we've transitioned away from merge commits and
work-style commit history, so it'd be nice to mention this in the
docs.
[1]: https://gitlab.freedesktop.org/wayland/weston/-/blob/main/CONTRIBUTING.md#formatting-and-separating-commits
|
|
Currently, upon activating a surface, wlroots restacks it on top of all
others.
This may not necessarily be correct from the calling compositor's point
of view, where having focus may not imply being top-of-stack (e.g.,
focusing a window under an always-on-top window).
In Sway's case, this means that focused tiling windows will always be on
top of floating windows, at least in the order communicated to X11 apps.
This breaks drag-and-drop from a focused tiling X11 window to a floating
X11 window which partially obscures the former.
This is a breaking change; to retain the previous behavior, users that
were calling
wlr_xwayland_surface_activate(xsurface, true);
should now be calling
wlr_xwayland_surface_activate(xsurface, true);
wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE);
|
|
|
|
This allows compositors to attach arbitrary data to the scene-graph
nodes.
|
|
For instance, allow a surface node to be a child of another surface
node. This allows easier xdg-popup handling in compositors.
|
|
This allows compositors to easily enable or disable a scene-graph node.
This can be used to show/hide a surface when the xdg_surface is
mapped/unmapped.
|
|
|
|
A new wlr_scene API has been added, following the design ideas from [1].
The new API contains the minimal set of features required to make the
API useful. The goal is to design a solid fundation and add more
features in the future.
[1]: https://github.com/swaywm/wlroots/issues/1826#issuecomment-564601757
|
|
|
|
Using GBM to import DRM dumb buffers tends to not work well. By
using GBM we're calling some driver-specific functions in Mesa.
These functions check whether Mesa can work with the buffer.
Sometimes Mesa has requirements which differ from DRM dumb buffers
and the GBM import will fail (e.g. on amdgpu).
Instead, drop GBM and use drmPrimeFDToHandle directly. But there's
a twist: BO handles are not ref'counted by the kernel and need to
be ref'counted in user-space [1]. libdrm usually performs this
bookkeeping and is used under-the-hood by Mesa.
We can't re-use libdrm for this task without using driver-specific
APIs. So let's just re-implement the ref'counting logic in wlroots.
The wlroots implementation is inspired from amdgpu's in libdrm [2].
Closes: https://github.com/swaywm/wlroots/issues/2916
[1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
[2]: https://gitlab.freedesktop.org/mesa/drm/-/blob/1a4c0ec9aea13211997f982715fe5ffcf19dd067/amdgpu/handle_table.c
|