diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-09-01 15:24:26 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-09-26 08:59:03 +0300 |
commit | 8e9eecb32f0812b58670ebb8c135a0914c170569 (patch) | |
tree | bdc5cfcebb7571d649e7940abc3296e3a029cc0f /kms++/inc | |
parent | 8f5e937129d96081f0342aa4377b1ffd48f9ea75 (diff) |
Improve struct Videomode
Enable set/get for sync polarities and interlace. Add
videomode_from_timings() helper to construct Videomode from non-X
timings.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/inc')
-rw-r--r-- | kms++/inc/kms++/videomode.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kms++/inc/kms++/videomode.h b/kms++/inc/kms++/videomode.h index ec16969..39e5639 100644 --- a/kms++/inc/kms++/videomode.h +++ b/kms++/inc/kms++/videomode.h @@ -9,6 +9,13 @@ namespace kms { +enum class SyncPolarity +{ + Undefined, + Positive, + Negative, +}; + struct Videomode { std::string name; @@ -32,8 +39,18 @@ struct Videomode uint16_t vsw() const { return vsync_end - vsync_start; } uint16_t vbp() const { return vtotal - vsync_end; } - bool interlace() const; float calculated_vrefresh() const; + + bool interlace() const; + SyncPolarity hsync() const; + SyncPolarity vsync() const; + + void set_interlace(bool ilace); + void set_hsync(SyncPolarity pol); + void set_vsync(SyncPolarity pol); }; +struct Videomode videomode_from_timings(uint32_t clock_khz, + uint16_t hact, uint16_t hfp, uint16_t hsw, uint16_t hbp, + uint16_t vact, uint16_t vfp, uint16_t vsw, uint16_t vbp); } |