summaryrefslogtreecommitdiff
path: root/kms++/src
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-12-03 11:31:24 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-12-03 11:31:24 +0200
commit764d6a0b7441796806a8fb8f10b79f009d5afb36 (patch)
tree56244ecfbe2acfbb21d1724591c23318e7173558 /kms++/src
parent79b60742131540b4c30db9aa4342c513dee389a7 (diff)
crtc: add legacy gamma set
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'kms++/src')
-rw-r--r--kms++/src/crtc.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/kms++/src/crtc.cpp b/kms++/src/crtc.cpp
index 6dc4333..1c1888f 100644
--- a/kms++/src/crtc.cpp
+++ b/kms++/src/crtc.cpp
@@ -173,9 +173,25 @@ Videomode Crtc::mode() const
return drm_mode_to_video_mode(m_priv->drm_crtc->mode);
}
-int Crtc::gamma_size() const
+int Crtc::legacy_gamma_size() const
{
return m_priv->drm_crtc->gamma_size;
}
+void Crtc::legacy_gamma_set(vector<tuple<uint16_t, uint16_t, uint16_t>> v)
+{
+ uint32_t len = v.size();
+ uint16_t red[len];
+ uint16_t green[len];
+ uint16_t blue[len];
+
+ for (uint32_t i = 0; i < len; ++i) {
+ red[i] = get<0>(v[i]);
+ green[i] = get<1>(v[i]);
+ blue[i] = get<2>(v[i]);
+ }
+
+ drmModeCrtcSetGamma(card().fd(), id(), len, red, green, blue);
+}
+
} // namespace kms