Age | Commit message (Collapse) | Author |
|
Instead of having a pending_fb field on the struct wlr_drm_plane,
move it to struct wlr_drm_connector_state. That way, there's no
risk having a stale pending FB around: the state doesn't survive
across tests and commits.
The cursor is a special case because it's disconnected from the
atomic state: the wlr_backend_impl.set_cursor hook sets the cursor
for the next commit. Move the field to
wlr_drm_connector.cursor_pending_fb.
|
|
We'll move the pending primary FB into the connector state in the
next commit, dropping wlr_drm_plane.pending_fb in the process.
Introduce a dedicated field for the cursor, which has to be managed
in a special way due to our set_cursor API.
|
|
plane_get_next_fb() will go away in subsequent commits. Primary and
cursor will differ with the new logic. Let's prepare for this.
|
|
We only have one error code-path, no need for goto here.
|
|
No need to manually call drm_connector_state_init() here, we can
just let drm_connector_commit_state() handle it.
|
|
We were calling drm_connector_supports_vrr() before
drm_connector_alloc_crtc(). Thus, when an output is currently off,
the VRR test would always fail, because it checks that the
vrr_enabled CRTC prop exists.
|
|
We sometimes used HAS_, sometimes polluted the LIBINPUT_ namespace,
etc.
|
|
Removes project arguments.
|
|
|
|
destroy_wl_buffer() is called from backend_destroy(). We need to
ensure the wlr_buffer is unlocked when we're waiting for a
wl_buffer.release event from the parent compositor.
|
|
Some compositors are not interested in wlr_session, for instance
nested compositors.
Disabling wlr_session removes the udev dependency.
|
|
Instead of hand-rolling get_current_time_msec(), let's just re-use
the helper we already have in "util/time.h".
|
|
Instead of returning an empty multi backend, fail with a clear
error when both the DRM and libinput backends are disabled.
|
|
We have no use for these.
|
|
There's no reason why the output should be damaged here. The current
buffer doesn't need to be re-painted.
|
|
Backends no longer need to manually call wlr_output_update_enabled()
in their commit hook: wlr_output will take care of that.
|
|
This function deals with multiple kinds of backends. Make it more
obvious that this variable holds the multi backend which is returned
to the user.
|
|
This no longer has purpose.
|
|
Up until now, wlr_backend_autocreate() created the wlr_session and
then stuffed it into struct wlr_multi_backend so that compositors
can grab it later.
This is an abuse of wlr_multi_backend and the wlr_backend API:
wlr_backend_get_session() and wlr_multi_backend.session only exist
to accomodate the needs of wlr_backend_autocreate(). What's more,
the DRM and libinput backends don't implement
wlr_backend_impl.get_session.
Instead, return the struct wlr_session to the compositor in the
wlr_backend_autocreate() call. wlr_backend_get_session() will be
removed in the next commit.
|
|
|
|
|
|
It doesn't make sense to request a page-flip for a disabled output.
Fixes: 84e727daae67 ("backend/drm: request page-flip event on modeset")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3528
|
|
Fixes: 65836ce357e4 ("backend/drm: log modesetting commits")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3534
|
|
|
|
|
|
Pixman 0.42.0 has constified APIs for pixman_region32_t. We no longer
need the casts.
|
|
The DRM, libinput and session use udev. They are all hosted under
backend/.
|
|
The following situation can be dangerous:
- Output DP-1 is plugged in, compositor enables it.
- User VT switches away.
- User unplugs DP-1.
- User VT switches back.
- scan_drm_connectors() figures out the output is now disconnected,
uninitializes the struct wlr_output.
- The loop restoring previous output state in handle_session_active()
accesses the struct wlr_output to figure out what to restore.
By chance, we zero out the struct wlr_output after uninitializing it,
so enabled and current_mode will always be zero. But let's make sure
we handle this case explicitly, to remind future readers that it exists
and make the code less fragile.
|
|
The old drm_connector_set_mode() function did that by calling
drm_crtc_page_flip(). We lost this in the refactoring.
Fixes: f216e979836a ("backend/drm: drop drm_connector_set_mode()")
|
|
|
|
This reverts commit e646d882cf4949d290fff2ba3b7ae4c124f6f13d.
This commit has added a dependency on udev_hwdb. This API isn't
available on all platforms (e.g. FreeBSD), and further deepens
our udev dependency. A better solution is being worked on in [1].
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3638
|
|
This stuff is immutable for a given connector.
|
|
Move a bit more logic out of the big loop in scan_drm_connectors().
|
|
Once we are DRM master, the CRTC cannot be changed behind our back
except during a VT switch.
After a VT switch, we try to restore whatever KMS state we had last
programmed. Reloading the current CRTC from KMS breaks this and
can result in a modeset without a FB.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
|
|
Can make issues like [1] easier to debug.
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
|
|
Inline it in drm_connector_commit_state(). Brings us a step closer
to unifying the test code-path and the commit code-path.
|
|
Can make it easier to track down issues.
|
|
The drm_connector_commit_state() call in handle_session_active()
was not resulting in any atomic commit, because it didn't match any
of the if branches: active = true, no new buffer was committed,
and adaptive sync/gamma LUT were unchanged. Thus the commit was a
no-op.
Later on, when the compositor performs regular page-flips, the
kernel would return EINVAL indicating that a modeset was needed.
Rework the logic to use a non-blocking page-flip commit if a buffer
was committed, and use a blocking commit if the connector is on or
is being disabled. The only case where we should skip the atomic
commit is when disabling (active = false) an already-disabled
connector (conn->crtc == NULL).
Note, 6936e163b514 ("backend/drm: short-circuit no-op commits")
has introduced early returns for other situations where we don't
need to perform an atomic commit (e.g. updating scale or transform
of an output).
Fixes: f216e979836a ("backend/drm: drop drm_connector_set_mode()")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
|
|
Extract the logic to fetch the current mode to a separate function
to make it more readable. Stop dying in an assert when
get_drm_prop_blob() fails. Always make it so the drmModeModeInfo
pointer is allocated so that we can free() it unconditionally.
|
|
We already have disconnect_drm_connector() to handle the
CONNECTED → DISCONNECTED transition. Let's add
connect_drm_connector() to handle DISCONNECTED → CONNECTED. This
makes scan_drm_connectors() shorter and easier to follow.
No functional change, literally just moving code around.
|
|
We were using the legacy API (with a detour through drmModeEncoder)
to find out the current CRTC for a connector. Use the atomic API
when available.
Also extract the whole logic into a separate function for better
readability, and better handle errors.
|
|
Instead of casting a wlr_output_mode to wlr_drm_mode, use
wl_container_of() for slightly better type safety.
|
|
This confused me while reading through.
|
|
The output names must be globally unique per the Wayland spec, even
if the compositor creates multiple backends of the same kind.
|
|
Instead of special-casing modesets, we can just cut the wrapper
and directly call drm_crtc_page_flip(). drm_connector_test() should
already have the checks previously done in drm_connector_set_mode(),
all we need to do is update enabled/mode after a successful atomic
commit.
|
|
This was leading to crash in compositors if the wanted connector had no CRTC
|
|
This field becomes stale too easily: for instance, see 6adca4089cf4
("backend/drm: don't unconditionally set desired_enabled").
Additionally, drm_connector_alloc_crtc() needs to do some weird
dance, restoring its previous value.
Instead, add a connector arg to realloc_crtcs() to indicate a new
connector we want to enable.
|
|
drm_connector_alloc_crtc() already checks this.
|
|
These are unused.
|
|
This has been addressed in 8795dde94eeb ("Initialize connectors
current mode to the mode used by KMS on startup.").
|