Skip to content

drm: check syncobj timeline support before advertising protocol #11117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 23, 2025

Conversation

mavonarx
Copy link
Contributor

Describe your PR, what does it fix/add?

Fixes crashes in Vulkan applications (Zed, WezTerm, etc.) on systems where the DRM driver doesn't support syncobj timelines, particularly Apple Silicon devices running Asahi Linux with the Honeykrisp driver.

The issue was that Hyprland advertised the linux-drm-syncobj-v1 protocol regardless of hardware support. When applications attempted to use explicit sync, they would crash with "Timeline failed importing" errors.

This PR adds DRM_CAP_SYNCOBJ_TIMELINE capability checking at two levels:

  • Protocol creation: Only advertise the protocol when hardware supports it
  • Timeline creation: Additional safety check when creating sync timelines

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

No breaking compatibility - this only prevents advertising a protocol when the underlying hardware doesn't support it. Applications gracefully fall back to implicit sync when explicit sync isn't available.

Is it ready for merging, or does it need work?

Ready for merging. Tested on Fedora Asahi Remix with Apple M1 Pro. Applications that previously crashed now start successfully and run normally.

@vaxerski
Copy link
Member

this MR is based on some old rev, needs to be rebased on top of main, that's first.

Second - Asahi and Apple Silicon support explicit sync - just not on the display node, and Tom is working on that in #11087

Prevents crashes on systems where DRM driver lacks syncobj timeline
support (e.g., Apple Silicon with Honeykrisp driver). Applications
like Zed and WezTerm would crash with 'Timeline failed importing'
when trying to use explicit sync.

Fixes hyprwm#8158 hyprwm#8803
@mavonarx mavonarx force-pushed the fix-asahi-explicit-sync branch from 210b366 to 09b0fbc Compare July 20, 2025 06:14
@mavonarx
Copy link
Contributor Author

Rebased and retested

@mavonarx mavonarx force-pushed the fix-asahi-explicit-sync branch from 2e5aa2c to 09b0fbc Compare July 21, 2025 18:26
@mavonarx
Copy link
Contributor Author

Fixed - moved the capability check to init and removed the duplicate functions. Retested again - works.

@mavonarx mavonarx requested a review from vaxerski July 21, 2025 18:42
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

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

rest lgtm

@mavonarx mavonarx requested a review from vaxerski July 21, 2025 19:44
@vaxerski
Copy link
Member

c-f failed, run c-f pls

@mavonarx mavonarx requested a review from vaxerski July 23, 2025 21:08
@vaxerski vaxerski merged commit ecc04e8 into hyprwm:main Jul 23, 2025
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants