summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-03 17:15:43 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-04 22:33:54 +0300
commit9c60065905e9e04ff9c897504fdfb82af14f2e63 (patch)
tree291a2394ce140f1c628ac4a622d5754c26b321fd
parentac1b1691659acc41a9ffac258f9f0d09413b439d (diff)
Videomode: add helpers
-rw-r--r--libkms++/videomode.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libkms++/videomode.h b/libkms++/videomode.h
index 382c1cd..f9abaf9 100644
--- a/libkms++/videomode.h
+++ b/libkms++/videomode.h
@@ -23,6 +23,14 @@ struct Videomode
uint32_t type; // DRM_MODE_TYPE_*
std::unique_ptr<Blob> to_blob(Card& card) const;
+
+ uint16_t hfp() const { return hsync_start - hdisplay; }
+ uint16_t hsw() const { return hsync_end - hsync_start; }
+ uint16_t hbp() const { return htotal - hsync_end; }
+
+ 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; }
};
}