aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2020-10-10backend/libinput: improve logger callbackSimon Ser
- Add a prefix to make it clear log messages come from libinput - Properly convert libinput log priority to wlroots'
2020-09-16backend: remove check for _WAYLAND_DISPLAYSimon Ser
I'm not sure what this was used for, but it's not used by libwayland. Setting _WAYLAND_DISPLAY would result in the Wayland backend being picked but would ignore the actual value of the env variable.
2020-09-04Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not allnerdopolis
seat0s have TTYs
2020-09-04session: Don't refuse unprivileged creation of "direct" backendPatrick Steinhardt
When starting a compositor that's using the "direct" session backend, wlroots needs to handle calls to `drmSetMaster()` and `drmDropMaster()`. As both calls used to require `CAP_SYS_ADMIN`, wlroots thus simply refused starting in case the process doesn't enjoy evelated privileges. Permission rules have changed since linux.git commit 45bc3d26c95a (drm: rework SET_MASTER and DROP_MASTER perm handling, 2020-03-19). As a result, starting with Linux v5.8, both ioctls will now also succeed if the process is currently or has been the DRM master. And as the first process to open render nodes will become the DRM master automatically, this effectively means that process elevation is not strictly required in all setups anymore. So let's drop the `geteuid() != 0` permission check to allow those new rules to do their magic.
2020-09-04wayland: emit relative pointer events only for current pointerIlia Bozhinov
2020-09-02Quieten failure to set login session typeRyan Walklin
(almost certainly due to systemd version <246)
2020-09-01backend/session/libseat: register log handlerSimon Ser
Route libseat errors through wlroots logging infrastructure. This requires libseat 0.2.0.
2020-08-26session: Add missing init to direct-freebsdKenny Levinsen
bad1e9afa8ea ("session: Add libseat backend") introduced a change to to how session backends initialize, but failed to update the FreeBSD specific version of the direct backend accordingly. Closes: https://github.com/swaywm/wlroots/issues/2376
2020-08-24Remove unnecessary wl_display_dispatch callsSimon Ser
wl_display_roundtrip already takes care of dispatching the display.
2020-08-24session: Add libseat backendKenny Levinsen
2020-08-17backend/wayland: destroy relative pointer when output is disconnectedIlia Bozhinov
Fixes #2243 Fixes #2106
2020-08-07Don't set XDG_SESSION_TYPE unless logind SetType succeedsRyan Walklin
2020-08-07Also set XDG_SESSION_TYPERyan Walklin
2020-08-07Implement logind session SetType method to change session type to waylandRyan Walklin
2020-07-31drm: fix uninitialized readDevin J. Pohly
get_drm_prop_blob does not set path_len if it returns NULL. Check the return value before path_len to avoid reading uninitialized memory. (Granted, this doesn't change the logic at all, but it does make Valgrind a bit happier.)
2020-07-27Fix incorrect format parametersAntonin Décimo
2020-07-07backend/drm: check drm_surface_make_current return valueSimon Ser
drm_connector_set_cursor wasn't checking the return value of the drm_surface_make_current call. On failure, this results in a failed assertion in wlr_renderer_begin (because no rendering context is current).
2020-07-07backend/drm: fix typo in drm_surface_make_current argSimon Ser
2020-07-02backend/drm: fix DPMS on legacy interfaceSimon Ser
This mirrors what the atomic code does in create_mode_blob. Closes: https://github.com/swaywm/wlroots/issues/2312
2020-06-19backend/noop: add missing rollback_render output implSimon Ser
3c5dbfd97c77 ("output: make rollback_render mandatory") makes a no-op output init fail without this function.
2020-06-19output: rename impl->rollback to rollback_renderSimon Ser
The output backend API is now mostly state-less thanks to the atomic hooks (commit and test). There is one exception though: attach_render. This function makes the rendering context current. However sometimes the compositor might decide not to render after attach_render (e.g. when there's nothing new to render to the back buffer). Thus wlr_output_rollback has been introduced to revert the pending state. Because the output backend API is mostly state-less, the only thing wlr_output_impl.rollback needs to do is revert the current rendering context. Rename the function to rollback_render to make this clear. Add a check in the common wlr_output code to only call rollback_render when attach_buffer has been previously called. On the long term, we'll be able to remove attach_render and rollback_render together.
2020-06-13backend: drm: Fix dmabuf resource leakAndri Yngvason
2020-06-08backend/drm: fix stack overflow in dealloc_crtcSimon Ser
Call drm_crtc_commit directly instead of calling drm_connector_set_mode. This restores the previous behaviour where conn_enable was called [1]. [1]: https://github.com/swaywm/wlroots/blob/0c7c562482575cacaecadcd7913ef25aeb21711f/backend/drm/drm.c#L1093 Closes: https://github.com/swaywm/wlroots/issues/2253
2020-06-06util: fix and move `get_current_time_msec` into a util fileTudor Brindus
This commit makes `get_current_time_msec` correctly return milliseconds as opposed to microseconds. It also considers the value of `tv_sec`, so we don't lose occasionally go back in time by one second. Finally, the function is moved into `util/time.cc` so that it can be reused elsewhere without having to consider these pitfalls.
2020-06-03backend/drm: fix black screens when enabling outputSimon Ser
This patch fixes this failure: 01:57:16.642 [ERROR] [backend/drm/drm.c:360] Failed to page-flip output 'eDP-1': a page-flip is already pending 01:57:16.684 [ERROR] [backend/drm/drm.c:360] Failed to page-flip output 'eDP-1': a page-flip is already pending 01:57:16.684 [ERROR] [backend/drm/drm.c:732] Failed to initialize renderer on connector 'eDP-1': initial page-flip failed 01:57:16.684 [ERROR] [backend/drm/drm.c:805] Failed to initialize renderer for plane 01:57:16.684 [sway/config/output.c:423] Failed to commit output eDP-1 References: https://github.com/swaywm/sway/issues/5101
2020-06-02backend/wayland: fix spurious eglSwapBuffers failuresSimon Ser
This was introduced in [1]. However after reverting that PR I still can't reproduce the bug the PR aimed to fix [2]. Since there's no good explanation why we would need to swap buffers before resizing, let's just revert the PR. [1]: https://github.com/swaywm/wlroots/pull/1486 [2]: https://github.com/swaywm/wlroots/issues/1371 Closes: https://github.com/swaywm/wlroots/issues/1768
2020-06-01backend/wayland: scale tablet tool position into [0, 1] rangeTudor Brindus
Fixes #2233.
2020-06-01backend/drm: always perform a CRTC commit in drm_connector_commitSimon Ser
When the mode, status or buffer hasn't changed, drm_connector_commit was a no-op. Because of this individual changes to the gamma LUT or adaptive sync status were ignored (if committed without a buffer). Instead, perform a commit to apply the changes.
2020-06-01backend/drm: drop extra wlr_output_update_enabled callSimon Ser
drm_connector_set_mode already takes care of keeping this up-to-date.
2020-06-01backend/drm: commit/rollback FBs in drm_crtc_commitSimon Ser
We need to perform the FB bookkeeping on all commits, not just on page-flips.
2020-06-01backend/drm: make adaptive_sync atomicSimon Ser
Stop using drmModeObjectSetProperty, set the property in the crtc_commit function instead.
2020-06-01backend/drm: rollback pending CRTC state on test commitSimon Ser
A test commit doesn't apply the pending state. The CRTC state will be populated again if the compositor decides to perform a regular commit afterwards.
2020-05-28Add comments for missing tablet tool entriesSimon Ser
And stop using default cases, so that we know which parts of the code need an update when adding a new enum entry. Closes: https://github.com/swaywm/wlroots/issues/2208
2020-05-27backend/drm: fix missing crtc->cursor NULL checkSimon Ser
Fixes: cdb6fdbc6cb7 ("backend/drm: remove missing cursor plane workaround")
2020-05-27backend/drm: don't set cursor if off-screenSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/2216
2020-05-26backend/drm: introduce pending and current CRTC stateSimon Ser
Previously, we only had the pending state (crtc->pending, crtc->mode and crtc->active). This causes issues when a commit fails: the pending state is left as-is, and the next commit may read stale data from it. This will also cause issues when implementing test-only commits: we need to rollback the pending CRTC state after a test-only commit. Introduce separate pending and current CRTC states. Properly update the current state after a commit.
2020-05-26backend/drm: nuke retry_pageflipSimon Ser
retry_pageflip is now dead code, since drm_connector_start_renderer isn't called anymore. It was previously called when enabling an output. The name "retry_pageflip" was a little confusing because the function retried a modeset and the timer wasn't set up while performing a simple page-flip. Let's just remove this altogether for now. We can discuss whether it's worth it to bring it back. Should we only do it on failed page-flips? Should we only do it on EBUSY?
2020-05-26backend/drm: make drm_connector_set_mode take a wlr_drm_connectorSimon Ser
Since this is an internal DRM backend function, there's no reason we need to take a generic wlr_output.
2020-05-26backend/drm: remove enable_drm_connectorSimon Ser
Merge enable_drm_connector into drm_connector_set_mode. This allows us to de-duplicate logic since enabling an output performs a modeset.
2020-05-26backend/drm: remove drm_connector_set_custom_modeSimon Ser
Replace it with a function that returns the pending mode.
2020-05-26backend/drm: refuse to enable an output without a modeSimon Ser
2020-05-26backend/drm: rollback atomic blobsSimon Ser
If the atomic commit fails or is test-only, rollback wlr_drm_crtc.{mode_id,gamma_lut} blob IDs to their previous value. This prevents the next commits from failing or applying test-only state.
2020-05-20render/egl: unset current context after swapping buffersSimon Ser
After swapping buffers, it doesn't make sense to perform more rendering operations. Unset the context to reflect this. This commit makes it so the context is always only current between wlr_egl_make_current and wlr_egl_swap_buffers. This is an alternative to [1]. [1]: https://github.com/swaywm/wlroots/pull/2212
2020-05-19backend/drm: add missing wlr_egl_unset_currentSimon Ser
2020-05-19backend/drm: fix current EGL context on multi-GPUSimon Ser
get_tex_for_bo changes the current EGL context. Rendering operations must immediately follow drm_surface_make_current. Closes: https://github.com/swaywm/wlroots/issues/2209
2020-05-19render/egl: introduce wlr_egl_unset_currentSimon Ser
This function can be called after wlr_egl_make_current to cleanup the EGL context. This avoids having lingering EGL contexts that make things work by chance. Closes: https://github.com/swaywm/wlroots/issues/2197
2020-05-19Fix -Wreturn-type warningsSimon Ser
When calling assert(0) instead of returning a value, -Wreturn-type warnings are triggered because assertions can be disabled. Replace these assertions with abort().
2020-05-14backend/drm: fix atomic commits when the GAMMA_LUT prop is missingSimon Ser
We already have the logic to fallback to the legacy interface above. We just need to avoid calling atomic_add with a zero prop ID. Closes: https://github.com/swaywm/wlroots/issues/2187
2020-05-14output: make wlr_output_set_gamma atomicSimon Ser
wlr_output_set_gamma is now double-buffered and applies the gamma LUT on the next output commit.
2020-05-14backend/drm: fix segfault in drm_crtc_page_flipSimon Ser
When no cursor plane is available, drm_crtc_page_flip would segfault.