summaryrefslogtreecommitdiff
path: root/kms++/src
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-08-15 09:55:24 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-08-15 12:28:04 +0300
commitbb64b41891b8ede6f0e002ed72b1068597525f14 (patch)
tree7c837bf657e18597717c3ba0d9f52bb677431bd9 /kms++/src
parent6927e751ddd7c833f71ad7376ec055ff40bf82a7 (diff)
testpat & kmsprint: improve mode prints
Diffstat (limited to 'kms++/src')
-rw-r--r--kms++/src/videomode.cpp10
1 files changed, 10 insertions, 0 deletions
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);
+}
+
}