@ -29,7 +29,8 @@
static const uint32_t SUPPORTED_OUTPUT_STATE =
static const uint32_t SUPPORTED_OUTPUT_STATE =
WLR_OUTPUT_STATE_BACKEND_OPTIONAL |
WLR_OUTPUT_STATE_BACKEND_OPTIONAL |
WLR_OUTPUT_STATE_BUFFER |
WLR_OUTPUT_STATE_BUFFER |
WLR_OUTPUT_STATE_MODE ;
WLR_OUTPUT_STATE_MODE |
WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED ;
static struct wlr_wl_output * get_wl_output_from_output (
static struct wlr_wl_output * get_wl_output_from_output (
struct wlr_output * wlr_output ) {
struct wlr_output * wlr_output ) {
@ -251,6 +252,16 @@ static bool output_test(struct wlr_output *wlr_output,
return false ;
return false ;
}
}
// Adaptive sync is effectively always enabled when using the Wayland
// backend. This is not something we have control over, so we set the state
// to enabled on creating the output and never allow changing it.
assert ( wlr_output - > adaptive_sync_status = = WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ) ;
if ( state - > committed & WLR_OUTPUT_STATE_ADAPTIVE_SYNC_ENABLED ) {
if ( ! state - > adaptive_sync_enabled ) {
return false ;
}
}
if ( state - > committed & WLR_OUTPUT_STATE_MODE ) {
if ( state - > committed & WLR_OUTPUT_STATE_MODE ) {
assert ( state - > mode_type = = WLR_OUTPUT_STATE_MODE_CUSTOM ) ;
assert ( state - > mode_type = = WLR_OUTPUT_STATE_MODE_CUSTOM ) ;
}
}
@ -521,6 +532,8 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) {
wlr_output_update_custom_mode ( wlr_output , 1280 , 720 , 0 ) ;
wlr_output_update_custom_mode ( wlr_output , 1280 , 720 , 0 ) ;
wlr_output - > adaptive_sync_status = WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ;
char name [ 64 ] ;
char name [ 64 ] ;
snprintf ( name , sizeof ( name ) , " WL-%zu " , + + backend - > last_output_num ) ;
snprintf ( name , sizeof ( name ) , " WL-%zu " , + + backend - > last_output_num ) ;
wlr_output_set_name ( wlr_output , name ) ;
wlr_output_set_name ( wlr_output , name ) ;