Skip to content
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

Added Output.enable_adaptive_sync, fixes #134 #153

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions wlroots/ffi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,7 @@ def has_xwayland() -> bool:
int32_t height, int32_t refresh);
void wlr_output_set_transform(struct wlr_output *output,
enum wl_output_transform transform);
void wlr_output_enable_adaptive_sync(struct wlr_output *output, bool enabled);
void wlr_output_set_scale(struct wlr_output *output, float scale);

bool wlr_output_attach_render(struct wlr_output *output, int *buffer_age);
Expand Down
15 changes: 15 additions & 0 deletions wlroots/wlr_types/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,21 @@ def test(self) -> bool:
"""
return lib.wlr_output_test(self._ptr)

def enable_adaptive_sync(self, *, enable: bool = True) -> None:
"""
Enables or disables adaptive sync (ie. variable refresh rate) on this
output. On some backends, this is just a hint and may be ignored.
Compositors can inspect `wlr_output.adaptive_sync_status` to query the
effective status. Backends that don't support adaptive sync will reject
the output commit.

When enabled, compositors can submit frames a little bit later than the
deadline without dropping a frame.

Adaptive sync is double-buffered state, see commit().
"""
lib.wlr_output_enable_adaptive_sync(self._ptr, enable)

@property
def is_headless(self) -> bool:
return lib.wlr_output_is_headless(self._ptr)
Expand Down
Loading