Age | Commit message (Collapse) | Author |
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3181
|
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3183
|
|
This will allow the DRM backend to reload its lessee list.
|
|
Most (and possibly all) compositors using wlroots only ever render
fully opaque content. To provide better performance, this change
switches the default format used by wlr_output buffers from
ARGB8888 to the opaque XRGB8888.
Compositors like mutter, kwin, and weston already default to
XRGB8888, so this change is unlikely to expose any new bugs in
underlying drivers and hardware.
This does not affect the hardware cursor's buffer format, which is
still ARGB8888 by default.
As part of this change, the X11 backend (which does not support
changing format at runtime) now picks a true color, 24 bit depth
visual (i.e. XRGB8888) instead of a 32 bit depth (ARGB8888) one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
They are never used in practice, which makes all of our flag
handling effectively dead code. Also, APIs such as KMS don't
provide a good way to deal with the flags. Let's just fail the
DMA-BUF import when clients provide flags.
|
|
Removing an input device requires unlinking it from the list of all headless
input devices. For that implement a destroy function.
|
|
When a connector ID is specified in a hotplug event, don't scan all
connectors. Only scan the connector that has changed.
|
|
This struct contains additional information for session device
change events, such as the DRM connector ID that has changed.
|
|
|
|
drmModeCreatePropertyBlob cannot create zero-sized blobs, that
fails with EINVAL.
Closes: https://github.com/swaywm/wlroots/issues/3297
|
|
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
|
|
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 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.
|
|
|
|
|
|
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>
^~~~~~~~~~~~
|
|
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
|
|
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
|
|
This reverts commit d6be1d68b7d0542efa4dc2d19d57531484fe330a.
|
|
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
|
|
Instead of ensuring the renderer and allocator are initialized in each
backend, do it in wlr_backend_autocreate. This allows compositors to
create backends without any renderer/allocator if they side-step
wlr_backend_autocreate.
Since the wlr_backend_get_renderer and backend_get_allocator end up
calling wlr_renderer_autocreate and wlr_allocator_autocreate, it sounds
like a good idea to centralize all of the opimionated bits in one place.
|
|
Receive hold gesture events using a Wayland listiner and emit the
appropiate wlr_pointer signal.
|
|
Receive hold gesture events from libinput and emit the appropiate
wlr_pointer signal.
|
|
Add a project argument (LIBINPUT_HAS_HOLD_GESTURES) to allow building
against old versions of libinput.
|
|
Expose the panel orientation with wlr_drm_connector_get_panel_orientation.
Leave it to the compositor to consume this information and configure the
output accordingly.
Closes: https://github.com/swaywm/wlroots/issues/1581
|
|
|
|
|
|
Previously used by attempt_enable_needs_modeset, but this has been
dropped in the previous commit.
|
|
Modesets require a buffer. The DRM backend tried to auto-enable
outputs when a CRTC becomes available in the past, but now that
fails because no buffer is available.
Instead of having this magic inside the DRM backend, a better
approach is to do it in the compositor or in an optional helper.
|
|
|
|
drm_connector_set_pending_fb already takes care of this.
|
|
Constify drmModeConnector while at it.
|
|
Don't set the MODE flag when disabling a CRTC. This fixes a NULL
pointer dereference in drm_connector_state_init.
|
|
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.
|
|
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
|