All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shashank Sharma <shashank.sharma@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	jim.bish@intel.com, robert.bradford@intel.com,
	matthew.d.roper@intel.com
Cc: emil.l.velikov@gmail.com, kausalmalladi@gmail.com,
	=gary.k.smith@intel.com, daniel.vetter@intel.com
Subject: [PATCH v8 25/25] drm/i915: Commit color correction only when needed
Date: Thu,  3 Dec 2015 17:07:01 +0530	[thread overview]
Message-ID: <1449142621-16602-26-git-send-email-shashank.sharma@intel.com> (raw)
In-Reply-To: <1449142621-16602-1-git-send-email-shashank.sharma@intel.com>

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 --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,
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2015-12-03 11:37 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 11:36 [PATCH v8 00/25] Color Management for DRM framework Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 01/25] drm: Create Color Management DRM properties Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 02/25] drm: Create Color Management query properties Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 03/25] drm: Add color correction blobs in CRTC state Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 04/25] drm: Add set property support for color manager Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 05/25] drm: Add get " Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 06/25] drm: Add drm structures for palette color property Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 07/25] drm: Add structure for CTM " Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 08/25] drm: Add color correction state flag Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 09/25] drm/i915: Add set property interface for CRTC Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 10/25] drm/i915: Create color management files Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 11/25] drm/i915: Register color correction capabilities Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 12/25] drm/i915: CHV: Load gamma color correction values Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 13/25] drm/i915: CHV: Load degamma " Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 14/25] drm/i915: CHV: Pipe level Gamma correction Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 15/25] drm/i915: CHV: Pipe level degamma correction Shashank Sharma
2015-12-16 16:06   ` Lionel Landwerlin
2015-12-17 11:46     ` Sharma, Shashank
2015-12-03 11:36 ` [PATCH v8 16/25] drm/i915: CHV: Pipe level CSC correction Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 17/25] drm/i915: Commit color correction to CRTC Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 18/25] drm/i915: Attach color properties " Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 19/25] drm/i915: BDW: Load gamma correction values Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 20/25] drm/i915: BDW: Pipe level Gamma correction Shashank Sharma
2015-12-09 15:15   ` [PATCH v9 " Lionel Landwerlin
2015-12-03 11:36 ` [PATCH v8 21/25] drm/i915: BDW: Load degamma correction values Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 22/25] drm/i915: BDW: Pipe level degamma correction Shashank Sharma
2015-12-03 11:36 ` [PATCH v8 23/25] drm/i915: BDW: Pipe level CSC correction Shashank Sharma
2015-12-03 11:37 ` [PATCH v8 24/25] drm/i915: disable plane gamma Shashank Sharma
2015-12-03 11:37 ` Shashank Sharma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449142621-16602-26-git-send-email-shashank.sharma@intel.com \
    --to=shashank.sharma@intel.com \
    --cc==gary.k.smith@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jim.bish@intel.com \
    --cc=kausalmalladi@gmail.com \
    --cc=matthew.d.roper@intel.com \
    --cc=robert.bradford@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.