aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2020-05-01backend/drm: make page-flip error scarierSimon Ser
The logs don't currently display the importance of a line. It's easy to read "skipping page-flip" as a debug message instead of an error message. Change the error message to make it more explicit. References: https://github.com/swaywm/wlroots/pull/2147
2020-05-01Fix error when reconnecting external displayWill Daly
Reconnecting an external display fails on initial page-flip. This occurs when the pageflip_pending flag has been set on the connector at the time the monitor is removed. Once the connector's CRTC has been deallocated, page_flip_handler cannot find the connector by its crtc_id, so pageflip_pending will remain set. This causes initialization to fail when the monitor is reconnected with the error messages: Skipping pageflip on output 'X' Failed to initialize renderer on connector 'X': initial page-flip failed To fix this problem, clear the pageflip_pending flag when cleaning up the connector.
2020-04-29Remove libcap supportScott Anderson
This is simply a false sense of security, and is worse than just using setuid. CAP_SYS_ADMIN is an extremely serious capability that is effectively as powerful as root. It also required users to be in the input group, which allows any process to keylog the entire system.
2020-04-29backend/drm: strip alpha channel if necessarySimon Ser
Some primary planes don't support ARGB8888, they only support XRGB8888 (for instance on older Intel hardware). The DRM backend would fail to initialize. When that's the case, try to allocate buffers without an alpha channel.
2020-04-28backend/drm: don't allow legacy to use direct scanoutScott Anderson
2020-04-28backend/drm: move atomic cursor code into pageflip codeScott Anderson
It makes sense to construct as much atomic state as possible in the same place, so it doesn't get lost if we "reset" it.
2020-04-28backend/drm: don't have fallback atomic commitsScott Anderson
This is just doing atomic incorrectly.
2020-04-28backend/drm: introduce wlr_drm_fbScott Anderson
This is a type which manages gbm_surfaces and imported dmabufs in the same place, and makes the lifetime management between the two shared. It should lead to easier to understand code, and fewer special cases. This also contains a fair bit of refactoring to start using this new type. Co-authored-by: Simon Ser <contact@emersion.fr>
2020-04-27input/tablet: populate tool tip event positionTudor Brindus
This commit doesn't fix any issue that I'm aware of, since sway incidentally does not use these fields. Still, they exist, so they should probably be filled in to prevent fun surprises in the future.
2020-04-22backend/headless: add wlr_headless_backend_create_with_rendererSimon Ser
This allows one to create a headless backend with an existing renderer.
2020-04-22backend/headless: use FBOs instead of pbuffersSimon Ser
2020-04-21build: use dicts instead of get_variableSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/1963
2020-04-21backend/libinput: correctly populate x/y fields on tablet proximity inTudor Brindus
Otherwise, the cursor will briefly jump to (0, 0). This is particularly noticeable in the referenced issue (the game osu!). Refs swaywm/sway#3633
2020-04-15logind: Close fd before releasing deviceKenny Levinsen
This speeds up shutdown significantly, and is in line with how Weston does it.
2020-04-14backend/multi: add backends at end of listSimon Ser
This allows wlr_multi_for_each_backend to iterate on the backends in the order where they have been added.
2020-04-10backend/wayland: check scan-out buffer is compatible in output_testSimon Ser
If the buffer doesn't have a supported format/modifier, make the test fail.
2020-04-10output: check for buffer size compatibility in common codeSimon Ser
Instead of checking for buffer size compatibility in each backend, centralize the check in wlr_output itself.
2020-04-10output: fix blurred hw cursors with fractional scalingSimon Ser
The scaling factor was being implicitly cast to an int. Closes: https://github.com/swaywm/sway/issues/4927
2020-04-09backend: set EGL_RENDERABLE_TYPE and EGL_SURFACE_TYPESimon Ser
Ensure these are set to the correct value.
2020-04-08Add wlr_output_impl.rollbackSimon Ser
Most of the pending output state is not forwarded to the backend prior to an output commit. For instance, wlr_output_set_mode just stashes the mode without calling any wlr_output_impl function. wlr_output_impl.commit is responsible for applying the pending mode. However, there are exceptions to this rule. The first one is wlr_output_attach_render. It won't go away before renderer v6 is complete, because it needs to set the current EGL surface. The second one is wlr_output_attach_buffer. wlr_output_impl.attach_buffer is removed in [1]. When wlr_output_rollback is called, all pending state is supposed to be cleared. This works for all the state except the two exceptions mentionned above. To fix this, introduce wlr_output_impl.rollback. Right now, the backend resets the current EGL surface. This prevents GL commands from affecting the output after wlr_output_rollback. This patch is required for FBO-based outputs to work properly. The compositor might be using FBOs for its own purposes [2], having leftover FBO state can have bad consequences. [1]: https://github.com/swaywm/wlroots/pull/2097 [2]: https://github.com/swaywm/wlroots/pull/2063#issuecomment-597614312
2020-04-08backend: reset EGL surface after buffer swapSimon Ser
This prevents GL commands to affect a previously current EGL surface after a buffer swap.
2020-04-08output: check buffer in wlr_output_testSimon Ser
Check that buffer can be scanned out in wlr_output_test instead of wlr_output_attach_buffer. This allows the backend to have access to the whole pending state when performing the check. This brings the wlr_output API more in line with the KMS API. This removes the need for wlr_output_attach_buffer to return a value, and for wlr_output_impl.attach_buffer.
2020-04-08output: introduce wlr_output_testSimon Ser
2020-04-02buffer: add a release eventSimon Ser
Consumers call wlr_buffer_lock. Once all consumers are done with the buffer, only the producer should have a reference to the buffer. In this case, we can release the buffer (and let the producer re-use it).
2020-03-24build: Add 'auto' to logind-provider combo optionScott Moreau
The logind provider defaulted to systemd and in order to use elogind, -Dlogin-provider=elogind was required. This adds 'auto' as a choice for the login-provider option and sets it as default. Using 'auto', the build will check for systemd first and if it's not found, try to find and use elogind automatically.
2020-03-17backend/wayland: close keymap FDSimon Ser
We don't actually need the keymap. We need to close the FD or we will run out of FDs.
2020-03-15Fix uint32 overflow in fill_empty_gamma_table on Icelake platformFilip Sandborg
Closes: https://github.com/swaywm/sway/issues/4826
2020-03-06backend/drm: add support for adaptive_sync_enabledSimon Ser
The vrr_capable and VRR_ENABLED properties are used.
2020-03-06backend/x11: add support for adaptive_sync_enabledSimon Ser
This sets the _VARIABLE_REFRESH window property [1]. [1]: https://gitlab.freedesktop.org/mesa/mesa/blob/0616b7ac90cf4f86bb409d34101e3a3cceac8cbe/src/vulkan/wsi/wsi_common_x11.c#L1374
2020-03-04backend/wayland: fix seat caps handlingSimon Ser
Previously, each time a wl_seat.capabilities event was received the Wayland backend created new input devices. It now only does so the first time. Input devices are now destroyed when the cap is removed. Closes: https://github.com/swaywm/sway/issues/5055
2020-03-04output: remove wlr_output_impl.schedule_frameSimon Ser
This function allowed backends to provide a custom function for frame scheduling. Before resuming the rendering loop, the DRM and Wayland backends would wait for vsync. There isn't a clear benefit of doing this. The only upside is that we get more stable timings: the delay between two repaints doesn't change too much and is close to a mutliple of the refresh rate. However this introduces latency, especially when a client misses a frame. For instance a fullscreen game missing vblank will need to wait more than a whole frame before being able to display new content. This worst case scenario happens as follows: - Client is still rendering its frame and cannot submit it in time - Deadline is reached - Compositor decides to stop the rendering loop since nothing changed on screen - Client finally manages to render its frame, submits it - Compositor calls wlr_output_schedule_frame - DRM backend waits for next vblank - The wlr_output frame event is fired, compositor draws new content on screen - On the second next vblank, the new content reaches the screen With this patch, the wlr_output frame event is fired immediately when the client submits its late frame. This change also makes it easier to support variable refresh rate, since VRR is all about being able to present too-late frames earlier. References: https://github.com/swaywm/wlroots/issues/1925
2020-03-04backend/wayland: rename wl_seat.c to seat.cSimon Ser
I never got why we have a wl_ prefix here.
2020-02-17backend/session: allow GPU enumeration on FreeBSDJan Beich
https://github.com/FreeBSDDesktop/libudev-devd/commit/f11ee5b418c740ba6fd4c946ab10b0d89702e4d0
2020-01-24backend/drm: remove overzealous finish_drm_surfaceRouven Czerwinski
The previous PR was overzealous in adding a finish_drm_surface call which was also done by the caller. Remove the call and also move the comment to the correct code location.
2020-01-24backend/drm: add env variable to disable modifiersRouven Czerwinski
In some cases modesets fail if the planes are initialized with modifiers. Since in this case possibly all planes need to reinitialized, which is not possible in the current wlroots design, add an environment variable for affected users.
2020-01-24meson: Fix protocol includes for compositor examplesScott Anderson
2020-01-17backend/drm: prevent outputs from being destroyed on commitSimon Ser
This would happen if initializing the renderer fails. Instead, we just mark the output as disabled. References: https://github.com/swaywm/sway/pull/4917
2020-01-12render/egl: remove SURFACELESS_MESA special caseSimon Ser
Users can just pass EGL_DEFAULT_DISPLAY themselves.
2020-01-10Drop RDP backendDrew DeVault
Users interested in remote access to wlroots compositors should use wayvnc: https://github.com/any1/wayvnc
2020-01-09backend/wayland: handle display errors more gracefullySimon Ser
Previously, an error on the remote Wayland display would result in an infinite loop priting: 2020-01-09 13:39:03 - [wayland] Source dispatch function returned negative value! 2020-01-09 13:39:03 - [wayland] This would previously accidentally suppress a follow-up dispatch This happens when the remote compositor disconnects the client because of a protocol error, for instance. Handle wl_display_dispatch and wl_display_dispatch_pending returning -1 by terminating the local display and printing an error.
2020-01-09backend/wayland: listen to wl_buffer.release eventsSimon Ser
Previously, we just assumed submitting a new frame would make the compositor release the current one. This isn't always the case, for instance Sway retains old buffers when a transaction is pending. This resulted in synchronization issues with clients writing in front-buffers. Fix this by un-referencing a wlr_buffer when the parent compositor sends wl_buffer.release. Tested by running a fullscreen mpv instance in Sway with the Wayland backend.
2020-01-08Allow WLR_RDP_PORT to be any valid TCP/UDP port numberJason
2020-01-02backend/wayland: fix frame callback not registeredSimon Ser
This got removed in [1]. I probably messed up the rebase. [1]: https://github.com/swaywm/wlroots/pull/1797/files#diff-3065f86e6de87d143d4a7673a8ee3a2d Fixes: 5d1ba0f44687 ("output: re-introduce atomic mode, enabled, scale and transform")
2019-12-30backend/drm: don't modeset with a NULL mode after TTY switchSimon Ser
This fixes a segfault in drm_connector_set_mode (mode = NULL). This happens because we set wlr_output.enabled to true if the connector is attached to the CRTC. When the user disables an output in the wlroots-based compositor, switches to another VT (enabling the output), then switches back, wlroots sets wlr_output.enabled to true but wlr_output.current_mode is NULL. We should consider not reading properties from KMS after a TTY switch, disabling all connectors. However this may result in flickering (outputs being disabled then re-enabled). Closes: https://github.com/swaywm/wlroots/issues/1874
2019-12-30output: refuse to commit a buffer or modeset a disabled outputSimon Ser
References: https://github.com/swaywm/wlroots/issues/1780#issuecomment-518938390
2019-12-30backend/drm: modeset before enabling an outputSimon Ser
This saves one modeset in case the previous mode is different.
2019-12-30output: re-introduce atomic mode, enabled, scale and transformSimon Ser
This reverts commit 01f903874b7e27539488fad7f31476d5bcbc6ac9 and re-applies commit ee5f98ad49fed0439f3313ec685307831d1d1d05. Updates: https://github.com/swaywm/wlroots/issues/1640 (Atomic output updates issue) See also: https://github.com/swaywm/wlroots/pull/1762 (Atomic output updates original PR) See also: https://github.com/swaywm/wlroots/issues/1780 (Issue caused by atomic output updates) See also: https://github.com/swaywm/sway/issues/4419 (Issue caused by atomic output updates) See also: https://github.com/swaywm/wlroots/pull/1781 (Revert PR)
2019-12-29output: add descriptionSimon Ser
wlr_output.description is a string containing a human-readable string identifying the output. Compositors can customise it via wlr_output_set_description, for instance to make the name more user-friendly. References: https://github.com/swaywm/wlroots/issues/1623
2019-12-23meson: Various improvementsScott Anderson
Bumps minimum version to 0.51.0 - Remove all intermediate static libraries. They serve no purpose and are just add a bunch of boilerplate for managing dependencies and options. It's now managed as a list of files which are compiled into libwlroots directly. - Use install_subdir instead of installing headers individually. I've changed my mind since I did that. Listing them out is annoying as hell, and it's easy to forget to do it. - Add not_found_message for all of our optional dependencies that have a meson option. It gives some hints about what option to pass and what the optional dependency is for. - Move all backend subdirectories into their own meson.build. This keeps some of the backend-specific build logic (especially rdp and session) more neatly separated off. - Don't overlink example clients with code they're not using. This was done by merging the protocol dictionaries and setting some variables containing the code and client header file. Example clients now explicitly mention what extension protocols they want to link to. - Split compositor example logic from client example logic. - Minor formatting changes
2019-12-22backend/session/freebsd: Fix the way to get TTY pathTing-Wei Lan
Previously, the path of TTY is generated using snprintf with %d format. It works with TTY 1 to 10, but fails with TTY with greater number because the number used in the name is in base 32 instead of base 10. Since there is no standard function to convert a number to a string with a custom base, this commit adds a function to do it. Fixes: https://github.com/swaywm/wlroots/issues/1854