diff mbox

[v8,25/25] drm/i915: Commit color correction only when needed

Message ID 1449142621-16602-26-git-send-email-shashank.sharma@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sharma, Shashank Dec. 3, 2015, 11:37 a.m. UTC
This patch optimizes the commit path for i915 driver, by applying
color corrections, only when required. Pipe level color correction
(like CSC/gamma/degamma) once applied, sustain until the next change.

DRM layer sets a flag in crtc state (color_correction_changed),
whenever there is new set_property call. Apply color correction
from the commit layer, only when this flag is set, else pass.

Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/i915/intel_color_manager.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_color_manager.c b/drivers/gpu/drm/i915/intel_color_manager.c
index dbefc12..a53cb96 100644
--- a/drivers/gpu/drm/i915/intel_color_manager.c
+++ b/drivers/gpu/drm/i915/intel_color_manager.c
@@ -751,6 +751,15 @@  void intel_color_manager_crtc_commit(struct drm_device *dev,
 	struct drm_crtc *crtc = crtc_state->crtc;
 	int ret = -EINVAL;
 
+	/*
+	* CRTC level color correction, once applied on the
+	* pipe, goes on forever, until disabled, so there is no
+	* need to program all those correction registers on every
+	* commit. Do this only when a new correction applied.
+	*/
+	if (!crtc_state->color_correction_changed)
+		return;
+
 	blob = crtc_state->palette_after_ctm_blob;
 	if (blob) {
 		/* Gamma correction is platform specific */
@@ -792,6 +801,8 @@  void intel_color_manager_crtc_commit(struct drm_device *dev,
 		else
 			DRM_DEBUG_DRIVER("CSC correction success\n");
 	}
+
+	crtc_state->color_correction_changed = false;
 }
 
 void intel_attach_color_properties_to_crtc(struct drm_device *dev,