mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
output: add adaptive_sync_enabled property
This commit is contained in:
parent
8afc1ed68c
commit
7017fa95b8
2 changed files with 35 additions and 0 deletions
|
|
@ -240,6 +240,18 @@ void wlr_output_set_scale(struct wlr_output *output, float scale) {
|
|||
output->pending.scale = scale;
|
||||
}
|
||||
|
||||
void wlr_output_enable_adaptive_sync(struct wlr_output *output, bool enabled) {
|
||||
bool currently_enabled =
|
||||
output->adaptive_sync_status != WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED;
|
||||
if (currently_enabled == enabled) {
|
||||
output->pending.committed &= ~WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED;
|
||||
return;
|
||||
}
|
||||
|
||||
output->pending.committed |= WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED;
|
||||
output->pending.adaptive_sync_enabled = enabled;
|
||||
}
|
||||
|
||||
void wlr_output_set_subpixel(struct wlr_output *output,
|
||||
enum wl_output_subpixel subpixel) {
|
||||
if (output->subpixel == subpixel) {
|
||||
|
|
@ -487,6 +499,10 @@ bool wlr_output_commit(struct wlr_output *output) {
|
|||
wlr_log(WLR_ERROR, "Tried to modeset a disabled output");
|
||||
goto error;
|
||||
}
|
||||
if (!enabled && output->pending.committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) {
|
||||
wlr_log(WLR_ERROR, "Tried to enable adaptive sync on a disabled output");
|
||||
goto error;
|
||||
}
|
||||
|
||||
struct timespec now;
|
||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue