Age | Commit message (Collapse) | Author |
|
|
|
We're about to get one more Xwayland-related thing, and this header
already contains two things.
|
|
This stuff is immutable for a given connector.
|
|
Move a bit more logic out of the big loop in scan_drm_connectors().
|
|
The vertex shaders for quads and textures are identical.
|
|
We have no use for a v_color varying. We can use the uniform
directly from the fragment shader without getting the vertex shader
involved.
|
|
Instead of having a C file with strings for each shader, move each
shader into its own file. Use a small POSIX shell script to convert
the files into C strings (can't wait for C23 #embed...).
The benefits from this are:
- Improved readability and syntax highlighting.
- Line numbers in shader compiler errors are easier to make sense of.
- Consistency with the Vulkan renderer.
- Shaders will become more complicated as we add color management
features.
|
|
|
|
This function doesn't exist anymore.
|
|
Version 4 of the protocol adds support for reporting/setting adaptive
sync state of outputs. Implement these new requests/events in wlroots.
|
|
Try to alleviate scaling inaccuracies by implementing a fudge factor.
|
|
Same as WLR_DRM_NO_MODIFIERS but for EGL. For debugging purposes
mostly.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
|
|
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3514
|
|
If a fixed mode matching the user requirements is available, use
that. This avoids generating the mode with GTF or CVT in the DRM
backend, and instead uses mode timings advertised by the output.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3514
|
|
Always keep it initialized, so that we don't have to check for
xsurface->surface_id.
Will help with WL_SURFACE_SERIAL support, which adds a new way for
a surface to be unpaired.
|
|
Once we are DRM master, the CRTC cannot be changed behind our back
except during a VT switch.
After a VT switch, we try to restore whatever KMS state we had last
programmed. Reloading the current CRTC from KMS breaks this and
can result in a modeset without a FB.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3432
|
|
|
|
And update the sort order to follow Khronos' <vulkan/vulkan_core.h>.
|
|
Can make issues like [1] easier to debug.
[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3451
|
|
Inline it in drm_connector_commit_state(). Brings us a step closer
to unifying the test code-path and the commit code-path.
|
|
Can make it easier to track down issues.
|
|
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
|
|
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.
|
|
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.
|
|
Fixes: https://github.com/labwc/labwc/issues/587
Fixes: f0e31e806f7cb88c9d55dc0eb1876c86600d28df (wlr_scene: Fix not updating the scene node when setting a new buffer)
|
|
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.
|
|
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.
|
|
|