mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-11 13:29:45 -05:00
backend/drm: make adaptive_sync atomic
Stop using drmModeObjectSetProperty, set the property in the crtc_commit function instead.
This commit is contained in:
parent
42126c2022
commit
70f3a0bb27
4 changed files with 45 additions and 23 deletions
|
|
@ -62,6 +62,23 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
|
|||
}
|
||||
}
|
||||
|
||||
if ((output->pending.committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED) &&
|
||||
drm_connector_supports_vrr(conn)) {
|
||||
if (drmModeObjectSetProperty(drm->fd, crtc->id, DRM_MODE_OBJECT_CRTC,
|
||||
crtc->props.vrr_enabled,
|
||||
output->pending.adaptive_sync_enabled) != 0) {
|
||||
wlr_log_errno(WLR_ERROR,
|
||||
"drmModeObjectSetProperty(VRR_ENABLED) failed");
|
||||
return false;
|
||||
}
|
||||
output->adaptive_sync_status = output->pending.adaptive_sync_enabled ?
|
||||
WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED :
|
||||
WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED;
|
||||
wlr_log(WLR_DEBUG, "VRR %s on connector '%s'",
|
||||
output->pending.adaptive_sync_enabled ? "enabled" : "disabled",
|
||||
output->name);
|
||||
}
|
||||
|
||||
if (cursor != NULL && drm_connector_is_cursor_visible(conn)) {
|
||||
struct wlr_drm_fb *cursor_fb = plane_get_next_fb(cursor);
|
||||
struct gbm_bo *cursor_bo =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue