Skip to content

drm: allow disabling VRR on legacy surfaces - #2189

Merged
Drakulix merged 1 commit into
Smithay:masterfrom
jimwitte:fix-legacy-drm-vrr-disable
Sep 30, 2026
Merged

Drakulix merged 1 commit into
Smithay:masterfrom
jimwitte:fix-legacy-drm-vrr-disable

Conversation

@jimwitte

Copy link
Copy Markdown
Contributor

Description

DrmSurface::use_vrr currently returns UnknownProperty("VRR_ENABLED") for both enabling and disabling VRR when Smithay uses legacy DRM.

The legacy backend does not support VRR and reports VRR as unsupported and disabled. The atomic backend treats an absent VRR_ENABLED property as an error only when VRR is being enabled.

Change

Have use_vrr(false) return Ok(()) on the legacy backend while preserving the existing error for use_vrr(true). This allows compositors to request the disabled state without first checking whether VRR is supported.

A downstream workaround was proposed in pop-os/cosmic-comp#2884. COSMIC calls use_vrr(false) while rendering, so the legacy backend's error can produce an UnknownProperty("VRR_ENABLED") warning every frame.

Handling the disabled state in Smithay avoids requiring consumers to add a capability check and aligns the legacy behavior with the atomic backend.

Testing

  • cargo test --features test_all_features
  • cargo fmt --all -- --check

The linked cosmic-comp PR documents the original issue and hardware testing of the downstream workaround. This Smithay change has not been tested against legacy DRM hardware.

AI assistance is disclosed in the commit message in accordance with Smithay's AI policy.

Checklist

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@Drakulix

Copy link
Copy Markdown
Member

Sorry, but this needs a rebase, before I can merge

Legacy DRM does not expose the VRR_ENABLED property, so use_vrr
currently returns UnknownProperty even when asked to disable VRR.
This requires callers to check VRR support before requesting the
inactive state, unlike the atomic backend.

Treat use_vrr(false) as a successful no-op on legacy surfaces.
Continue returning UnknownProperty when attempting to enable VRR.

Tested:
- cargo test --features test_all_features
- cargo fmt --all -- --check

Developed with AI assistance (OpenAI Codex); all changes have been reviewed and are understood by the author.

Signed-off-by: Jim Witte <jim@thunderingbison.com>
@jimwitte
jimwitte force-pushed the fix-legacy-drm-vrr-disable branch from 348b151 to bbe5aa6 Compare September 30, 2026 13:58
@jimwitte

Copy link
Copy Markdown
Contributor Author

@Drakulix rebased onto current master and force-pushed the branch

@Drakulix
Drakulix merged commit 118e34f into Smithay:master Sep 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants