aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/drm.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-05-07 17:50:40 +0200
committerSimon Ser <contact@emersion.fr>2020-05-09 16:42:25 +0200
commit70883fd10beba4f78e3325eb6e38750360502f58 (patch)
tree03b41327d9e610af0c21ac11d5c622ab5d024e0f /backend/drm/drm.c
parent69b22790923186bea48ab23e413927334eff828b (diff)
backend/drm: apply gamma LUT on page-flip
Diffstat (limited to 'backend/drm/drm.c')
-rw-r--r--backend/drm/drm.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index c91843cc..0d7f3f25 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -586,7 +586,6 @@ static size_t drm_connector_get_gamma_size(struct wlr_output *output) {
bool set_drm_connector_gamma(struct wlr_output *output, size_t size,
const uint16_t *r, const uint16_t *g, const uint16_t *b) {
struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
- struct wlr_drm_backend *drm = get_drm_backend_from_backend(output->backend);
if (!conn->crtc) {
return false;
@@ -618,17 +617,13 @@ bool set_drm_connector_gamma(struct wlr_output *output, size_t size,
memcpy(_b, b, size * sizeof(uint16_t));
}
- bool ok = drm->iface->crtc_set_gamma(drm, conn->crtc, size, _r, _g, _b);
- if (ok) {
- wlr_output_update_needs_frame(output);
+ conn->crtc->pending |= WLR_DRM_CRTC_GAMMA_LUT;
+ free(conn->crtc->gamma_table);
+ conn->crtc->gamma_table = gamma_table;
+ conn->crtc->gamma_table_size = size;
- free(conn->crtc->gamma_table);
- conn->crtc->gamma_table = gamma_table;
- conn->crtc->gamma_table_size = size;
- } else {
- free(gamma_table);
- }
- return ok;
+ wlr_output_update_needs_frame(output);
+ return true; // will be applied on next page-flip
}
static bool drm_connector_export_dmabuf(struct wlr_output *output,