aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-17backend/drm: log when restoring mode after VT switch failsSimon Ser
Can make it easier to track down issues.
2022-10-17backend/drm: fix EINVAL atomic commits after VT switchSimon Ser
The drm_connector_commit_state() call in handle_session_active() was not resulting in any atomic commit, because it didn't match any of the if branches: active = true, no new buffer was committed, and adaptive sync/gamma LUT were unchanged. Thus the commit was a no-op. Later on, when the compositor performs regular page-flips, the kernel would return EINVAL indicating that a modeset was needed. Rework the logic to use a non-blocking page-flip commit if a buffer was committed, and use a blocking commit if the connector is on or is being disabled. The only case where we should skip the atomic commit is when disabling (active = false) an already-disabled connector (conn->crtc == NULL). Note, 6936e163b514 ("backend/drm: short-circuit no-op commits") has introduced early returns for other situations where we don't need to perform an atomic commit (e.g. updating scale or transform of an output). Fixes: f216e979836a ("backend/drm: drop drm_connector_set_mode()") Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
2022-10-17backend/drm: extract current mode logic into separate functionSimon Ser
Extract the logic to fetch the current mode to a separate function to make it more readable. Stop dying in an assert when get_drm_prop_blob() fails. Always make it so the drmModeModeInfo pointer is allocated so that we can free() it unconditionally.
2022-10-15backend/drm: extract connect_drm_connector() logicSimon Ser
We already have disconnect_drm_connector() to handle the CONNECTED → DISCONNECTED transition. Let's add connect_drm_connector() to handle DISCONNECTED → CONNECTED. This makes scan_drm_connectors() shorter and easier to follow. No functional change, literally just moving code around.
2022-10-14wlr_scene: Destroy the texture when setting a new buffer.Alexander Orzechowski
Fixes: https://github.com/labwc/labwc/issues/587 Fixes: f0e31e806f7cb88c9d55dc0eb1876c86600d28df (wlr_scene: Fix not updating the scene node when setting a new buffer)
2022-10-14backend/drm: use atomic API to fetch current connector's CRTCSimon Ser
We were using the legacy API (with a detour through drmModeEncoder) to find out the current CRTC for a connector. Use the atomic API when available. Also extract the whole logic into a separate function for better readability, and better handle errors.
2022-10-14idle-notify-v1: new protocol implementationSimon Ser
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
2022-10-14xdg-toplevel: send invalid_parent errorKirill Primak
2022-10-13wlr_scene: use wl_container_of() instead of castsAlexander Orzechowski
2022-10-13backend/drm: use wl_container_of() instead of casts for wlr_drm_modeSimon Ser
Instead of casting a wlr_output_mode to wlr_drm_mode, use wl_container_of() for slightly better type safety.
2022-10-13backend/drm/legacy: Fix whitespaceAlexander Orzechowski
This confused me while reading through.
2022-10-13backend: use global output name countersSimon Ser
The output names must be globally unique per the Wayland spec, even if the compositor creates multiple backends of the same kind.
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.