From 2d939754b1e7230da6afbac642e11cfd0c098dbf Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 6 Jan 2021 11:37:35 +0300 Subject: [PATCH] crtc-mode-info: Add vblank duration field Only populated for KMS backed modes, as that's where it's relevant. Part-of: --- src/backends/meta-crtc-mode.h | 1 + src/backends/native/meta-crtc-mode-kms.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/backends/meta-crtc-mode.h b/src/backends/meta-crtc-mode.h index 87778b866..2ac90e408 100644 --- a/src/backends/meta-crtc-mode.h +++ b/src/backends/meta-crtc-mode.h @@ -54,6 +54,7 @@ typedef struct _MetaCrtcModeInfo int width; int height; float refresh_rate; + int64_t vblank_duration_us; MetaCrtcModeFlag flags; } MetaCrtcModeInfo; diff --git a/src/backends/native/meta-crtc-mode-kms.c b/src/backends/native/meta-crtc-mode-kms.c index 6f190edc4..053367cfd 100644 --- a/src/backends/native/meta-crtc-mode-kms.c +++ b/src/backends/native/meta-crtc-mode-kms.c @@ -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,