crtc-mode-info: Add vblank duration field

Only populated for KMS backed modes, as that's where it's relevant.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762>
This commit is contained in:
Ivan Molodetskikh 2021-01-06 11:37:35 +03:00 committed by Marge Bot
parent e40ff9d8b7
commit 2d939754b1
2 changed files with 3 additions and 0 deletions

View File

@ -54,6 +54,7 @@ typedef struct _MetaCrtcModeInfo
int width;
int height;
float refresh_rate;
int64_t vblank_duration_us;
MetaCrtcModeFlag flags;
} MetaCrtcModeInfo;

View File

@ -55,6 +55,8 @@ meta_crtc_mode_kms_new (MetaKmsMode *kms_mode,
crtc_mode_info->flags = drm_mode->flags;
crtc_mode_info->refresh_rate =
meta_calculate_drm_mode_refresh_rate (drm_mode);
crtc_mode_info->vblank_duration_us =
meta_calculate_drm_mode_vblank_duration_us (drm_mode);
crtc_mode_name = g_strndup (drm_mode->name, DRM_DISPLAY_MODE_LEN);
mode_kms = g_object_new (META_TYPE_CRTC_MODE_KMS,