diff options
Diffstat (limited to 'kms++')
-rw-r--r-- | kms++/inc/kms++/videomode.h | 3 | ||||
-rw-r--r-- | kms++/src/videomode.cpp | 10 |
2 files changed, 13 insertions, 0 deletions
diff --git a/kms++/inc/kms++/videomode.h b/kms++/inc/kms++/videomode.h index f9abaf9..ec16969 100644 --- a/kms++/inc/kms++/videomode.h +++ b/kms++/inc/kms++/videomode.h @@ -31,6 +31,9 @@ struct Videomode uint16_t vfp() const { return vsync_start - vdisplay; } uint16_t vsw() const { return vsync_end - vsync_start; } uint16_t vbp() const { return vtotal - vsync_end; } + + bool interlace() const; + float calculated_vrefresh() const; }; } diff --git a/kms++/src/videomode.cpp b/kms++/src/videomode.cpp index 30d47f8..16330bb 100644 --- a/kms++/src/videomode.cpp +++ b/kms++/src/videomode.cpp @@ -16,4 +16,14 @@ unique_ptr<Blob> Videomode::to_blob(Card& card) const return unique_ptr<Blob>(new Blob(card, &drm_mode, sizeof(drm_mode))); } +bool Videomode::interlace() const +{ + return flags & DRM_MODE_FLAG_INTERLACE; +} + +float Videomode::calculated_vrefresh() const +{ + return (clock * 1000.0) / (htotal * vtotal) * (interlace() ? 2 : 1); +} + } |