aboutsummaryrefslogtreecommitdiff
path: root/backend/backend.c
AgeCommit message (Collapse)Author
2022-04-28Zero-initialize structs in init functionsSimon Ser
Ensures there is no field left to its previous undefined value after calling an init function.
2021-12-20backend: error out in autocreate without libinput supportSimon Ser
The libinput backend is now optional. However, this means that a user building wlroots without the correct libinput dependencies will end up with a compositor which doesn't respond to input events. wlr_backend_autocreate is supposed to return a sensible setup, so in this case let's just error out and explain what happened. Users can suppress the check by setting WLR_LIBINPUT_NO_DEVICES=1 (already used to suppress the zero input device case inside the libinput backend). Compositors which really want to create a bare DRM backend can easily create it manually instead of using wlr_backend_autocreate.
2021-12-13backend/drm: add wlr_drm_backend_monitorChris Chamberlain
This helper is responsible for listening for new DRM devices and create new child DRM backends as necessary.
2021-12-13backend: fix return value of attempt_drm_backendChris Chamberlain
The multi backend was returned instead of the primary DRM backend.
2021-11-25backend: remove noop backendSimon Zeni
2021-11-19backend: fix attempt_backend_by_name multi backend self insertionSimon Zeni
2021-11-18backend: remove wlr_backend_get_rendererSimon Zeni
2021-11-18backend: remove backend_get_allocatorSimon Zeni
2021-11-18backend: remove backend ensure renderer and allocator checkSimon Zeni
2021-10-27backend.c: do not try to explicitly clean up the libinput backendMarkusVolk
Since libinput is an optional dependency the libinput backend is possibly undeclared. wlr_backend_destroy(backend) below will clean up the child libinput backend if any.
2021-10-18Add error handling to backend creationAnthony Super
This commit adds two error-handling cases to the function attempt_dmr_backend. Specifically: - In the case where the number of found GPUs is zero, we now print a log message indicating this and return a NULL pointer - In the case where we could not successfully create a backend on any GPU, we now log a message indicating this and return a NULL pointer This allows us to provide more descriptive error messages, as well as avoid a SEGFAULT (the function `ensure_primary_backend_renderer_and_allocator` dereferences the pointer given, which could be NULL until this patch) when these cases arise.
2021-10-05backend: drop unconditional and unused <libinput.h>Jan Beich
After 70fb21c35ba4 made libinput optional the include prevents building without libinput package installed. backend/backend.c:4:10: fatal error: 'libinput.h' file not found #include <libinput.h> ^~~~~~~~~~~~
2021-09-30backend: create renderer and allocator in wlr_backend_autocreateSimon Ser
Instead of ensuring the renderer and allocator are initialized in each backend, do it in wlr_backend_autocreate. This allows compositors to create backends without any renderer/allocator if they side-step wlr_backend_autocreate. Since the wlr_backend_get_renderer and backend_get_allocator end up calling wlr_renderer_autocreate and wlr_allocator_autocreate, it sounds like a good idea to centralize all of the opimionated bits in one place.
2021-09-07backend: wait for session to become activemuradm
2021-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-07-28backend/drm: drop get_renderer implementationSimon Ser
We can now just rely on the common code for this.
2021-07-22backend: make DRM and libinput backends optionalayaka
Co-authored-by: Simon Ser <contact@emersion.fr>
2021-05-21backend: automatically create allocatorSimon Ser
Introduce a new backend_get_allocator function that automatically creates an allocator for the backend if the backend has a renderer.
2021-05-21backend: automatically create rendererSimon Ser
If a backend accepts buffers (as indicated by get_buffer_caps) but doesn't implement get_renderer, automatically create a renderer.
2021-05-21backend: introduce wlr_backend_finishSimon Ser
This new functions cleans up the common backend state. While this currently only emits the destroy signal, this will also clean up the renderer and allocator in upcoming patches.
2021-04-28Log when WLR_BACKENDS/WLR_RENDERER is setSimon Ser
Makes it easier to figure out why a backend/renderer is picked.
2021-04-28backend: introduce backend_get_buffer_capsSimon Zeni
2021-04-12backend: move get_drm_fd to public interfaceRoman Gilg
The get_drm_fd was made available in an internal header with a53ab146f. Move it now to the public header so consumers opting in to the unstable interfaces can make use of it.
2021-01-16backend: add get_drm_fd to interfaceSimon Ser
This function allows backends to return the DRM FD they are using. This will allow the allocator and the renderer to use the right device.
2021-01-04backend/session: allow wlr_session_find_gpus to return an errorSimon Ser
Sometimes wlr_session_find_gpus will encounter an error. This is different from finding zero GPUs. On error, wlr_session_find_gpus already returns -1. However, this is casted to size_t, so callers uncorrectly assume this is a success. Instead, make wlr_session_find_gpus return a ssize_t and allow callers to handle the error accordingly.
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-11-19backend/session: operate on wlr_deviceSimon Ser
Instead of operating on FDs in {open,close}_device, operate on wlr_devices. This avoids the device lookup in wlr_session and allows callers to have access to wlr_device fields. For now, we use it to remove wlr_session_signal_add and replace it with a more idiomatic wlr_session.events.change field. In the future, other events will be added.
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-01-10Drop RDP backendDrew DeVault
Users interested in remote access to wlroots compositors should use wayvnc: https://github.com/any1/wayvnc
2020-01-08Allow WLR_RDP_PORT to be any valid TCP/UDP port numberJason
2019-11-18backend: Do not attempt DRM on X11/WL failureScott Anderson
This can really mess with the session if logind is not being used, and it's going to always fail anyway.
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration.
2019-04-08Add FreeRDP backend for remote desktop supportDrew DeVault
2019-01-17Introduce noop backendRyan Dwyer
The noop backend is similar to headless, but it doesn't contain a renderer. It can be used as a place to stash views for when there's no physical outputs connected.
2018-11-12Use #if instead of #ifdef for wlroots config dataemersion
This prevents some annoying issues when e.g. not including wlr/config.h or making a typo in the guard name.
2018-10-13backend: fix use-after-free in wlr_backend_autocreateemersion
Found by clang static analyzer.
2018-10-04Rename get_present_clock to get_presentation clock, use itemersion
2018-10-04backend: add get_present_clockemersion
2018-09-24Rework session handlingnyorain
Sessions can now be retrieved from a backend in a more general manner. Multi-backend gets back its `session` field that contains the session if one was created, removing the interfacing from multi backend with the drm backend directly. This adds the possibility to use sessions even without the drm backend. It additionally fixes the bug that 2 session objects got created when WLR_BACKENDS were set to "libinput,drm". To allow vt switching without drm backend (and drm fd) on logind, start listening to PropertiesChanged signals from dbus and parse the session "Active" property when no master fd was created (this does not change current drm backend behaviour in any way).
2018-07-21Revert "Merge pull request #1153 from emersion/include-config"Drew DeVault
This reverts commit ef0a6ea4d2934ec014d791150c42348061ec4f7f, reversing changes made to 8d03bc9178d8544cbcd24293ece6ac9f1698e602.
2018-07-21Always include config.hemersion
2018-07-09util: add wlr_ prefix to log symbolsemersion
2018-06-30backend autocreate: fix leak when WLR_BACKENDS is setDominique Martinet
Found through static analysis
2018-05-25backends: implement custom EGL and renderer initializationIlia Bozhinov
Compositors now have more control over how the backend creates its renderer. Currently all backends create an EGL/GLES2 renderer, so the necessary attributes for creating the context are passed to a user-provided callback function. It is responsible for initializing provided wlr_egl and to return a renderer. On fail, return 0. Fixes #987
2018-05-19backend: support creating DRM and libinput via WLR_BACKENDSemersion
2018-05-19backend: allow multiple backends in WLR_BACKENDSemersion
2018-05-19backend: add WLR_BACKEND env variableemersion
2018-04-08backend: remove wlr_backend_get_eglemersion
2018-04-04Add ifdef to build without X11Tancredi Orlando
2018-04-03Implement input inhibit in rootstonDrew DeVault