aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-05-27xwayland: add error-checking to `server_start_lazy`Tudor Brindus
This prevents a very unlikely crash in `xwayland_socket_connected`. Refs #2163.
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-25xwayland: send focus change event unconditionallyTudor Brindus
This fixes issues with (at least) dialogs in Jetbrains IDEs becoming unclickable if they ever lost focus (ref. swaywm/sway#5373). Prior to this change, since `xwm->focus_surface` would be set prior to `xwm_surface_activate` being called, the latter would short-circuit immediately and not notify the application of the focus change.
2020-05-24util/log: use bright black rather than black for WLR_DEBUGTudor Brindus
On some terminals under default settings, black is truly rendered as `#000`, making it unreadable when the background is also black. Refs swaywm/sway#5141.
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-20examples: make output-power-management oneshot by defaultIlia Bozhinov
2020-05-19xwayland: add option to disable WMSimon Ser
2020-05-19xwayland: split serverSimon Ser
Split the server part of wlr_xwayland into wlr_xwayland_server. This allows compositors to implement their own XWM when wlroots' isn't a good fit.
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-18Make wlr_xcursor_manager_load() return a boolIsaac Freund
This is currently inconsistent with the rest of the library and a bit of a footgun for new compositors. However, this breaks the API in a very unfortunate way for existing compositors.
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-14tablet: expose wlr_tablet_tool_v2_has_implicit_grab functionTudor Brindus
This is necessary so that sway can determine when to start emulating pointer events -- it shouldn't start doing so during an implicit grab, even if the pen is over a surface that doesn't bind tablet input. Refs swaywm/sway#5302.
2020-05-14tablet: pass motion events to implicitly grabbed surfaceTudor Brindus
Refs swaywm/sway#5302.
2020-05-14backend/drm: fix segfault in drm_crtc_page_flipSimon Ser
When no cursor plane is available, drm_crtc_page_flip would segfault.
2020-05-13input/pointer: notify compositor when constraint region changesTudor Brindus
This allows a compositor to know when warping back into the region is appropriate. Refs swaywm/sway#5268.
2020-05-12backend/drm: print error in set_plane_propsSimon Ser
This makes it easier to understand which plane failed.
2020-05-12backend/drm: disable cursor in dealloc_crtcSimon Ser
dealloc_crtc was destroying GBM surfaces, but the cursor_enabled flag was left as-is. When re-enabling the output, atomic_crtc_pageflip would try enabling the cursor plane, but would fail because no framebuffer is available. Closes: https://github.com/swaywm/wlroots/issues/2150
2020-05-12backend/drm: fix combined modeset+enable commitsSimon Ser
When an output is enabled and modeset at the same time, drm_connector_commit would first try to modeset then try to commit. This won't work because both will trigger a page-flip. KMS will reject that. Change the logic to only enable an output if no modeset has been requested. The logic in wlr_output already checks that the user isn't doing a modeset and disabling the output at the same time.
2020-05-12backend/drm: remove missing cursor plane workaroundSimon Ser
We have a workaround for legacy drivers that support drmModeSetCursor without exposing a cursor plane. It doesn't work anymore now that we've moved to a more atomic interface. Let's just remove this workaround and fallback to software cursors. Closes: https://github.com/swaywm/wlroots/issues/2166
2020-05-11render/egl: include EGL/eglmesaext.h only if presentJulien Olivain
This patch will make the EGL renderer work on any EGL/GLESv2 driver providing the EGL_WL_bind_wayland_display extensions. Mesa used to declare provisional EGL_WL_bind_wayland_display directly in <EGL/eglext.h>. Then, all unofficial extensions were moved to <EGL/eglmesaext.h>, to have a cleaner implementation. See: https://gitlab.freedesktop.org/mesa/mesa/-/commit/ab7bb10a2af711086319ce35815acd797b86fe27 The extension was then approved at Khronos Group, and reached the official <EGL/eglext.h>. See: https://www.khronos.org/registry/EGL/extensions/WL/EGL_WL_bind_wayland_display.txt https://github.com/KhronosGroup/EGL-Registry/commit/aa9b63f3ab18aee92c95786a2478156430f809e4 In order to make sure the renderer will work on any version of any implementation providing the extension, only include the mesa-specific header if it's present. Signed-off-by: Julien Olivain <juju@cotds.org>
2020-05-11backend/drm: fix missing cursor on external monitors with multi-GPU setup ↵JonnyMako
and nouveau We need to make the multi-GPU surface current before the glFinish call. Closes: https://github.com/swaywm/sway/issues/5319
2020-05-10backend/drm: fix crash in session_signalSimon Ser
conn->crtc is NULL in case the output is disabled. However, the DRM backend will set the GAMMA_LUT property anyway. On each commit the whole state is sent to KMS. Adding WLR_DRM_CRTC_GAMMA_LUT to the pending state would just make the backend re-create the blob containing the gamma LUT.
2020-05-10backend/drm: simplify atomic commit logicSimon Ser
We don't need a per-CRTC atomic request anymore. Let's make the request per-commit so that it's easier to debug. This is also groundwork for supporting wlr_output_test properly.
2020-05-10backend/drm: GAMMA_LUT_SIZE isn't atomicSimon Ser
GAMMA_LUT_SIZE isn't an atomic property. It can be used with the legacy interface too. So we can unify both codepaths and remove wlr_drm_interface.crtc_get_gamma_size. It's no guaranteed to exist though, so we still need to keep the fallback.
2020-05-09backend/drm: remove crtc_set_cursor from interfaceSimon Ser
2020-05-09backend/drm: remove conn_enable from interfaceSimon Ser
Use crtc_commit instead.
2020-05-09backend/drm: rename crtc_pageflip to crtc_commitSimon Ser
Also add a flags argument. The commit function will also be used for disabling the CRTC.
2020-05-09backend/drm: apply gamma LUT on page-flipSimon Ser
2020-05-09backend/drm: remove mode argument to crtc_pageflipSimon Ser
Add a new wlr_drm_crtc.pending bitfield which keeps track of pending output changes. More fields will be added in the future (e.g. active, gamma).
2020-05-09backend/drm: remove unused fieldsSimon Ser
2020-05-09backend/drm: remove wlr_drm_interface.crtc_move_cursorSimon Ser
Instead, make the legacy backend call drmModeMoveCursor on page-flip.
2020-05-07input/keyboard: expose keymap matching helperTudor Brindus
sway needs this logic too, and currently ships a version that has fallen behind in terms of bugfixes (b1a63bc).
2020-05-04backend/wayland: emit tablet tool axis events to the axis handlerTudor Brindus
2020-05-04wlr/types: use bitshifts for tablet axes enumTudor Brindus
2020-05-02backend/headless: handle renderer destroySimon Ser
When the headless backend uses an already-existing renderer, it doesn't have ownership over the renderer. When the renderer is destroyed, the headless backend needs to destroy itself.
2020-05-02backend/multi: handle backends depending on each other properlySimon Ser
wl_list_for_each_safe only allows the current list item to be removed. If a backend destroys itself when another backend is destroyed, this blows up.
2020-05-02Add wlr_surface_accepts_touchDavid96
2020-05-02layer shell: only send unmap on close if mappedIsaac Freund
2020-05-01examples/dmabuf-capture: use getoptSimon Ser
This makes it a little bit less annoying to provide the right arguments. All options have reasonable defaults.
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