Age | Commit message (Collapse) | Author |
|
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
|
|
|
|
|
|
Instead of casting a wlr_output_mode to wlr_drm_mode, use
wl_container_of() for slightly better type safety.
|
|
This confused me while reading through.
|
|
The output names must be globally unique per the Wayland spec, even
if the compositor creates multiple backends of the same kind.
|
|
|
|
This was unused. Even if it was, it'd be better to have bool fields
instead.
|
|
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")
|
|
|
|
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
|
|
This was leading to crash in compositors if the wanted connector had no CRTC
|
|
If the compositor didn't call wlr_drm_lease_request_v1_grant() nor
wlr_drm_lease_request_v1_reject(), then reject the lease.
|
|
If the "submit" request handler fails, send a "finished" event
so that the client doesn't stall forever.
|
|
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
|
|
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
|
|
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.
|
|
Slightly simplify the logic here.
|
|
|
|
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.
|
|
drm_connector_alloc_crtc() already checks this.
|
|
|
|
|
|
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3504
|
|
|
|
|
|
|
|
More consistent with the rest of wlroots, and can avoid merge
conflicts.
|
|
These are unused.
|
|
Unify success and error code-paths.
|
|
Don't call wlr_renderer_end() if wlr_renderer_begin_with_buffer()
failed. This will result in an abort().
|
|
This has been addressed in 8795dde94eeb ("Initialize connectors
current mode to the mode used by KMS on startup.").
|
|
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.
|
|
|
|
Simplify things a bit.
|
|
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.
|
|
Simplifies error handling a bit.
|
|
Check that the modifier list passed as input contains either
INVALID or LINEAR. We don't support others.
|
|
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.
|
|
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.
|
|
.. by including wlr_buffer.h
|
|
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
|
|
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")
|
|
|
|
Avoids having to walk the list of all textures.
|