Commit Graph

139 Commits

Author SHA1 Message Date
Simon Ser 78c76ddd09 backend: add wlr_backend_{test,commit}() 2024-03-14 22:03:10 +00:00
Simon Ser 967e788bc8 backend/session: add docs 2024-02-01 16:08:47 +01:00
Simon Ser f27808b8d9 backend/multi: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser 54f9944b48 backend/drm: drop wl_display argument
We can grab the event loop from the wlr_session instead.
2024-01-25 15:05:36 +00:00
Simon Ser b62ac611c8 backend/x11: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser ed0bba581b backend/wayland: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser f5e8fa48f3 backend/libinput: drop wl_display argument
We can grab the event loop from the wlr_session instead.
2024-01-25 15:05:36 +00:00
Simon Ser 682dbf36e5 backend/headless: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser fc7a0b93dd backend/drm: add wlr_drm_backend_get_parent()
Allows compositors to figure out whether a DRM backend is
secondary on a multi-GPU setup.
2023-12-12 14:42:52 +00:00
Simon Ser 63792b38e4 backend/session: take wl_event_loop instead of wl_display
wl_display holds a lot more than wlr_session needs: wlr_session
only needs to wait for a FD to become readable, but wl_display
provides full access to the Wayland client and protocol objects.

Switch to wl_event_loop to better reflect the above.
2023-11-23 11:15:07 +00:00
Simon Ser 1c24b1182b backend: drop wlr_backend_get_presentation_clock()
We can just assume CLOCK_MONOTONIC everywhere.

Simplifies the backend API, and fixes clock mismatches when multiple
backends are used together with different clocks.
2023-10-30 18:39:39 +01:00
Simon Ser 8678633fc9 backend/wayland: add wlr_wl_output_create_from_surface()
By using this function, a compositor can display a wlroots
compositor in a sub-surface, for instance.
2023-08-16 16:39:52 +02:00
Simon Ser dd24991c9e backend/wayland: take existing wl_display in wlr_wl_backend_create()
This allows compositors to use an existing wl_display, to integrate
wlroots with an existing toolkit.
2023-08-16 16:29:09 +02:00
Simon Ser 30aca4df0d backend/drm: introduce wlr_drm_mode_get_info()
This allows compositors to get back the raw drmModeModeInfo and
look at DRM-specific fields and flags.
2023-05-31 22:37:12 +00:00
Simon Ser 3f0487d310 backend/drm: move forward decl up for drmModeModeInfo
This allows doc generators to properly associate the doc comment
with the function instead of the typedef.
2023-05-31 00:08:49 +00:00
zccrs 5602fb1373 backend/wayland: fix undefined reference to wlr_wl_input_device_get_seat
Amend b7e9ad79 to remove wlr_wl_input_device_get_seat definition.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3611
2023-03-20 09:49:54 +08:00
Simon Ser d47016abb2 backend/multi: stop pulling <wlr/backend/session.h>
Unused.
2022-11-24 21:50:28 +00:00
Simon Ser ba13f471ea backend/session: drop unused <libudev.h>
We don't actually need to pull that header here.
2022-11-24 21:50:28 +00:00
Simon Ser e7c556fcf6 backend: drop wlr_backend_get_session()
This no longer has purpose.
2022-11-15 21:16:25 +00:00
Simon Ser 28d89779af Reformat doc comments
Unify the way we document our APIs. See CONTRIBUTING.md for the
rules.
2022-05-25 14:22:58 +00:00
Simon Zeni cfed039c9a types/wlr_input_device: move init and finish function to private API 2022-03-07 16:37:41 +00:00
Simon Zeni 7d560df90e backend/headless: remove unused wlr_headless_input_device 2022-02-21 17:11:32 +00:00
Simon Zeni 1d3dd7fc08 backend: remove noop backend 2021-11-25 16:49:05 +00:00
Simon Ser b234edcf58 backend/headless: drop wlr_headless_backend_create_with_renderer
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-25 16:16:04 +01:00
Simon Ser 86f5ecf468 backend/drm: introduce wlr_drm_lease
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3183
2021-11-19 16:06:07 +00:00
Simon Ser a37f538ca0 Introduce WLR_DEVICE_LEASE events
This will allow the DRM backend to reload its lessee list.
2021-11-19 16:06:07 +00:00
Simon Zeni fdf3169b41 backend: remove wlr_backend_get_renderer 2021-11-18 09:37:57 -05:00
Simon Ser 2ff4e113e2 backend/session: introduce wlr_device_change_event
This struct contains additional information for session device
change events, such as the DRM connector ID that has changed.
2021-11-02 13:30:51 +01:00
Simon Ser 2e12de96ca backend/drm: add support for panel orientation
Expose the panel orientation with wlr_drm_connector_get_panel_orientation.
Leave it to the compositor to consume this information and configure the
output accordingly.

