- Jul 08, 2021
-
-
Simon Ser authored
Some buffers need to be copied across GPUs. Such buffers need to be allocated with a format and modifier suitable for both the source and the destination. When explicit modifiers aren't supported, we were forcing the buffers to be allocated with a linear layout, because implicit modifiers aren't portable across GPUs. All is well with this case. When explicit modifiers are supported, we were advertising the whole list of destination modifiers, in the hope that the source might have some in common and might be able to allocate a buffer with a more optimized layout. This works well if the source supports explicit modifiers. However, if the source doesn't, then wlr_drm_format_intersect will fallback to implicit modifiers, and everything goes boom: the source uses a GPU-specific tiling and the destination interprets it as linear. To avoid this, just force linear unconditionally. We'll be able to revert this once we have a good way to indicate that an implicit modifier isn't supported in wlr_drm_format_set, see [1]. [1]: https://github.com/swaywm/wlroots/pull/2815 Closes: https://github.com/swaywm/wlroots/issues/3030 (cherry picked from commit d71ed635)
- Jul 07, 2021
-
-
Simon Ser authored
When wlr_output.swapchain is used instead of the backend's, the buffer_type will be set to SCANOUT even if wlr_output_attach_render has been called. This tricks wlr_output_damage into thinking the whole output needs to be repainted. Workaround this issue by forcing buffer_type to RENDER when the output has a back-buffer set. Will clean all of that up when removing the precommit event handler altogether. This commit fixes damage tracking on the Wayland, X11 and headless backends. (cherry picked from commit a48e569d)
-
Simon Ser authored
Right now we rely entirely on implicit sync for synchronizing access to GPU buffers. Implicit sync works by setting synchronization points on the buffer in writers, and letting readers wait on these sync points before accessing the buffer. With OpenGL, sync points are created using functions such as eglSwapBuffers or glFlush. If none of these special functions are called, no sync point will be created and readers will potentially access a buffer that hasn't finished rendering yet. In the context of wlroots, OpenGL is the writer and the backend (KMS or parent Wayland/X11 session) is the reader. After we're done rendering a frame, and before passing that frame to the backend, we need to call glFlush. glFlush is called when the buffer is detached from the renderer. This is a task done by output_clear_back_buffer. So let's call this function before invoking the impl->commit hook, instead of calling it after. All of this is maybe a little tricky to get right with the current renderer_bind_buffer API. The new wlr_renderer_begin_with_buffer API is much better, because glFlush is called on wlr_renderer_end, so it's more intuitive. Closes: https://github.com/swaywm/wlroots/issues/3020 (cherry picked from commit c2bd63c1)
-
Simon Ser authored
The previous fix tried to side-step cursor->pending_fb completely. However that messes up our buffer locking mechanism. Instead, stop clearing the pending cursor FB on a failed commit. The pending cursor FB will remain for the next commit. Fixes: 6c3d080e ("backend/drm: populate cursor plane's current_fb") (cherry picked from commit 4dee7a2f)
-
Simon Ser authored
We were bumping the pending sequence number after emitting the commit event, so commit handlers were seeing inconsistent state where current.seq == pending.seq. This prevents commit handlers from immediately locking the pending state. Fix this by bumping the pending sequence number before firing the commit event. (cherry picked from commit c7018a45)
-
Simon Ser authored
There are still many situations where the buffer scale is not divisible by scale. The fix will require a tad more work, so let's just log the client error for now and continue handling the surface commit as usual. Closes: https://github.com/swaywm/sway/issues/6352 (cherry picked from commit 1c4b5bca)
- Jun 22, 2021
- Jun 20, 2021
-
-
Right now, when a new output state field is added, all backends by default won't reject it. This means we need to add new checks to each and every backend when we introduce a new state field. Instead, introduce a bitmask of supported output state fields in each backend, and error out if the user has submitted an unknown field. Some fields don't need any backend involvment to work. These are listed in WLR_OUTPUT_STATE_BACKEND_OPTIONAL as a convenience.
-
This reverts commit 28d23ba6. The prelinking and symbol filtering pass breaks builds with link-time optimization enabled.
-
- Jun 19, 2021
-
-
Add wlr_pixman_buffer_get_current_image for wlr_pixman_renderer. Add wlr_gles2_buffer_get_current_fbo for wlr_gles2_renderer. Allow get the FBO/pixman_image_t, the compositor can be add some action for FBO(for eg, attach a depth buffer), or without pixman render to pixman_image_t(for eg, use QPainter of Qt instead of pixman).
-
Add the following functions: - wlr_renderer_is_pixman - wlr_texture_is_pixman - wlr_pixman_texture_get_image
-
Export the interface used to determine whether the wlr_renderer object is gles2.
-
- Jun 17, 2021
-
-
Simon Ser authored
-
Simon Ser authored
Let's expose all of our prefixed symbols. Instead of trying to have fine-grained rules and only expose our public API, let's just expose all symbols that won't cause a conflict. Users won't be able to use the symbols without a proper header declaration anyways. If they go through the process of re-defining wlr_ symbols manually, that's on them if their build breaks. This aligns the rules with [1]. [1]: https://github.com/swaywm/wlroots/pull/2969
-
This allows us to validate the objcopy trick in CI. It's basically free to build both static and shared libraries anyway. We only enable this for GCC builds right now, as Meson currently lacks support for prelinking with other compilers.
-
Static libraries are not affected by our symbol file, so private symbols are globally visible by default. Use objcopy to make symbols that we do not want to expose local. Closes: https://github.com/swaywm/wlroots/issues/1892 Closes: https://github.com/swaywm/wlroots/issues/2952
-
- Jun 16, 2021
-
-
Instead of hardcoding the string "card", use DRM_PRIMARY_MINOR_NAME. Some systems may use another prefix, e.g. OpenBSD uses "drm" instead.
-
This moves the magic incantation into libdrm and is clearer. See [1] for details. While at it, fixup the doc comment and improve logging. [1]: mesa/drm@523b3658
-
The set_cursor() hook is a little bit special: it's not really synchronized to commit() or test(). Once set_cursor() returns true, the new cursor is part of the current state. This fixes a state where wlr_drm_connector.cursor_enabled is true but there is no FB available. This is triggered by set_cursor() followed by a failed commit(), which resets pending_fb. We should definitely fix the output interface to make the cursor part of the pending state, but that's a more involved change.
-
- Jun 13, 2021
-
-
Simon Ser authored
On commit failure, we need to unbind the back buffer from the renderer. This fixes assertions triggered on commits following a failed commit where the compositor called wlr_output_attach_render.
-
Instead, call drm_connector_set_pending_fb.
-
The other caller (drm_connector_commit_state) already checks this.
-
This will be used in drm_connector_test shortly.
-
We can't perform a test-only atomic commit if the connector is missing a CRTC.
-
drm_connector_set_pending_fb needs a CRTC to import the buffer.
-
This function allocates a CRTC for a connector if necessary.
-
Set the plane's pending FB before calling drm_connector_set_mode.
-
Instead of trying to perform a real modeset in init_renderer, perform an atomic test-only commit to find out whether disabling modifiers is necessary because of bandwidth limitations. This decouples init_renderer from the actual commit, making it possible to modeset an output with a user-supplied buffer instead of a black frame. We loose the ability to make sure the buffers coming from the swapchain will work fine when using the legacy interface. This can break i915 when atomic is disabled and modifiers enabled. But i915 always has atomic (so the user must explicitly disable it to run into potential bandwidth limitations) and is the only known problematic driver.
-
- Jun 09, 2021
-
-
Simon Ser authored
The types of buffers supported by the renderer might depend on the renderer's instance. For instance, a renderer might only support DMA-BUFs if the necessary EGL extensions are available. Pass the wlr_renderer to get_buffer_caps so that the renderer can perform such checks. Fixes: 982498fa ("render: introduce renderer_get_render_buffer_caps")
-
Simon Ser authored
Make it clear this function is a private wlroots API and will stay that way.
-
Simon Ser authored
-
Simon Ser authored
-
Simon Ser authored
-
- Jun 07, 2021