diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-11 20:17:35 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-06-11 20:17:35 +0300 |
commit | 17d180891f1e237ea5d25835999a8b23a6e7946d (patch) | |
tree | 5963fe4d338f6272daf55c76ed355effb47afc71 /kms++/videomode.h | |
parent | 38a71ee72c47f3287c327113ce411f236cac05ef (diff) |
rename dirs
Diffstat (limited to 'kms++/videomode.h')
-rw-r--r-- | kms++/videomode.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/kms++/videomode.h b/kms++/videomode.h new file mode 100644 index 0000000..f9abaf9 --- /dev/null +++ b/kms++/videomode.h @@ -0,0 +1,36 @@ +#pragma once + +#include <string> +#include <cstdint> +#include <memory> + +#include "blob.h" + +namespace kms +{ + +struct Videomode +{ + std::string name; + + uint32_t clock; + uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew; + uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan; + + uint32_t vrefresh; + + uint32_t flags; // DRM_MODE_FLAG_* + 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; } +}; + +} |