diff options
Diffstat (limited to 'kms++/src/videomode.cpp')
-rw-r--r-- | kms++/src/videomode.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kms++/src/videomode.cpp b/kms++/src/videomode.cpp index 107ee3b..f675914 100644 --- a/kms++/src/videomode.cpp +++ b/kms++/src/videomode.cpp @@ -1,5 +1,6 @@ #include <xf86drm.h> #include <xf86drmMode.h> +#include <math.h> #include <kms++/kms++.h> #include "helpers.h" @@ -18,7 +19,8 @@ unique_ptr<Blob> Videomode::to_blob(Card& card) const float Videomode::calculated_vrefresh() const { - return (clock * 1000.0) / (htotal * vtotal) * (interlace() ? 2 : 1); + float refresh = (clock * 1000.0) / (htotal * vtotal) * (interlace() ? 2 : 1); + return roundf(refresh * 100.0) / 100.0; } bool Videomode::interlace() const |