aboutsummaryrefslogtreecommitdiffstats
path: root/kms++
diff options
context:
space:
mode:
authorTomi Valkeinen2016-08-15 01:55:24 -0500
committerTomi Valkeinen2016-08-15 04:28:04 -0500
commitbb64b41891b8ede6f0e002ed72b1068597525f14 (patch)
tree7c837bf657e18597717c3ba0d9f52bb677431bd9 /kms++
parent6927e751ddd7c833f71ad7376ec055ff40bf82a7 (diff)
downloadexternal-kmsxx-bb64b41891b8ede6f0e002ed72b1068597525f14.tar.gz
external-kmsxx-bb64b41891b8ede6f0e002ed72b1068597525f14.tar.xz
external-kmsxx-bb64b41891b8ede6f0e002ed72b1068597525f14.zip
testpat & kmsprint: improve mode prints
Diffstat (limited to 'kms++')
-rw-r--r--kms++/inc/kms++/videomode.h3
-rw-r--r--kms++/src/videomode.cpp10
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
31 uint16_t vfp() const { return vsync_start - vdisplay; } 31 uint16_t vfp() const { return vsync_start - vdisplay; }
32 uint16_t vsw() const { return vsync_end - vsync_start; } 32 uint16_t vsw() const { return vsync_end - vsync_start; }
33 uint16_t vbp() const { return vtotal - vsync_end; } 33 uint16_t vbp() const { return vtotal - vsync_end; }
34
35 bool interlace() const;
36 float calculated_vrefresh() const;
34}; 37};
35 38
36} 39}
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
16 return unique_ptr<Blob>(new Blob(card, &drm_mode, sizeof(drm_mode))); 16 return unique_ptr<Blob>(new Blob(card, &drm_mode, sizeof(drm_mode)));
17} 17}
18 18
19bool Videomode::interlace() const
20{
21 return flags & DRM_MODE_FLAG_INTERLACE;
22}
23
24float Videomode::calculated_vrefresh() const
25{
26 return (clock * 1000.0) / (htotal * vtotal) * (interlace() ? 2 : 1);
27}
28
19} 29}