From d1ca5f71ee48dd5fa0b35d4f79ab711f209a1b9a Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 1 Jul 2022 15:34:14 +0300 Subject: [PATCH] backend-drm: reset CRTC_DEGAMMA_LUT We are assuming that CRTC_DEGAMMA_LUT is pass-through, so better ensure it really is pass-through rather than whatever the previous KMS client left there. This too falls under deprecated_gamma_is_set check, because the legacy gamma could use either GAMMA or DEGAMMA. Signed-off-by: Pekka Paalanen --- libweston/backend-drm/drm-internal.h | 2 ++ libweston/backend-drm/kms.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index c05fb9c2..d670e57d 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -236,6 +236,8 @@ enum wdrm_content_type { enum wdrm_crtc_property { WDRM_CRTC_MODE_ID = 0, WDRM_CRTC_ACTIVE, + WDRM_CRTC_DEGAMMA_LUT, + WDRM_CRTC_DEGAMMA_LUT_SIZE, WDRM_CRTC_GAMMA_LUT, WDRM_CRTC_GAMMA_LUT_SIZE, WDRM_CRTC__COUNT diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c index 8412290e..016aaa72 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c @@ -165,6 +165,8 @@ const struct drm_property_info connector_props[] = { const struct drm_property_info crtc_props[] = { [WDRM_CRTC_MODE_ID] = { .name = "MODE_ID", }, [WDRM_CRTC_ACTIVE] = { .name = "ACTIVE", }, + [WDRM_CRTC_DEGAMMA_LUT] = { .name = "DEGAMMA_LUT", }, + [WDRM_CRTC_DEGAMMA_LUT_SIZE] = { .name = "DEGAMMA_LUT_SIZE", }, [WDRM_CRTC_GAMMA_LUT] = { .name = "GAMMA_LUT", }, [WDRM_CRTC_GAMMA_LUT_SIZE] = { .name = "GAMMA_LUT_SIZE", }, }; @@ -1079,6 +1081,8 @@ drm_output_apply_state_atomic(struct drm_output_state *state, if (!output->deprecated_gamma_is_set) { ret |= crtc_add_prop_zero_ok(req, crtc, WDRM_CRTC_GAMMA_LUT, 0); + ret |= crtc_add_prop_zero_ok(req, crtc, + WDRM_CRTC_DEGAMMA_LUT, 0); } /* No need for the DPMS property, since it is implicit in