aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-11Fixed false allocation failedGentaiii
2022-10-10render/vulkan: drop wlr_vk_instance.extensionsSimon Ser
This was unused. Even if it was, it'd be better to have bool fields instead.
2022-10-10output: fix crash in output_test_with_back_buffer()Simon Ser
The output->impl->test check has been removed, but output_test_with_back_buffer() hasn't been updated accordingly. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3506 Fixes: 3be6658ee7b6 ("output: allocate swapchain on first commit")
2022-10-10wlr_scene: Apply source box translationAlexander Orzechowski
2022-10-10wlr_scene: Ignore disabled outputsAlexander Orzechowski
2022-10-10wlr_scene: Fix not updating the scene node when setting a new bufferAlexander Orzechowski
If a new buffer is set for a buffer node, we must update the entire node unconditionally if the buffer size changes, or the buffer is given a buffer where it was previously NULL. While we're here, let's avoid calling scene_node_update on just damage updates. If the caller hasn't given us a damage region we just assume the whole buffer.
2022-10-10wlr_scene: Be resilient against overflow conditionsAlexander Orzechowski
If the area calculations for output overlap overflow a signed int, we may not consider it to be a primary output. Turn this into an unsigned type so this happens less frequently. Additionally, it is possible the overflow would produce 0, we can handle this by simply changing the comparison to more than or equal. While we're here, let's assert that we always assign a primary output if there are any intersecting outputs.
2022-10-10render/gles2: assert that GL_OES_EGL_image_external is supportedSimon Ser
The target is set to GL_TEXTURE_EXTERNAL_OES when EGL_EXT_image_dma_buf_import_modifiers [1] returns an external_only flag. That spec states: > In order to support imports for the GL_TEXTURE_EXTERNAL_OES target, a > compatible OpenGL ES implementation supporting GL_OES_EGL_image_external > must be present. Fail hearder when a driver doesn't follow the spec instead of skipping rendering. See [2]. [1]: https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3631#note_1584343
2022-10-10backend/drm: drop drm_connector_set_mode()Simon Ser
Instead of special-casing modesets, we can just cut the wrapper and directly call drm_crtc_page_flip(). drm_connector_test() should already have the checks previously done in drm_connector_set_mode(), all we need to do is update enabled/mode after a successful atomic commit.
2022-10-09render/vulkan: Fix type-punned pointer warning/errorJohn Lindgren
2022-10-07backend/drm: allocate connector CRTC on lease creationSimon Zeni
This was leading to crash in compositors if the wanted connector had no CRTC
2022-10-07drm-lease-v1: reject the lease request by defaultSimon Ser
If the compositor didn't call wlr_drm_lease_request_v1_grant() nor wlr_drm_lease_request_v1_reject(), then reject the lease.
2022-10-07drm-lease-v1: send finished event on failure in submit requestSimon Ser
If the "submit" request handler fails, send a "finished" event so that the client doesn't stall forever.
2022-10-07drm-lease-v1: fix error codepathSimon Ser
We were crashing in the error codepath [1] when wlr_drm_create_lease() fails. To fix this, delay the creation of the wlr_drm_lease_v1 until the request is granted. Previously we were allocating that struct early without populating the drm_lease field. However that means we ended up with a half-constructed struct in the error codepath which is annoying to handle. [1]: https://github.com/swaywm/sway/issues/7204#issuecomment-1269797356
2022-10-07output: allocate swapchain on first commitSimon Ser
On first commit, require a new buffer if the compositor called a mode-setting function, even if the mode won't change. This makes it so the swapchain is created now. Stop trying to check whether the backend supports buffer-less modesets because that makes everything more complicated. For instance, the DRM backend doesn't need a new buffer if the previous DRM master left the output enabled. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3499 Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3502
2022-10-07output/render: make output_ensure_buffer() no-op when missing rendererSimon Ser
Some compositors want to have full control over the buffers attached to the output, and don't want to use the internal swapchain. Such compositors include KWinFT (allocates its buffers on its own) and gamescope (uses a headless output without any buffers). Let's just make output_ensure_buffer() a no-op in that case.
2022-10-07output/render: early return in output_ensure_buffer()Simon Ser
Slightly simplify the logic here.
2022-10-07tablet-v2: fix event parametersKirill Primak
2022-10-07backend/drm: nuke wlr_drm_connector.desired_enabledSimon Ser
This field becomes stale too easily: for instance, see 6adca4089cf4 ("backend/drm: don't unconditionally set desired_enabled"). Additionally, drm_connector_alloc_crtc() needs to do some weird dance, restoring its previous value. Instead, add a connector arg to realloc_crtcs() to indicate a new connector we want to enable.
2022-10-07backend/drm: drop unnecessary wlr_drm_connector.crtc checksSimon Ser
drm_connector_alloc_crtc() already checks this.
2022-10-07render/vulkan: implement vulkan_preferred_read_formatDavid96
2022-10-07render/vulkan: Implement vulkan_read_pixelsDavid96
2022-10-07output: add a swapchain NULL check in wlr_output_commit_state()Kirill Primak
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3504
2022-10-07output-damage: drop unused pending_attach_renderKirill Primak
2022-10-07output-damage: drop precommit listenerKirill Primak
2022-10-07output-damage: fix setting pending_attach_renderKirill Primak
2022-10-04build: alphabetically sort protocol listsSimon Ser
More consistent with the rest of wlroots, and can avoid merge conflicts.
2022-10-04render: drop wlr_renderer_read_pixels() flagsSimon Ser
These are unused.
2022-10-03screencopy-v1: simplify frame_dma_copy() error pathSimon Ser
Unify success and error code-paths.
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.