aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-03screencopy-v1: fix frame_shm_copy() error pathSimon Ser
Don't call wlr_renderer_end() if wlr_renderer_begin_with_buffer() failed. This will result in an abort().
2022-10-03backend/drm: remove outdated TODOSimon Ser
This has been addressed in 8795dde94eeb ("Initialize connectors current mode to the mode used by KMS on startup.").
2022-10-03backend/drm: don't unconditionally set desired_enabledSimon Ser
We were unconditonally setting desired_enabled = true for all connected connectors. This makes realloc_crtcs() always keep a CRTC active for these, even if the user doesn't want to enable them.
2022-10-01foreign-toplevel-management: fix indentationKirill Primak
2022-10-01render/allocator/drm_dumb: drop finish_buffer()Simon Ser
Simplify things a bit.
2022-10-01render/allocator/drm_dumb: fix error handlingSimon Ser
In the CREATE_DUMB error code-path, we'd only free() the buffer, however it's already inserted in the alloc->buffers list at this point. Instead, make sure finish_buffer() is safe to call (by populating drm_fd) and call that function.
2022-10-01render/allocator/drm_dumb: get format info before allocatingSimon Ser
Simplifies error handling a bit.
2022-10-01render/allocator/drm_dumb: check modifier listSimon Ser
Check that the modifier list passed as input contains either INVALID or LINEAR. We don't support others.
2022-10-01render/allocator/drm_dumb: advertise LINEAR instead of INVALID modifierSimon Ser
INVALID means that the modifier is implicit. However dumb buffers are guaranteed to be LINEAR, so let's just advertise this. Fixes cursors with the DRM backend: cursor planes usually only support LINEAR.
2022-10-01render/pixman: advertise support for linear format modifierSimon Ser
When running with the DRM backend, the Pixman renderer needs to render the cursor buffer. However, DRM drivers only support linear buffers for these in general, they don't support implicit modifiers (aka. INVALID). Advertise support for LINEAR in the Pixman renderer to fix this.
2022-10-01screencopy-v1: make sure wlr_buffer enum is visibleConsolatis
.. by including wlr_buffer.h
2022-10-01render: don't fall back to Pixman if we have a render nodeSimon Ser
If we have a render node, it means there is a GPU which could be used. We probably failed GL because of a kernel or Mesa issue. Instead of automatically falling back to Pixman, error out. This makes it more obvious to users when something goes wrong, instead of silently exposing a slow unaccelerated desktop. References: https://github.com/swaywm/sway/issues/7194
2022-10-01render: don't automatically fall back to VulkanSimon Ser
The Vulkan renderer is still experimental. If GL fails, we don't want to automatically fall back to it by default. Fixes: 8bd7170fd95a ("Use env helpers")
2022-10-01output: fix typo in error messageSimon Ser
2022-09-30render/vulkan: use addon for wlr_vk_textureSimon Ser
Avoids having to walk the list of all textures.
2022-09-30render/vulkan: use addon for wlr_vk_render_bufferSimon Ser
Avoids having to walk the list containing all of the render buffers.
2022-09-30backend/drm: fix missing wlr_output_state.allow_artifactsSimon Ser
Without allow_artifacts, applying the new state will fail because it requires ALLOW_MODESET. Fixes VT switch and disabling CRTCs.
2022-09-30output: add wlr_output_state.allow_artifactsSimon Ser
When starting up, the compositor might call wlr_output_set_mode() with a mode which is already the current one. wlroots will detect this and make the wlr_output_set_mode() call a no-op. During the next wlr_output_commit() call, wlroots will perform an atomic commit without the ALLOW_MODESET flag. This is an issue, because some drivers need ALLOW_MODESET even if the mode is the same. For instance, if the FB stride or modifier changed, some drivers require a modeset. Add a new flag "allow_artifacts" which is set when the compositor calls mode-setting functions. Use this flag to figure out whether we want to perform atomic commits with ALLOW_MODESET. (The name "allow_artifacts" is picked because ALLOW_MODESET is a misnomer, see [1].) [1]: https://patchwork.freedesktop.org/patch/505107/ Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499
2022-09-25meson: update default options for libdrmRouven Czerwinski
Libdrm now uses enabled/disabled/auto for the drivers, migrate to these new defaults. Error message from meson: wlroots| subprojects/wlroots/subprojects/libdrm/meson.build:21:0: Exception: Value "false" (of type "string") for combo option "Enable support for Intel's KMS API." is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".`
2022-09-23render: drop trailing whitespaceSimon Ser
2022-09-22screencopy-v1: use wlr_buffer APIsSimon Ser
Instead of using low-level wl_shm_buffer and wlr_dmabuf_v1_buffer APIs, use the unified wlr_buffer APIs. That way it doesn't matter what the exact wlr_buffer implementation is used, any which provides the necessary capabilities (data_ptr or dmabuf) would work. Simplifies the logic a bit, and will make the transition to wlr_shm easier.
2022-09-22screencopy-v1: rename wlr_screencopy_frame_v1.strideSimon Ser
Make it clear it's only about shm, not about DMA-BUFs.
2022-09-22screencopy-v1: use DRM format code for shm buffersSimon Ser
Will allow us to simplify common shm/DMA-BUF logic later on.
2022-09-22screencopy-v1: rename wlr_screencopy_frame_v1.{format,fourcc}Simon Ser
Make it clear that one is for shm buffers only, and the other is for DMA-BUF buffers only.
2022-09-22backend/libinput: Fix SIGSEGV found in low-memory fuzzingJohn Lindgren
Stack trace: #0 0x00007f17081f5b99 in wl_list_insert (list=list@entry=0x2d8, elm=elm@entry=0x7ffe7f7e85d0) at ../wayland-1.21.0/src/wayland-util.c:48 #1 0x00007f17081f5f2e in wl_signal_emit_mutable (signal=signal@entry=0x2d8, data=data@entry=0x7ffe7f7e8660) at ../wayland-1.21.0/src/wayland-server.c:2167 #2 0x00007f170815a971 in handle_switch_toggle (wlr_switch=0x2a0, event=0x55d5ba13dc00) at ../backend/libinput/switch.c:50 #3 handle_libinput_event (event=0x55d5ba13dc00, backend=0x55d5b975d740) at ../backend/libinput/events.c:234 #4 handle_libinput_readable (fd=<optimized out>, mask=<optimized out>, _backend=<optimized out>) at ../backend/libinput/backend.c:58 #5 handle_libinput_readable (fd=fd@entry=34, mask=mask@entry=1, _backend=_backend@entry=0x55d5b975d740) at ../backend/libinput/backend.c:48 #6 0x00007f170815c110 in backend_start (wlr_backend=0x55d5b975d740) at ../backend/libinput/backend.c:109 #7 0x00007f1708160996 in multi_backend_start (wlr_backend=0x55d5b97583d0) at ../backend/multi/backend.c:32
2022-09-22backend/drm: pass through mode picture aspect ratioSimon Ser
2022-09-22output: add wlr_output_mode.picture_aspect_ratioSimon Ser
CTA-861-H defines a picture aspect ratio which may be attached to each mode. This affects the way the sink will display the image. See annexes H.1 and H.2 for examples.
2022-09-21cursor: Don't warp to (0,0) when last output is disconnectedJohn Lindgren
There doesn't appear to be any good reason to warp the cursor to the top-left corner when all outputs are disconnected; it's no more valid than any other (x,y) point in that case. The real-world case here is a user with a single external monitor turning it off (which apparently counts as disconnected depending on the connection type/hardware). For that user, it's desirable to have the cursor remain in its original location when the monitor is turned back on.
2022-09-21cursor: Add a more general check for infinite/NaN cursor positionJohn Lindgren
It should be considered a bug if a compositor sets a non-finite cursor position, so fail loudly (in debug builds) if that happens. The existing check in wlr_cursor_warp_closest() is now redundant, and would silently hide such bugs, so remove it.
2022-09-21output: fix back buffer checksSimon Ser
The back buffer is no longer set at commit time since 0556aa0c5918 ("output: rejigger attach/clear for back buffer"). Instead, check whether the buffer belongs to the output swapchain. This is more robust. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3496
2022-09-21backend/drm: de-duplicate wlr_drm_mode creationSimon Ser
Introduce a function to convert a drmModeModeInfo into a new wlr_drm_mode.
2022-09-19output: rejigger attach/clear for back bufferSimon Ser
In wlr_output_attach_render(), stop setting wlr_output.pending.buffer. This removes one footgun: using the wlr_buffer at that stage is invalid, because rendering operations haven't been flushed to the GPU yet. We need to wait until output_clear_back_buffer() for the wlr_buffer to be used safely. Instead, set wlr_output.pending.buffer in wlr_output_test() and wlr_output_commit(). Additionally, move the output_clear_back_buffer() from wlr_output_commit_state() to wlr_output_commit(). This reduces the number of calls in the failure path.
2022-09-19output: drop back_buffer variable in wlr_output_commit_state()Simon Ser
We can just use pending.buffer instead. It's completely fine to call wlr_swapchain_set_buffer_submitted() with a buffer which doesn't come from the swapchain, in which case it's a no-op.
2022-09-19output: inline output_attach_render()Simon Ser
No need to have a separate function for this. It's only used once.
2022-09-19render/vulkan: add error handling for vulkan_find_mem_type()Simon Ser
The function returns -1 if it doesn't find a suitable memory type.
2022-09-19render/egl: add support for EGL_KHR_display_referenceSimon Ser
See the spec at [1]. tl;dr EGL has terrible defaults: eglTerminate() may have side-effects on completely unrelated EGLDisplay objects. This extension allows us to opt-in to get the sane behavior: eglTerminate() only free's our own EGLDisplay without affecting others. [1]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_display_reference.txt
2022-09-18output: fix wlr_output_set_gamma() with zero sizeSimon Ser
This is documented to reset the gamma LUT, but we don't handle this properly. While at it, make sure we leave wlr_output.pending in a good state on allocation failure.
2022-09-17xdg-toplevel: validate resize_edgeKirill Primak
2022-09-17single-pixel-buffer-v1: fix header guard nameSimon Ser
Be consistent with other headers.
2022-09-16buffer: split into multiple filesSimon Ser
wlr_buffer.c is difficult to read because it contains a mixed bag of unrelated things: base buffer type, buffer implementations, buffer resource factory, and client buffer. Split each of these into their own file.
2022-09-16Only set max_bpc when full modesetting is being done.vanfanel
2022-09-16Initialize connectors current mode to the mode used by KMS on startup.vanfanel
2022-09-15wlr_drm_lease_v1: Fix use-after-free in backend_destroy()John Lindgren
valgrind said (on exit from labwc): Invalid write of size 8 at 0x487DEAF: wl_list_remove (wayland-util.c:56) by 0x487DF80: wl_signal_emit_mutable (wayland-server.c:2182) by 0x48CD6B7: backend_destroy.part.0.lto_priv.0 (backend.c:41) by 0x48DC19D: multi_backend_destroy (backend.c:58) by 0x4880286: UnknownInlinedFun (wayland-server.c:2315) by 0x4880286: wl_display_destroy (wayland-server.c:1170) by 0x112491: UnknownInlinedFun (server.c:485) by 0x112491: main (main.c:110) Address 0x1f9d0210 is 112 bytes inside a block of size 136 free'd at 0x484426F: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x487DF6D: wl_signal_emit_mutable (wayland-server.c:2179) by 0x48CD6B7: backend_destroy.part.0.lto_priv.0 (backend.c:41) by 0x48DC19D: multi_backend_destroy (backend.c:58) by 0x4880286: UnknownInlinedFun (wayland-server.c:2315) by 0x4880286: wl_display_destroy (wayland-server.c:1170) by 0x112491: UnknownInlinedFun (server.c:485) by 0x112491: main (main.c:110) Block was alloc'd at at 0x4846A73: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x4918D4E: drm_lease_device_v1_create (wlr_drm_lease_v1.c:639) by 0x48D3B00: wlr_multi_for_each_backend (backend.c:249) by 0x49191D2: wlr_drm_lease_v1_manager_create (wlr_drm_lease_v1.c:706) by 0x111EE9: UnknownInlinedFun (server.c:384) by 0x111EE9: main (main.c:92)
2022-09-15output/cursor: downgrade error messagesSimon Ser
When the output doesn't support hardware cursors, these errors will be printed. However, these errors are expected and we have a proper fallback. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3457
2022-09-14render/vulkan: improve format loggingSimon Ser
2022-09-14output/render: log human-readable formatSimon Ser
2022-09-14render/allocator/gbm: log human-readable format and modifierSimon Ser
2022-09-14render/egl: improve DMA-BUF format/modifier loggingSimon Ser
For each format and modifier, log supported usage. Log a human-readable format/modifier string.
2022-09-14meson: replace join_paths() with / operatorilliliti
2022-09-12subcompositor: consider mapping after addingKirill Primak
ec8b49c93f869010e360bec501d61c18089fbc61 calls subsurface_consider_map() too early. Instead, call it after emitting new_subsurface signal to let compositors receive a map event.