aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-05util/shm: add allocate_shm_file_pairSimon Ser
This function behaves like allocate_shm_file, except it also returns a read-only FD. This is useful to share the same segment of memory with many Wayland clients.
2021-09-03render/allocator/gbm: add log message for gbm_bo_get_fd_for_planeSimon Ser
Makes it easier to find out which branch is taken when debugging issues like [1]. [1]: https://github.com/swaywm/wlroots/issues/3156
2021-09-03backend/drm: handle drm_surface_blit errorsSimon Ser
drm_surface_blit returns NULL on error. This can happen e.g. when the source buffer cannot be imported into EGL. Closes: https://github.com/swaywm/wlroots/issues/3154
2021-09-03render/allocator: use legacy authentication for primary nodesSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/3156
2021-09-02scene: remove redundant empty-region check in render_texture()Devin J. Pohly
2021-09-02examples/scene-graph: demonstrate scene_rect node typeDevin J. Pohly
Add RECT nodes to the scene-graph demo to illustrate how they are used. Here, we add a solid rectangle behind each surface as a quick-and-dirty border, handling surface.commit in order to size it appropriately.
2021-09-02scene: replace surface_at() with node_at()Devin J. Pohly
With the addition of a non-surface node type, it was unclear how such nodes should interact with scene_node_surface_at(). For example, if the topmost node at the given point is a RECT, should the function treat that node as transparent and continue searching, or as opaque and return (probably) NULL? Instead, replace the function with one returning a scene_node, which will allow for more consistent behavior across different node types. Compositors can downcast scene_surface nodes via the now-public wlr_scene_surface_from_node() if they need access to the surface itself.
2021-09-02scene: add RECT node typeDevin J. Pohly
RECT is a solid-colored rectangle, useful for simple borders or other decoration. This can be rendered directly using the wlr_renderer, without needing to create a surface.
2021-09-02scene: iterate nodes instead of surfaces when renderingDevin J. Pohly
This will allow us to create node types which are rendered but not surface-based, such as a solid color or image.
2021-09-02contributing: don't reference issues in commit first lineSimon Ser
Commits named "Fix #XXX" make it pretty complicated to figure out exactly what the commit is doing from the shortlog. A better place for issue references is in the extended commit message.
2021-09-01build: add subproject fallback for wayland-protocolsSimon Ser
Depends on [1]. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/84
2021-09-01build: add subproject fallback for waylandSimon Ser
2021-09-01render/allocator/gbm: fix create() docs for FD ownershipSimon Ser
Fixes: d9d8fc1ab9b7 ("render/allocator: re-open GBM FD")
2021-09-01render/allocator: re-open GBM FDSimon Ser
Using the same DRM file description for the DRM backend and for the GBM allocator will result in GEM handle ref'counting issues [1]. Re-open the DRM FD to fix these issues. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
2021-08-30Link to gamja for web chatSimon Ser
gamja offers a better experience than Kiwi.
2021-08-30scene: stricter assertions on reparentDevin J. Pohly
For consistency with the rest of the scene-graph API, prevent detaching a subtree by giving NULL for the new parent, and don't allow ROOT nodes to be grafted into another tree.
2021-08-30scene: make graph loops fatal when debuggingDevin J. Pohly
2021-08-30scene: ensure node cannot be reparented below itselfDevin J. Pohly
2021-08-30scene: add node reparent functionDevin J. Pohly
If nodes are arranged in a tree rather than at a single level, then it makes sense that there should be a way to move them to a completely different parent in addition to moving up or down among siblings.
2021-08-30contributing: turn remaining links into refsSimon Ser
2021-08-30contributing: clone wlroots fork with SSHSimon Ser
HTTPS URLs aren't writable.
2021-08-30contributing: use references for linksSimon Ser
This avoids cluttering the prose with URLs.
2021-08-30contributing: add new section about commit logSimon Ser
This is shamelessly stolen from Weston [1]. It's been a while we've transitioned away from merge commits and work-style commit history, so it'd be nice to mention this in the docs. [1]: https://gitlab.freedesktop.org/wayland/weston/-/blob/main/CONTRIBUTING.md#formatting-and-separating-commits
2021-08-28xwm: do not restack surfaces on activationTudor Brindus
Currently, upon activating a surface, wlroots restacks it on top of all others. This may not necessarily be correct from the calling compositor's point of view, where having focus may not imply being top-of-stack (e.g., focusing a window under an always-on-top window). In Sway's case, this means that focused tiling windows will always be on top of floating windows, at least in the order communicated to X11 apps. This breaks drag-and-drop from a focused tiling X11 window to a floating X11 window which partially obscures the former. This is a breaking change; to retain the previous behavior, users that were calling wlr_xwayland_surface_activate(xsurface, true); should now be calling wlr_xwayland_surface_activate(xsurface, true); wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE);
2021-08-26scene: add wlr_scene_node_surface_atSimon Ser
2021-08-26scene: add user data pointer to wlr_scene_nodeSimon Ser
This allows compositors to attach arbitrary data to the scene-graph nodes.
2021-08-26scene: allow nodes to have arbitrary parentsSimon Ser
For instance, allow a surface node to be a child of another surface node. This allows easier xdg-popup handling in compositors.
2021-08-26scene: add wlr_scene_node_toggleSimon Ser
This allows compositors to easily enable or disable a scene-graph node. This can be used to show/hide a surface when the xdg_surface is mapped/unmapped.
2021-08-26examples/scene-graph: new exampleSimon Ser
2021-08-26Introduce new scene-graph APISimon Ser
A new wlr_scene API has been added, following the design ideas from [1]. The new API contains the minimal set of features required to make the API useful. The goal is to design a solid fundation and add more features in the future. [1]: https://github.com/swaywm/wlroots/issues/1826#issuecomment-564601757
2021-08-25subsurface: unlock surface on destroyKirill Primak
2021-08-25backend/drm: introduce wlr_drm_bo_handle_tableSimon Ser
Using GBM to import DRM dumb buffers tends to not work well. By using GBM we're calling some driver-specific functions in Mesa. These functions check whether Mesa can work with the buffer. Sometimes Mesa has requirements which differ from DRM dumb buffers and the GBM import will fail (e.g. on amdgpu). Instead, drop GBM and use drmPrimeFDToHandle directly. But there's a twist: BO handles are not ref'counted by the kernel and need to be ref'counted in user-space [1]. libdrm usually performs this bookkeeping and is used under-the-hood by Mesa. We can't re-use libdrm for this task without using driver-specific APIs. So let's just re-implement the ref'counting logic in wlroots. The wlroots implementation is inspired from amdgpu's in libdrm [2]. Closes: https://github.com/swaywm/wlroots/issues/2916 [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110 [2]: https://gitlab.freedesktop.org/mesa/drm/-/blob/1a4c0ec9aea13211997f982715fe5ffcf19dd067/amdgpu/handle_table.c
2021-08-25render/egl: reopen DRM node for GBMSimon Ser
This will be necessary for the next patch, to avoid messing up BO handles shared between the GL implementation and the DRM backend.
2021-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-08-25backend/{drm,libinput}: exclude headers when disabledSimon Ser
2021-08-25backend/drm: generate CVT reduced modesSimon Ser
The Coordinated Video Timings (CVT) spec [1] defines two types of timings: the "CVT standard CRT" timings and the "CVT reduced blanking" timings (see section 3.6). The standard CRT timings include pauses in the video stream to allow CRT displays to reposition their electron beam at the end of each horizontal scan line [2]. While this was desirable a few decades ago, nowadays we can just generate a CVT reduced blanking timing by default. wlroots users can still set full custom DRM modes via wlr_drm_connector_add_mode. [1]: https://glenwing.github.io/docs/VESA-CVT-1.2.pdf [2]: https://en.wikipedia.org/wiki/Coordinated_Video_Timings#Reduced_blanking
2021-08-24surface: fix wlr_surface_get_buffer_source_box()Kirill Primak
2021-08-24util/box: introduce wlr_fbox_transform()Kirill Primak
A floating-point version of wlr_box_transform().
2021-08-20tinywl: simplify logic for sending pointer eventsIsaac Freund
2021-08-20xwayland: Allow to retrieve _NET_STARTUP_IDGuido Günther
This is use for startup notifications per startup-notifiation spec https://specifications.freedesktop.org/startup-notification-spec/startup-notification-latest.txt
2021-08-20backend/drm: try to allocate crtc for formatsRouven Czerwinski
To retrieve the formats, an allocated crtc is required. If there is no currently no crtc available, try to allocate it. This reproducable by having a disabled output and going through a suspend cycle with amdgpu. On start CRTCs look like this: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where DP-1 is than disabled. After suspend/resume, allocation turns into: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where the crtc for DP-1 is now NULL. Trying to enable the output results in: 10:43:36.906 [DEBUG] [sway/config/output.c:351] Turning on output DP-1 10:43:36.906 [DEBUG] [sway/config/output.c:360] Set preferred mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [sway/config/output.c:366] Preferred mode rejected, falling back to another mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [sway/config/output.c:400] Auto-detected output scale: 1.000000 10:43:36.907 [DEBUG] [sway/config/output.c:430] Committing output DP-1 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [ERROR] [sway/config/output.c:435] Failed to commit output DP-1 where the primary format can't be queried since there is no crtc allocated for the connector. Allocating the connector inside drm_connector_get_primary_formats() fixes this issue. This is possible since the only user of get_primary_formats() is the swapchain allocation function, which is only called on output enable. Do the same thing for the cursor formats in case the user queries them before the output is enabled.
2021-08-19backend: unify startup messagesSimon Ser
2021-08-18backend/drm: add support for FB_DAMAGE_CLIPSSimon Ser
This allows the kernel to access our buffer damage. Some drivers can take advantage of this, e.g. for PSR2 panels (Panel Self Refresh) or for transfer over USB. Closes: https://github.com/swaywm/wlroots/issues/1267
2021-08-18surface: fix place_below handlingKirill Primak
If a subsurface is being placed below a subsurface right above it, this should be a noop. However, `node` pointed to the subsurface that was moved, which resulted in `subsurface->parent_pending_link` being inserted into itself, breaking parent's pending subsurface list. This commit separates finding the requested node and getting it's `prev` field, fixing the issue.
2021-08-17Revert "backend/drm: Check if output is enabled before sending frame event"Rouven Czerwinski
This reverts commit 85757665e6e1393773b36282aa244feb10b7a5fe. We now check if the output is enabled within wlr_output_send_frame, no need to handle this explicitly in the DRM backend. This also fixes a race which was introduced with this commit: if we schedule the flip, disable and commit the output before the flip happens, output.frame_pending will not be reset to false. We than always fail to enable the output subsequently: 00:07:13.276 [INFO] [sway/commands.c:257] Handling command 'output DP-2 enable' 00:07:13.276 [DEBUG] [sway/commands.c:428] Subcommand: enable 00:07:13.276 [DEBUG] [sway/config/output.c:204] Merging on top of existing output config 00:07:13.276 [DEBUG] [sway/config/output.c:227] Config stored for output DP-2 (enabled: 1) (-1x-1@-1.000000Hz position 0,0 scale -1.000000 subpixel unknown transform -1) (bg /home/phoenix/Pictures/Wallpapers/mine/oper.jpg fill) (dpms 1) (max render time: -1) 00:07:13.276 [DEBUG] [sway/config/output.c:351] Turning on output DP-2 00:07:13.276 [DEBUG] [sway/config/output.c:360] Set preferred mode 00:07:13.276 [DEBUG] [wlr] [backend/drm/drm.c:465] connector DP-2: Can't enable an output without a buffer 00:07:13.276 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 00:07:13.277 [DEBUG] [sway/config/output.c:329] Output DPI: 162.560000x161.364706 00:07:13.277 [DEBUG] [sway/config/output.c:400] Auto-detected output scale: 1.000000 00:07:13.277 [DEBUG] [sway/config/output.c:430] Committing output DP-2 00:07:13.277 [DEBUG] [wlr] [types/wlr_output.c:729] Tried to commit a buffer while a frame is pending since the basic_output_test will always fail. Reset frame_pending to false even if the output has been disabled in the meantime. Fixes https://github.com/swaywm/wlroots/issues/3109
2021-08-17output: check output enabled before sending frameRouven Czerwinski
Similar to commit 85757665e6e1 ("backend/drm: Check if output is enabled before sending frame event"), check if the output is still enabled before sending the frame event. This fixes the bug not only for the DRM backend, but for wayland and X11 as well.
2021-08-17backend/drm: return true on test if no crtcRouven Czerwinski
This should fix the following backtrace, seen on my desktop with one output disabled: #0 atomic_crtc_commit (conn=0x270f5c0, state=0x270f6d0, flags=0, test_only=<optimized out>) at ../backend/drm/atomic.c:178 drm = 0x1ae9c10 output = 0x270f5c0 crtc = 0x0 modeset = false active = false mode_id = 43989232 gamma_lut = 0 prev_vrr_enabled = <optimized out> vrr_enabled = <optimized out> atom = {req = 0x270f5c0, failed = 48} ok = <optimized out> #1 0x00007f1104f33128 in drm_crtc_commit (conn=conn@entry=0x270f5c0, state=state@entry=0x270f6d0, flags=flags@entry=0, test_only=test_only@entry=true) at ../backend/drm/drm.c:339 __PRETTY_FUNCTION__ = "drm_crtc_commit" drm = <optimized out> crtc = 0x0 ok = <optimized out> #2 0x00007f1104f34e6c in drm_connector_test (output=output@entry=0x270f5c0) at ../backend/drm/drm.c:488 conn = 0x270f5c0 unsupported = <optimized out> #3 0x00007f1104f35424 in drm_connector_commit (output=0x270f5c0) at ../backend/drm/drm.c:578 conn = 0x270f5c0 #4 0x00007f1104f600b7 in wlr_output_commit (output=output@entry=0x270f5c0) at ../types/wlr_output.c:837 now = {tv_sec = 7732, tv_nsec = 623813006} pre_event = {output = 0x270f5c0, when = 0x7ffecc1be570} back_buffer = 0x0 scale_updated = <optimized out> geometry_updated = <optimized out> committed = <optimized out> event = {output = 0x0, committed = 4401048, when = 0x29f38f0} #5 0x0000000000433047 in apply_output_config (oc=oc@entry=0x29f38f0, output=output@entry=0x2710720) at ../sway/config/output.c:431 wlr_output = 0x270f5c0 output_box = <optimized out> #6 0x0000000000433aaf in apply_output_config_to_outputs (oc=0x2308400) at ../sway/config/output.c:649 current = 0x29f38f0 name = <optimized out> wildcard = true id = "Dell Inc. DELL U2410 F525M9AK0MML\000\060\060\060ACD7\000\000\000\000\000\000\000\220\063\240\002\000\000\000\000L5C\000\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000\000\000\000\377\377\377\377\000\000\000\000\355\240E\000\000\000\000\000\377\377\377\377\000\000\000\000@\206+\002\000\000\000\000`\260.\002\000\000\000" sway_output = 0x2710720 tmp = 0x2242030 seat = <optimized out> #7 0x000000000043df6b in cmd_output (argc=<optimized out>, argv=0x2a03390) at ../sway/commands/output.c:108 error = <optimized out> output = <optimized out> background = false #8 0x0000000000410304 in execute_command (_exec=_exec@entry=0x2975d20 "output * dpms off", seat=0x22a3280, seat@entry=0x0, con=con@entry=0x0) at ../sway/commands.c:291 res = <optimized out> argc = 4 argv = 0x2a03370 handler = 0x479230 <handlers+560> cmd = <optimized out> matched_delim = 0 '\000' containers = 0x0 using_criteria = false __PRETTY_FUNCTION__ = "execute_command" exec = 0x28f63c0 "output * dpms off" head = 0x0 res_list = 0x2a2e9d0 #9 0x0000000000418b65 in ipc_client_handle_command (client=client@entry=0x2a6ac80, payload_length=<optimized out>, payload_type=IPC_COMMAND) at ../sway/ipc-server.c:645 line = <optimized out> res_list = <optimized out> json = <optimized out> length = <optimized out> __PRETTY_FUNCTION__ = "ipc_client_handle_command" buf = 0x2975d20 "output * dpms off" #10 0x000000000041964c in ipc_client_handle_readable (client_fd=<optimized out>, mask=<optimized out>, data=0x2a6ac80) at ../sway/ipc-server.c:267 pending_length = <optimized out> pending_type = <optimized out> client = 0x2a6ac80 read_available = 31 buf = "i3-ipc\021\000\000\000\000\000\000" received = 14 #11 0x00007f1104fc3492 in wl_event_loop_dispatch () from /nix/store/ridk7k2ka6dbk4ly7qqjgmc523s4fj89-wayland-1.19.0/lib/libwayland-server.so.0 No symbol table info available. #12 0x00007f1104fc1135 in wl_display_run () from /nix/store/ridk7k2ka6dbk4ly7qqjgmc523s4fj89-wayland-1.19.0/lib/libwayland-server.so.0 No symbol table info available. #13 0x000000000041ac10 in server_run (server=server@entry=0x47b0c0 <server>) at ../sway/server.c:261 No locals. #14 0x000000000041a3fc in main (argc=<optimized out>, argv=0x7ffecc1bec68) at ../sway/main.c:395 verbose = 0 debug = 0 validate = 0 allow_unsupported_gpu = 0 long_options = {{name = 0x45b516 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x45ee69 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x45b51b "validate", has_arg = 0, flag = 0x0, val = 67}, { name = 0x45b524 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x45b3ac "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x45a55c "verbose", has_arg = 0, flag = 0x0, val = 86}, {name = 0x45b52a "get-socketpath", has_arg = 0, flag = 0x0, val = 112}, {name = 0x45b539 "unsupported-gpu", has_arg = 0, flag = 0x0, val = 117}, {name = 0x45b549 "my-next-gpu-wont-be-nvidia", has_arg = 0, flag = 0x0, val = 117}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}} config_path = 0x0 usage = 0x45b830 "Usage: sway [options] [command]\n\n -h, --help", ' ' <repeats 13 times>, "Show help message and quit.\n -c, --config <config> Specify a config file.\n -C, --validate Check the validity of the config file, th"... c = <optimized out> where the second output is not enabled: (gdb) frame 4 #4 0x00007f1104f600b7 in wlr_output_commit (output=output@entry=0x270f5c0) at ../types/wlr_output.c:837 837 in ../types/wlr_output.c (gdb) p output->enabled $3 = false (gdb) The culprit being that since 604674dc54a3b2cb4b73de267c8c2bcae259c4b6 we always try to perform a commit, even on a disabled output.
2021-08-17backend/drm: use addon for wlr_drm_fbSimon Ser
2021-08-17xwayland: do not free cursor in handle_server_ready()Michele Sorcinelli
If XWayland terminates for any reason, xwm_set_cursor() has to to be called again, so the cursor has to stick around.
2021-08-15input/tablet: fix `wl_array_for_each` usage on tablet proximityTudor Brindus
Looks like this instance was missed in e035f2b9c42b39e3eff37d0fe98bfa6422877d7a. Fixes #3110.