aboutsummaryrefslogtreecommitdiff
path: root/backend/x11
AgeCommit message (Collapse)Author
2021-01-21backend/x11: keep track of exposed rects, add them to damage regionsIlia Mirkin
When we receive an Expose event, that means that we must redraw that region of the X11 window. Keep track of these regions with pixman regions, and merge them with the additional output damaged regions. Fixes #2670
2021-01-21backend/x11: skip events we don't care aboutIlia Mirkin
These are ones I see log messages about in my setup.
2021-01-21backend/x11: add support for scanout modeIlia Mirkin
This makes full-screen with weston-terminal work.
2021-01-20backend/x11: make sure output transform matrix is initializedIlia Mirkin
The transform matrix was all 0's, which meant that effectively nothing got rendered other than the clear color.
2021-01-18backend/x11: fix region not being actually usedSimon Ser
The region variable was shadowed in an if block. As a result, in the outer block region was always XCB_NONE and was never destroyed (causing a memory leak on the server). Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-01-18backend/x11: set a blank cursor rather than hiding globallyIlia Mirkin
This actually simplifies the logic since we no longer have to wait for enter/leave events, and also improves the UX when e.g. handling a crash with gdb attached. See #2659
2021-01-17backend/x11: add xcb_dri3_pixmap_from_buffers check for n_planesSimon Ser
Just in case.
2021-01-17backend/x11: add support for DRI3 1.0Simon Ser
Add fallbacks when DRI3 1.2 isn't supported. Closes: https://github.com/swaywm/wlroots/issues/2586
2021-01-17backend/x11: log DRM node nameSimon Ser
2021-01-17backend/x11: log when creating X11 backendSimon Ser
2021-01-16render/gles2: make EGL context current in bind_bufferSimon Ser
Instead of requiring callers to manually make the EGL context current before binding a buffer and unsetting it after unbinding a buffer, do it inside wlr_renderer_bind_buffer. This hides renderer-specific implementation details inside the wlr_renderer interface. Non-GLES2 renderers may not use EGL. This removes all EGL dependencies from the backends. References: https://github.com/swaywm/wlroots/issues/2618 References: https://github.com/swaywm/wlroots/pull/2615#issuecomment-756687006
2021-01-16render: remove egl include from wlr_rendererSimon Zeni
2021-01-16render: drop egl parameters from wlr_renderer_autocreateSimon Zeni
2021-01-16backend/x11: implement get_drm_fdSimon Ser
2021-01-12render/egl: remove surface and buffer age args from make_currentSimon Ser
These aren't used anymore.
2021-01-07remove unnecessary egl includesSimon Zeni
2021-01-07backend: remove wlr_egl from all backendsSimon Zeni
2021-01-06render: remove EGL config and visual from wlr_renderer_autocreateSimon Ser
This isn't used anymore by any backend. Some examples still provide an EGL config to wlr_egl_init, so we can't drop it yet there.
2020-12-31backend/x11: print version on extension errorSimon Ser
2020-12-30backend/x11: always open render nodeSimon Ser
If we get an authenticated primary node from the X11 server, don't use it because we can't authenticate our Wayland clients with it. Instead, open a render node. Closes: https://github.com/swaywm/wlroots/issues/2576
2020-12-30Remove wlr_create_renderer_func_tSimon Ser
This callback allowed compositors to customize the EGL config used by the renderer. However with renderer v6 EGL configs aren't used anymore. Instead, buffers are allocated via GBM and GL FBOs are rendered to. So customizing the EGL config is a no-op.
2020-12-28backend/x11: create per-window present event contextsSimon Ser
The Present protocol states: > An event context is associated with a specific window; using an existing > event context with a different window generates a Match error. Instead of a global event context, use a per-window event context to fix this error: [backend/x11/backend.c:608] X11 error: op Present (SelectInput), code Match (no extension), sequence 63, value 4194307 Closes: https://github.com/swaywm/wlroots/issues/2577
2020-12-27backend/x11: implement a real rendering loopSimon Ser
Instead of using a timer, rely on X11 Present events and send a new frame event when the parent compositor displays a new frame on screen. The previous attempt at doing this [1] hit issues with EGLSurface, but we don't use that anymore. [1]: https://github.com/swaywm/wlroots/pull/1894
2020-12-21backend/x11: destroy buffers when destroying outputSimon Ser
2020-12-21backend/x11: re-use pixmapsSimon Ser
Instead of re-importing a buffer each time we submit a frame, re-use the pixmaps if possible.
2020-12-18backend/x11: send more precise output present eventsSimon Ser
Instead of sending dummy output present events, use the X11 Present extension to send more precise events.
2020-12-18backend/x11: use DRI3Open to get DRM FDSimon Ser
Instead of relying on EGL to retrieve the DRM FD, query it from the DRI3 extension. Use the EGL GBM platform, and drop the EGL config.
2020-12-17backend/x11: fix DRI3 formats not usedSimon Ser
We queried DRI3 formats, but we weren't using them. Because of a typo, only render formats were used. Fixes: c59aacf94465 ("backend/x11: query modifiers supported by X11 server") Closes: https://github.com/swaywm/wlroots/issues/2552
2020-12-15backend: use fcntl(F_DUPFD_CLOEXEC) instead of dupSimon Ser
This makes sure the CLOEXEC flag is set on the dup'ed FD.
2020-12-13backend/x11: fix xinput mask mixed up with presentSimon Ser
Don't mix xinput and present flags. Fixes: d79a00bf0208 ("backend/x11: switch to wlr_swapchain")
2020-12-13backend/x11: query modifiers supported by X11 serverSimon Ser
2020-12-13backend/x11: switch to wlr_swapchainSimon Ser
2020-11-24backend/x11: log unhandled client messagesSimon Ser
2020-11-24backend/x11: log unhandled X11 eventsSimon Ser
2020-11-24backend/x11: log errorsSimon Ser
Register an X11 error handler, and optionally use xcb-errors to print a detailed message.
2020-11-11Replace wlr_key_state with wl_keyboard_key_stateIsaac Freund
There's no reason to have duplicate enums
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-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-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-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: introduce wlr_output_testSimon Ser
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
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-11-19backend/x11: Revert usage of present extensionScott Anderson
This reverts commit 3317134adff0ed179e0ecaea6d778dbd0684f771. This reverts commit a3c3b928a3814f1a44babf487b1508415958c721. There are some serious issues when running this on a real X server, as opposed to running this on Xwayland, where this was tested. More investigation needs to be done into why these issues happen and if our usage of the present extension is correct.
2019-11-18backend/x11: Drop required present versionScott Anderson
We say 1.2, but I don't think we actually use anything that was introduced past 1.0.
2019-11-02backend/x11: Give X11 a real rendering loopScott Anderson
Makes use of the present extension to get notified of vsync, and not require any stupid timer hacks. Also make use of the present version of ConfigureNotify, because why not?