Closes: https://github.com/swaywm/wlroots/issues/1581
2021-09-21 11:40:37 -06:00
Simon Zeni 94ed8f9496 backend/drm: introduce wlr_drm_backend_get_non_master_fd 2021-09-08 11:09:07 +02:00
Simon Zeni e5a949a955 backend/drm: implement drm lease function 2021-09-08 11:09:07 +02:00
Simon Ser 7ec5bf6b10 backend: introduce wlr_backend_finish
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-05-21 22:13:54 +02:00
Simon Zeni 144189674e backend: introduce backend_get_buffer_caps 2021-04-28 20:55:57 +02:00
Simon Ser 5597776914 backend/session: add wlr_device.events.remove 2021-04-27 09:11:44 +02:00
Kenny Levinsen 7f09085461 backend/session: Remove session_impl
libseat provides all session functionality, so there is no longer need
for a session backend abstraction. The libseat device ID, seat handle
and event loop handle are moved to the main wlr_session and wlr_device
structs.
2021-04-14 23:25:07 +02:00
Kenny Levinsen d50bbf0bbc backend/session: Remove logind backend
This is instead delegated to libseat.
2021-04-11 10:03:13 +02:00
Simon Ser f17b0f975d backend/drm: add wlr_drm_connector_get_id
This allows a compositor to get a KMS connector object ID from a
wlr_output. The compositor can then query more information about
the connector via libdrm.

This gives more freedom to compositors and allows them to read
KMS properties that wlroots doesn't know about. For instance,
they could read the EDID or the suggested_{X,Y} properties and
change their output configuration based on that.
2021-01-17 12:42:32 +01:00
Simon Ser a53ab146fe backend: add get_drm_fd to interface
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-16 08:57:42 +01:00
Simon Zeni 9192c0480a remove unnecessary egl includes 2021-01-07 17:11:22 +01:00
Simon Ser e8d56ca415 backend/session: allow wlr_session_find_gpus to return an error
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.
2021-01-04 19:46:44 +01:00
Simon Ser 4b03bdc3ab Remove wlr_create_renderer_func_t
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-30 17:09:40 +01:00
Simon Ser 0e76f92de7 backend/session: replace session_signal with events.active
This is more idiomatic wlroots API. The new name makes it clear that the
signal is emitted when wlr_session.active changes.
2020-11-19 22:47:49 +01:00
Simon Ser fbf11a41e1 backend/session: wait for DRM device if none found
Wait for a DRM device if none is found in wlr_session_find_gpus. This
can happen if the compositor is loaded before the display kernel driver.

This supersedes the logind CanGraphical property.

To test, e.g. with i915 and sway:

    rmmod -f i915
    sway &
    modprobe i915

Closes: https://github.com/swaywm/wlroots/issues/2093
2020-11-19 22:47:49 +01:00
Simon Ser 76bcddf071 backend/session: introduce wlr_session.events.add_drm_card
This is triggered when a new DRM card is added.

An easy way to test this patch is `modprobe vkms`.
2020-11-19 22:47:49 +01:00
Simon Ser 44a4792fd8 backend/session: operate on wlr_device
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-11-19 22:47:49 +01:00
Simon Ser 6129a6f93e backend/headless: add wlr_headless_backend_create_with_renderer
This allows one to create a headless backend with an existing renderer.
2020-04-22 22:40:54 +02:00
Drew DeVault ebdbe177d6 Drop RDP backend
Users interested in remote access to wlroots compositors should use
wayvnc:

https://github.com/any1/wayvnc
2020-01-10 19:38:39 +01:00
Scott Anderson cff1c2f740 meson: Various improvements
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-12-23 07:48:29 -05:00
Simon Ser cde544de81 backend/wayland: expose remote objects
Expose the remote wl_display, wl_surface and wl_seat used by the Wayland
backend.

This allows compositors to customize the Wayland backend and to have
more freedom. For instance a compositor might want to handle clipboard
and drag-and-drop from the remote Wayland compositor. Another compositor
might want to setup pointer constraints.
2019-11-13 10:15:28 -05:00
Simon Ser 0e57effd38 backend/drm: add support for custom modes
Use the CVT algorithm to create a drmModeModeInfo.
2019-10-27 10:46:47 -04:00