aboutsummaryrefslogtreecommitdiff
path: root/include/wlr/interfaces
AgeCommit message (Collapse)Author
2023-08-16wlr_output: Nuke wlr_output_update_enabledAlexander Orzechowski
2023-08-16wlr_output: Make wlr_output_update_{custom,}_mode privateAlexander Orzechowski
Backends should be using wlr_output_send_request_state to request modesets to the compositor. This will be inlined and removed next commit.
2023-08-16output: Add initialization state to wlr_output_initAlexander Orzechowski
2023-02-20Add wlr_output_layerSimon Ser
This is based on previous work [1] [2]. This new API allows compositors to display buffers without needing to perform rendering operations. This API can be implemented on Wayland using subsurfaces and on DRM using KMS planes. Compared to [1], this approach leverages wlr_addon_set to let backends attach their own private state to layers, removes the pending state (necessary for interop with wlr_output_commit_state()) and enum wlr_output_layer_state_field. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1985 [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3447
2022-11-17output: drop wlr_output_damage_whole()Simon Ser
This function is not used anymore. Backends have no good reason to damage outputs.
2022-11-15output: introduce request_state eventSimon Ser
This allows backends to request the compositor to change the state of an output. References: https://github.com/swaywm/wlroots/issues/2300#issuecomment-761819673
2022-08-30output: fail commits if adaptive sync cannot be enabledSimon Ser
Previously, adaptive sync was just a hint and wouldn't make any atomic commit fail if the backend didn't support it. The main reason is wlr_output_test wasn't supported at the time. Now that we have a way for compositors to test whether a change can work, let's remove the exception for adaptive sync and convert it to a regular output state field.
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-25Reformat doc commentsSimon Ser
Unify the way we document our APIs. See CONTRIBUTING.md for the rules.
2022-03-17types/wlr_keyboard: uniformize events nameSimon Zeni
2022-03-16types/wlr_output: Handle subpixel hints through output commitsAlexander Orzechowski
2022-03-07interface/wlr_touch: rework destroy sequenceSimon Zeni
The destroy callback in wlr_touch_impl has been removed. The function `wlr_touch_finish` has been introduced to clean up the resources owned by a wlr_touch. `wlr_input_device_destroy` no longer destroys the wlr_touch, attempting to destroy a wlr_touch will result in a no-op. The field `name` has been added to the wlr_touch_impl to be able to identify a given wlr_touch device.
2022-03-07interface/wlr_tablet_tool: rework destroy sequenceSimon Zeni
The destroy callback in wlr_tablet_tool_impl has been removed. The function `wlr_tablet_tool_finish` has been introduced to clean up the resources owned by a wlr_tablet_tool. `wlr_input_device_destroy` no longer destroys the wlr_tablet_tool, attempting to destroy a wlr_tablet_tool will result in a no-op. The field `name` has been added to the wlr_tablet_tool_impl to be able to identify a given wlr_tablet_tool device.
2022-03-07interface/wlr_tablet_pad: rework destroy sequenceSimon Zeni
The destroy callback in wlr_tablet_pad_impl has been removed. The function `wlr_tablet_pad_finish` has been introduced to clean up the resources owned by a wlr_tablet_pad. `wlr_input_device_destroy` no longer destroys the wlr_tablet_pad, attempting to destroy a wlr_tablet_pad will result in a no-op. The field `name` has been added to the wlr_tablet_pad_impl to be able to identify a given wlr_tablet_pad device.
2022-03-07interface/wlr_switch: rework destroy sequenceSimon Zeni
The destroy callback in wlr_switch_impl has been removed. The function `wlr_switch_finish` has been introduced to clean up the resources owned by a wlr_switch. `wlr_input_device_destroy` no longer destroys the wlr_switch, attempting to destroy a wlr_switch will result in a no-op. The field `name` has been added to the wlr_switch_impl to be able to identify a given wlr_switch device.
2022-03-07interface/wlr_pointer: rework destroy sequenceSimon Zeni
The destroy callback in wlr_pointer_impl has been removed. The function `wlr_pointer_finish` has been introduced to clean up the resources owned by a wlr_pointer. `wlr_input_device_destroy` no longer destroys the wlr_pointer, attempting to destroy a wlr_pointer will result in a no-op. The field `name` has been added to the wlr_pointer_impl to be able to identify a given wlr_pointer device.
2022-03-07interface/wlr_keyboard: rework destroy sequenceSimon Zeni
The destroy member in wlr_keyboard_impl has been removed. The function `wlr_keyboard_finish` has been introduce to clean up the resources owned by a wlr_keyboard. `wlr_input_device_destroy` no longer destroys the wlr_keyboard, attempting to destroy a wlr_keyboard will result in a no-op. The field `name` has been added to the wlr_keyboard_impl to be able to identify a given wlr_keyboard device.
2022-03-03buffer: extract interface to separate headerSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3389
2022-02-22interfaces: remove wlr_input_device_implSimon Zeni
2022-02-21types/wlr_switch: constify implSimon Zeni
2022-02-21types/wlr_tablet_pad: constify implSimon Zeni
2022-02-21types/wlr_touch: add base wlr_input_deviceSimon Zeni
wlr_touch now owns its wlr_input_device. It will be initialized when the tablet tool is initialized, and finished when the touch is destroyed.
2022-02-21types/wlr_tablet_tool: add base wlr_input_deviceSimon Zeni
wlr_tablet_tool owns its wlr_input_device. It will be initialized when the tablet tool is initialized, and finished when the tablet tool is destroyed.
2022-02-21types/wlr_tablet_pad: add base wlr_input_deviceSimon Zeni
wlr_tablet_pad owns its wlr_input_device. It will be initialized when the tablet pad is initialized, and finished when the tablet pad is destroyed.
2022-02-21types/wlr_switch: add base wlr_input_deviceSimon Zeni
wlr_switch owns its wlr_input_device. It will be initialized when the switch is initialized, and finished when the switch is destroyed.
2022-02-21types/wlr_pointer: add base wlr_input_deviceSimon Zeni
wlr_pointer owns its wlr_input_device. It will be initialized when the pointer is initialized, and finished when the pointer is destroyed.
2022-02-21types/wlr_keyboard: add base wlr_input_deviceSimon Zeni
wlr_keyboard owns its base wlr_input_device. It will be initialized when the keyboard is initialized, and finished when the keyboard is destroyed.
2022-02-21types/wlr_input_device: call the specialized input device destroy function ↵Simon Zeni
on destroy In case the `wlr_input_device` is not owned by a specialized input device, the function will finish the wlr_input_device and call it's implementation destroy function if an implementation has been supplied, or simply free it.
2022-02-21interfaces/wlr_input_device: introduce wlr_input_device_finishSimon Zeni
This function releases the wlr_input_device allocated memory (it's name and it's output name), and signals its destroy event.
2022-02-21types/wlr_input_device: default vendor and product id to 0Simon Zeni
vendor and product id are set when needed by the libinput backend
2021-11-30output: fix typo in wlr_output_impl.get_primary_formats docsSimon Ser
The buffer capabilities indicate whether the formats returned are for DMA-BUFs or shared memory buffers.
2021-11-19output: Add function to set preferred render formatManuel Stoeckl
This change introduces new double buffered state to the wlr_output, corresponding to the buffer format to render to. The format being rendered to does not control the bit depth of colors being sent to the display; it does generally determine the format with which screenshot data is provided. The DRM backend _may_ sent higher bit depths if the render format depth is increased, but hardware and other limitations may apply.
2021-07-29output: drop wlr_output_impl.{attach,rollback}_renderSimon Ser
No backend uses these anymore.
2021-07-12output: remove wlr_output_impl.export_dmabufSimon Ser
No backend is using it anymore.
2021-07-06move wlr_box from /types to /utilSimon Zeni
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-07output: make attach_render and rollback_render optionalSimon Ser
If these aren't provided by the backend, allocate a swapchain for the output.
2021-06-07output: add get_primary_formats to interfaceSimon Ser
This function returns the set of formats the backend can use for the primary buffer. It can be used to allocate a buffer suitable for scan-out.
2021-06-02output: take a wlr_buffer in set_cursorSimon Ser
Instead of passing a wlr_texture to the backend, directly pass a wlr_buffer. Use get_cursor_size and get_cursor_formats to create a wlr_buffer that can be used as a cursor. We don't want to pass a wlr_texture because we want to remove as many rendering bits from the backend as possible.
2021-06-02output: add get_cursor_formats and get_cursor_size to interfaceSimon Ser
2021-03-09output: document hotspot coord spaceSimon Ser
2021-02-05Make implementation function lists static constManuel Stoeckl
This requires a change to the type of `struct wlr_tablet` and `wlr_tablet_init` signature, both of which are part of the unstable API.
2020-06-30output: add backend docsSimon Ser
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-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-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-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-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-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