aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2021-08-14layer-shell: replace close() with destroy()Isaac Freund
The protocol specifies that all requests (aside from destroy) are ignored after the compositor sends the closed event. Therefore, destroying the wlroots object and rendering the resource inert when sending the closed event keeps things simpler for wlroots and compositors.
2021-08-12render/gles2: make wlr_gles2_texture a wlr_buffer addonSimon Ser
2021-08-12render/gles2: make wlr_gles2_buffer an addonSimon Ser
Saves us from walking a list.
2021-08-12buffer: add addon setSimon Ser
This allows wlr_buffer users to extend it with tjeir own state.
2021-08-11surface: drop surface_state_copySimon Ser
This function was weird because it copied some fields but not all.
2021-08-11surface: kill wlr_surface.previousSimon Ser
This wlr_surface_state field was a special case because we don't want to save the whole current state: for instance, the wlr_buffer must not be saved or else wouldn't get released soon enough. Let's just inline the state fields we need instead.
2021-08-11util/addon: find both by owner and implKirill Primak
This allows to have multiple addons of different types with the same owner.
2021-08-10wlr_output_layout: use wlr_addonsKirill Primak
2021-08-10wlr_outputs: add wlr_addon_setKirill Primak
2021-08-10util: add wlr_addonKirill Primak
2021-08-10backend/drm: always perform a test commit in drm_connector_testSimon Ser
This allows callers to use wlr_output_test to check whether a mode can be enabled, for instance. Closes: https://github.com/swaywm/wlroots/issues/2250
2021-08-10backend/drm: add proper error handling to wlr_drm_backend_createSimon Ser
Some listeners weren't removed and caused a use-after-free with e.g. vkms when used as a secondary GPU.
2021-08-08ci: add smoke testSimon Ser
Add a very basic smoke test which uses VKMS to fire up the DRM backend.
2021-08-07input/pointer: try harder to not send duplicate motion eventsTudor Brindus
wl_fixed_t is a 32-bit data type, but our doubles are 64-bit. This meant that two doubles that would map to the same wl_fixed_t could compare unequal, and send a duplicate motion event. Refs swaywm/sway#4632.
2021-08-06seat: allow compositors to not load a keymapSimon Ser
The protocol allows compositors to not send any keymap to Wayland clients. Handle a keymap-less keyboard correctly by sending WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP instead of erroring out in the mmap call.
2021-08-06build: remove "." from include dirsSimon Ser
2021-08-06examples/fullscreen-shell: remove unused render_data.view fieldSimon Ser
2021-08-04backend/drm: require buffer on modeset in drm_connector_testSimon Ser
When testing a modeset, make sure the caller has also provided a buffer. This allows df0e75ba05e2 ("output: try skipping buffer allocation if the backend allows it") to work as expected with the DRM backend. Closes: https://github.com/swaywm/wlroots/issues/3086
2021-08-04output: try skipping buffer allocation if the backend allows itSimon Ser
When enabling an output, skip the empty buffer allocation if the backend accepts modesets without a buffer. This fixes mode-setting with the noop backend.
2021-08-03render/pixman/pixel_format: add more formatsSimon Ser
Add a bunch of new formats for Pixman: a few missing 32-bit ones, some 16-bit and 32-bit formats as well. Mostly based on a Weston patch [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/664
2021-08-03render/pixel_format: add more formats for PixmanSimon Ser
These will be added to Pixman in the next commit.
2021-08-02backend/drm: preserve mode order from kernelSimon Ser
The kernel orders the mode list from highest to lowest. Preserve this ordering in the wlr_output.modes list.
2021-08-02surface: don't cache frame callback listsKirill Primak