[Intel-gfx] [PATCH] drm/i915: add missing condition for committing planes on crtc

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed May 25 13:20:56 UTC 2016


The i915 driver checks for color management properties changes as part
of a plane update. Therefore a color management update must imply a
plane update, otherwise we never update the transformation matrixes
and degamma/gamma LUTs.

v2: add comment about moving the commit of color management registers
    to an async worker

v3: Commit color management register right after vblank

v4: Move back color management commit condition together with planes
    commit

v5: Trigger color management commit through the planes commit (Daniel)

Fixes: 20a34e78f0d7 (drm/i915: Update color management during vblank evasion.)
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 drivers/gpu/drm/i915/intel_color.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 1b3f974..54a9a0d 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -509,7 +509,7 @@ int intel_color_check(struct drm_crtc *crtc,
 	     crtc_state->degamma_lut->length == degamma_length) &&
 	    (!crtc_state->gamma_lut ||
 	     crtc_state->gamma_lut->length == gamma_length))
-		return 0;
+		goto success;
 
 	/*
 	 * We also allow no degamma lut and a gamma lut at the legacy
@@ -518,9 +518,19 @@ int intel_color_check(struct drm_crtc *crtc,
 	if (!crtc_state->degamma_lut &&
 	    crtc_state->gamma_lut &&
 	    crtc_state->gamma_lut->length == LEGACY_LUT_LENGTH)
-		return 0;
+		goto success;
 
 	return -EINVAL;
+
+ success:
+
+	/*
+	 * Changing color management on Intel hardware is handled as part of
+	 * planes update.
+	 */
+	crtc_state->planes_changed = true;
+
+	return 0;
 }
 
 void intel_color_init(struct drm_crtc *crtc)
-- 
2.8.1



More information about the Intel-gfx mailing list