aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/atomic.c
diff options
context:
space:
mode:
authorVincent Vanlaer <vincent.vanlaer@skynet.be>2018-02-04 21:03:44 +0100
committerVincent Vanlaer <vincent.vanlaer@skynet.be>2018-02-09 17:29:14 +0100
commitab011406add31c518f6f352189b1dc6246a74fdb (patch)
tree9d2319f3998f63282b32c885cb148adc47d3c774 /backend/drm/atomic.c
parentcc1229e75e0c0c2cf5ae6d67bc7411c2631deb86 (diff)
Add atomic gamma lut size fetching
Legacy gamma lut size now uses the new legacy_crtc member of wlr_drm_crtc. This was Previously doen using old_crtc in wlr_drm_connector, but since this refers to the crtc that was connected to the ouput, this could give the wrong result.
Diffstat (limited to 'backend/drm/atomic.c')
-rw-r--r--backend/drm/atomic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/drm/atomic.c b/backend/drm/atomic.c
index a8003492..79765fef 100644
--- a/backend/drm/atomic.c
+++ b/backend/drm/atomic.c
@@ -226,10 +226,24 @@ static bool atomic_crtc_set_gamma(struct wlr_drm_backend *drm,
return atomic_end(drm->fd, &atom);
}
+static uint32_t atomic_crtc_get_gamma_size(struct wlr_drm_backend *drm,
+ struct wlr_drm_crtc *crtc) {
+ uint64_t gamma_lut_size;
+
+ if (!wlr_drm_get_prop(drm->fd, crtc->id, crtc->props.gamma_lut_size,
+ &gamma_lut_size)) {
+ wlr_log(L_ERROR, "Unable to get gamma lut size");
+ return 0;
+ }
+
+ return (uint32_t) gamma_lut_size;
+}
+
const struct wlr_drm_interface atomic_iface = {
.conn_enable = atomic_conn_enable,
.crtc_pageflip = atomic_crtc_pageflip,
.crtc_set_cursor = atomic_crtc_set_cursor,
.crtc_move_cursor = atomic_crtc_move_cursor,
.crtc_set_gamma = atomic_crtc_set_gamma,
+ .crtc_get_gamma_size = atomic_crtc_get_gamma_size,
};