aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
AgeCommit message (Collapse)Author
2023-05-15backend_destroy: Similiar logic like DRM backendTobias Predel
In the logic of the DRM backend in backend_destroy, wlr_backend_finish is called first, then the outputs are destroyed and then the display->destroy.link is removed from the list. This commit applies the same order to the headless backend.
2023-02-21backend/headless: unconditionally accept all output layersSimon Ser
We don't need to do anything special to handle these.
2022-10-13backend: use global output name countersSimon Ser
The output names must be globally unique per the Wayland spec, even if the compositor creates multiple backends of the same kind.
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2022-05-30output: pass wlr_output_state to backendSimon Ser
Groundwork for the following commits. The goal is to allow users to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-26output: turn make/model/serial into char *Simon Ser
This allows the make/model/serial to be NULL when unset, and allows them to be longer than the hardcoded array length. This is a breaking change: compositors need to handle the new NULL case, and we stop setting make/model to useless "headless" or "wayland" strings.
2022-05-10backend/headless: allow variable refresh rateSimon Ser
Instead of waking up each 16ms to emit a frame event, arm the timer when the output is committed. This allows the headless backend to idle when nothing changes on screen, and behaves similarly to the other backends.
2022-02-22interfaces: remove wlr_input_device_implSimon Zeni
2022-02-21backend/headless: remove unused wlr_headless_input_deviceSimon Zeni
2021-12-09Fix incorrect %zd formatting directivesSimon Ser
%zd is for ssize_t. For size_t we should use %zu.
2021-12-09output: introduce wlr_output_set_nameSimon Ser
wlroots picks names for all outputs, but it might be desirable for compositor to override it. For instance, Sway will use a headless output as a fallback in case no outputs are connected. Sway wants to clearly label the fallback output as such and label "real" headless outputs starting from HEADLESS-1.
2021-11-25backend/headless: drop wlr_headless_backend_create_with_rendererSimon Ser
The headless backend no longer needs a parent renderer: it no longer needs to return it in wlr_backend_impl.get_renderer, nor does it need to return its DRM FD in wlr_backend_impl.get_drm_fd. Drop this function altogether since it now behaves exactly like wlr_headless_backend_create.
2021-11-25backend/headless: stop picking a DRM FDSimon Ser
Sometimes the headless backend is used standalone with the Pixman renderer, sometimes it's used together with another backend which has already picked a DRM FD. In both of these cases it doesn't make sense to pick a DRM FD. Broadly speaking the headless backend doesn't really care which DRM device is used for the buffers it receives. So it doesn't really make sense to tie it to a particular DRM device. Let the backend users (e.g. wlr_renderer_autocreate) open an arbitrary DRM FD as needed instead.
2021-11-23input-device: remove wlr_input_device.linkSimon Ser
This field's ownership is unclear: it's in wlr_input_device, but it's not managed by the common code, it's up to each individual backend to use it and clean it up. Since this is a backend implementation detail, move it to the backend-specific structs.
2021-11-18backend/headless: don't store the parent rendererSimon Zeni
2021-11-15backend/headless: unlink input device on destroyRoman Gilg
Removing an input device requires unlinking it from the list of all headless input devices. For that implement a destroy function.
2021-10-15output: add presented flag to presentation eventKirill Primak
2021-10-15output: disallow NULL event for wlr_output_send_present()Kirill Primak
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-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-07-12backend/headless: remove wlr_output_impl.export_dmabufSimon Ser
This is now provided by the generic wlr_output implementation.
2021-07-01buffer: make enum wlr_buffer_cap publicSimon Ser
Custom backends and renderers need to implement wlr_backend_impl.get_buffer_caps and wlr_renderer_impl.get_render_buffer_caps. They can't if enum wlr_buffer_cap isn't made public.
2021-06-20backend: add output state allow-listsSimon Ser
Right now, when a new output state field is added, all backends by default won't reject it. This means we need to add new checks to each and every backend when we introduce a new state field. Instead, introduce a bitmask of supported output state fields in each backend, and error out if the user has submitted an unknown field. Some fields don't need any backend involvment to work. These are listed in WLR_OUTPUT_STATE_BACKEND_OPTIONAL as a convenience.
2021-06-07backend/headless: remove swapchainSimon Ser
Rely on wlr_output's generic swapchain support instead of creating our own. The headless output now simply keeps a reference to the front buffer and does nothing else.
2021-05-21backend/headless: use common renderer and allocatorSimon Ser
Instead of managing our own renderer and allocator, let the common code do it. Because wlr_headless_backend_create_with_renderer needs to re-use the parent renderer, we have to hand-roll some of the renderer initialization.
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-29backend/headless: dup DRM FD in wlr_headless_backend_create_with_rendererSimon Ser
We were not dup'ing the DRM FD coming from wlr_renderer_get_drm_fd, resulting in a double-close on backend destroy.
2021-04-28backend: use wlr_allocator_autocreateSimon Zeni
2021-04-28backend: introduce backend_get_buffer_capsSimon Zeni
2021-04-28render/gbm_allocator: make wlr_gbm_allocator_create return a wlr_allocatorSimon Zeni
2021-04-26Log drmGetDevices2 error codeSimon Ser
2021-04-15render: rename get_dmabuf_render_formats into get_render_formatsSimon Zeni
2021-02-18backend: add error messages in attach_render implsSimon Ser
2021-01-17backend/headless: create renderer after wlr_backend_initSimon Ser
We were calling wlr_renderer_autocreate before wlr_backend_init, which caused a NULL dereference on wlr_backend.impl.
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/headless: implement get_drm_fdSimon Ser
2021-01-14backend: remove unnecessary GLES2 includesSimon 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-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-16backend/headless: select the rendering device ourselvesSimon Ser
Backends will eventually stop creating their renderer. To prepare for this, stop using EGL_PLATFORM_SURFACELESS_MESA in the headless renderer. Pick a render node using libdrm. The new allocator/renderer creation logic looks very much like what will end up in common code.
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-08backend/headless: add support for direct scan-outSimon Ser
I was about to add a check to fail instead of crash when the compositor uses direct scan-out, but with renderer v6 it's so simple to just add support for direct scan-out, why bother? Closes: https://github.com/swaywm/wlroots/issues/2523
2020-12-07backend/headless: create a config-less EGL contextSimon Ser
2020-11-30backend/headless: use a format suitable for renderingSimon Ser
When allocating buffers, use a format suitable for rendering. This avoids picking a format that won't work.
2020-11-15backend/headless: implement export_dmabufSimon Ser