aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2021-01-04backend/wayland: re-use cursor wl_buffersSimon Ser
We were importing cursor buffers as wl_buffers over and over again. Instead, only import these once.
2021-01-04examples: request an EGL configSimon Ser
Client examples using wlr_egl would fail with EGL_BAD_CONFIG because they need an EGL config. Set the config attribs to a non-NULL value to make sure wlr_egl creates an EGL config. Fixes: 037710b1d428 ("render/egl: support config-less wlr_egl")
2021-01-04examples: remove visual for EGL_PLATFORM_WAYLAND_EXTSimon Ser
The Wayland EGL platform doesn't have visuals.
2021-01-03backend/drm: stash pending page-flip CRTCSimon Ser
wlr_drm_connector.crtc may be updated by the DRM backend while a page-flip is pending. In this case, the page-flip handler won't be able to find the right wlr_drm_connector from the CRTC ID. Save the CRTC when performing a page-flip to ensure we always find the right connector when we get the event.
2021-01-03backend/drm: ignore hotplug events while inactiveSimon Ser
When the session is inactive, we can't change the KMS state. Ignore hotplug events so that compositors don't try to perform a modeset when a connector is plugged in. We already re-scan connectors when the session becomes active. To test, run a wlroots compositor on VT 1, switch to VT 2, unplug a connector, re-plug it, switch back to VT 1. Without this patch the screen is black on VT 1. References: https://github.com/swaywm/wlroots/issues/2370
2020-12-31noop: listen to display destroy and destroy the backendIlia Bozhinov
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-30backend/drm: remove special linear case for cursor planeSimon Ser
We now properly mark the cursor plane's formats as linear-only, and we now have a version of wlr_drm_format_intersect that handles the case of linear-only formats and implicit modifiers. We can remove the special drm_plane_init_surface flag we had for cursor planes. This also allows us to use a non-linear layout for cursor planes on drivers that support it. Tested on amdgpu GFX9.
2020-12-30backend/drm: extract linear format creation into functionSimon Ser
Simplifies error handling.
2020-12-30render/drm_format_set: add special case for LINEAR-only formatsSimon Ser
Our wlr_format_set structs don't hold GBM usage flags. Instead, users who want to get a LINEAR buffer can use the DRM_FORMAT_MOD_LINEAR modifier even if the kernel driver doesn't support modifiers. Add a special case to wlr_drm_format_intersect to properly handle this situation.
2020-12-30backend/drm: force LINEAR for cursor plane formatsSimon Ser
If the kernel driver doesn't support modifiers, it still expects cursor FBs to have a LINEAR layout. See [1] for expectations for framebuffers attached to the cursor plane. [1]: https://patchwork.freedesktop.org/patch/408512/
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-28drm: add fallback drmModeAddFB for drivers which do not support drmModeAddFB2Ariadne Conill
This makes wlroots able to run on some big-endian machines like G4 and G5 systems with ATI Radeon 7500 AGP graphics.
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-25backend/drm: make listener names more idiomaticSimon Ser
Use the "<object>_<event>" notation for listeners, use "handle_<listener>" for handlers.
2020-12-25Stop using wlr_texture_get_sizeSimon Ser
Just use wlr_texture.{width,height} directly.
2020-12-25client-buffer: remove unnecessary wlr_resource_get_buffer_sizeSimon Ser
We can just get the size from the imported texture.
2020-12-24backend/drm: use connector log helpers in atomic backendSimon Ser
2020-12-24backend/drm: make drmModePlane arg in add_plane constSimon Ser
Make it clearer it'll be free'd after add_plane returns.
2020-12-24backend/drm: add special case for cursor in add_planeSimon Ser
The code calling add_plane now makes sure not to add a cursor plane to a CRTC which already has one.
2020-12-24backend/drm: log whether ADDFB2 modifiers are supportedSimon Ser
2020-12-24docs/env_vars: document seatd sessionSimon Ser
2020-12-24docs/env_vars: _WAYLAND_DISPLAY isn't used anymoreSimon Ser
2020-12-24Remove contrib/_incr_versionSimon Ser
Not used anymore.
2020-12-23backend/drm: don't retry page-flip when modifiers are unsupportedSimon Ser
Parse WLR_DRM_NO_MODIFIERS at startup. Don't parse IN_FORMATS when WLR_DRM_NO_MODIFIERS is set, so that the legacy behaviour is better reproduced. When modifiers aren't supported, try the initial page-flip once only.
2020-12-23backend/drm: use plural form for possible_crtcsSimon Ser
Make it clearer that this is a bitmask of CRTC indices.
2020-12-22backend/drm: assert connector state after wlr_output_destroySimon Ser
2020-12-22backend/drm: destroy DRM connectors that disappearSimon Ser
This was lost during the refactoring. We were previously calling wlr_output_destroy, which destroyed the connector as well. Fixes: 248c7787c7b4 ("backend/drm: refactor wlr_output destruction")
2020-12-22subsurface: handle NULL parent in get_root_surfaceIsaac Freund
2020-12-22backend/drm: error on size mismatch in drm_surface_blitSimon Ser
2020-12-22backend/drm: remove drm_fb_acquireSimon Ser
Instead, import the buffer into GBM and KMS in drm_fb_import. Also move the multi-GPU copy there if necessary.
2020-12-22backend/drm: make drm_fb_acquire return a FB IDSimon Ser
2020-12-22backend/drm: drop export_drm_boSimon Ser
Not used anymore.
2020-12-22backend/drm: grab DMA-BUF from wlr_buffer instead of gbm_boSimon Ser
Get the DMA-BUF directly out of the wlr_buffer instead of relying on the gbm_bo. This eliminates a roundtrip through GBM.
2020-12-22backend/drm: don't save texture in gbm_bo user dataSimon Ser
The GBM BO is destroyed when released anyways.
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-21backend/wayland: re-use wl_buffersSimon Ser
Instead of re-importing a buffer each time we submit a new frame, re-use the wl_buffer objects if possible.
2020-12-19backend/wayland: remove EGL configSimon Ser
We don't use EGLSurface anymore, so we don't need to choose an EGL config anymore.
2020-12-19xwayland: avoid crash on repeated server_finish_display() callIsaac Freund
This function may end up being called more than once if the Xwayland binary does not exist on the system.
2020-12-18backend/drm: avoid gcc stringop-truncation warningRonan Pigott
2020-12-18backend/drm: remove unused wlr_drm_plane.drm_formatSimon Ser
2020-12-18backend/drm: refactor wlr_output destructionSimon Ser
Instead of hand-rolling our own manual wlr_output cleanup function, rely on wlr_output_destroy to remove an output from the compositor's state.
2020-12-18backend/drm: introduce wlr_drm_connector.nameSimon Ser
The DRM backend is a little special when it comes to wlr_outputs: the wlr_drm_connectors are long-lived and are created even when no screen is connected. A wlr_drm_connector only advertises a wlr_output to the compositor when a screen is connected. As such, most of wlr_output's state is invalid when the connector is disconnected. We want to stop using wlr_output state on disconnected connectors. Introduce wlr_drm_connector.name which is always valid regardless of the connector status to avoid reading wlr_output.name when disconnected.
2020-12-18backend/drm: introduce wlr_drm_conn_logSimon Ser
Simplify and unify connector-specific logging with a new wlr_drm_conn_log macro. This makes it easier to understand which connector a failure is about, without having to explicitly integrate the connector name in each log message.
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-18util/time: add timespec_from_nsecSimon Ser