Age | Commit message (Collapse) | Author |
|
The BO handle table exists to avoid double-closing a BO handle,
which aren't reference-counted by the kernel. But if we can
guarantee that there is only ever a single ref for each BO handle,
then we don't need the BO handle table anymore.
This is possible if we create the handle right before the ADDFB2
IOCTL, and close the handle right after. The handles are very
short-lived and we don't need to track their lifetime.
Because of multi-planar FBs, we need to be a bit careful: some
FB planes might share the same handle. But with a small check, it's
easy to avoid double-closing the same handle (which wouldn't be a
big deal anyways).
There's one gotcha though: drmModeSetCursor2 takes a BO handle as
input. Saving the handles until drmModeSetCursor2 time would require
us to track BO handle lifetimes, so we wouldn't be able to get rid
of the BO handle table. As a workaround, use drmModeGetFB to turn the
FB ID back to a BO handle, call drmModeSetCursor2 and then immediately
close the BO handle. The overhead should be minimal since these IOCTLs
are pretty cheap.
Closes: https://github.com/swaywm/wlroots/issues/3164
|
|
If the output is destroyed after capture_output but before
frame_handle_copy, it'll have a dangling output pointer. Add the
output destroy listener in capture_output.
Closes: https://github.com/swaywm/wlroots/issues/3284
|
|
This is only called from one function.
To destroy the wlr_scene_subsurface_tree from elsewhere, callers
can destroy the scene-graph node returned by
wlr_scene_subsurface_tree_create instead (just like a compositor
would do). subsurface_tree_handle_surface_destroy does exactly this.
Inlining avoids calling subsurface_tree_destroy by mistake.
|
|
Found via scan-build
|
|
calloc is moved to right before egl is called to avoid requiring to free()
unused memory.
Found via scan-build
|
|
Found via scan-build
|
|
Since libinput is an optional dependency the libinput backend is possibly undeclared.
wlr_backend_destroy(backend) below will clean up the child libinput backend if any.
|
|
|
|
As found in e.g. the Steam Deck.
|
|
|
|
This can happen if the compositor enables an output without
picking a mode, or performs a modeset with a zero width/height.
|
|
A wayland-protocols patch [1] has added error codes for invalid
surfaces.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/57
Closes: https://github.com/swaywm/wlroots/issues/2600
|
|
This organizes the wlr_output implementation into separate files.
This avoids having a single mega-file with lots of unrelated parts
and makes it more obvious what the interactions between all the
parts are.
No functional changes, just moving code around.
|
|
Check if only a single node intersects with the output viewport
and all of its properties match. In this case, attempt direct
scan-out.
|
|
This allows compositors to more easily implement sending
wl_surface.frame callback done events.
|
|
|
|
|
|
|
|
|
|
There's no pkg-config file we can check for sadly, so check
vulkan/vulkan.h as a fallback.
Closes: https://github.com/swaywm/wlroots/issues/3272
|
|
|
|
Signed-off-by: Joshua Ashton <joshua@froggi.es>
|
|
This commit adds two error-handling cases to the function
attempt_dmr_backend. Specifically:
- In the case where the number of found GPUs is zero, we now
print a log message indicating this and return a NULL pointer
- In the case where we could not successfully create a backend
on any GPU, we now log a message indicating this and return
a NULL pointer
This allows us to provide more descriptive error messages,
as well as avoid a SEGFAULT (the function
`ensure_primary_backend_renderer_and_allocator` dereferences the pointer
given, which could be NULL until this patch) when these cases arise.
|
|
This new renderer is implemented with the existing wlr_renderer API
(which is known to be sub-optimal for some operations). It's not
used by default, but users can opt-in by setting WLR_RENDERER=vulkan.
The renderer depends on VK_EXT_image_drm_format_modifier and
VK_EXT_physical_device_drm.
Co-authored-by: Simon Ser <contact@emersion.fr>
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
|
|
|
|
|
|
|
|
This allows us to obtain a new DRM file description without relying
on filesystem permissions.
|
|
These are very common operations for compositors (including tinywl)
to perform.
|
|
Currently these functions remove the node from the scene if the sibling
argument is the same node as the node. To prevent confusion when
misusing this API, assert that the nodes are distinct and document this.
|
|
|
|
The same logic/motivation as xdg-toplevel.
|
|
This will allow compositor to access the current buffer before
unmapping.
|
|
This is already checked in role precommit handler, and if the buffer is
NULL due to failed upload, that means the surface was already unmapped.
|
|
After 70fb21c35ba4 made libinput optional the include prevents
building without libinput package installed.
backend/backend.c:4:10: fatal error: 'libinput.h' file not found
#include <libinput.h>
^~~~~~~~~~~~
|
|
If we aren't trying to create a dumb buffer allocator, and if the
DRM device has a render node (ie, not a split render/display SoC),
then we can use the render node instead of the primary node. This
should allow wlroots to run under seatd when the current user
doesn't have the permission to open primary nodes (logind has a
quirk to allow physically logged in users to open primary nodes).
|
|
|
|
These functions are used mostly for rendering, where including unmapped
surfaces is undesired.
This is a breaking change. However, few to no usages will have to be
updated.
|
|
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
|
|
This reverts commit 833437d5921339f2862ccfb0493617630ea3937d.
|
|
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
|
|
This reverts commit d6be1d68b7d0542efa4dc2d19d57531484fe330a.
|
|
This reverts commit 780052d4da0c93f9210dd87d2100b116af7ff308.
|
|
This reverts commit 6d281d96cb93b8de972039d5cb00bfce49d9a58c.
|
|
This was used to make the intersection of INVALID and LINEAR result
in LINEAR. We can now just require LINEAR to be in both lists.
|
|
|
|
drmModeAddFB2 doesn't support explicit modifiers. Only accept INVALID
which indicates an implicit modifier and LINEAR which may indicate
that GBM_BO_USE_LINEAR has been used.
|
|
See [1] for the motivation.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
|
|
|
|
The protocol doesn't say we should, so let's not.
Also it's pointless to reset scheduled_serial, since 0 is a valid
serial.
|