From patchwork Thu Dec 3 11:37:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sharma, Shashank" X-Patchwork-Id: 7758981 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DF1FEBEEE1 for ; Thu, 3 Dec 2015 11:29:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2279820499 for ; Thu, 3 Dec 2015 11:29:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1F260205B7 for ; Thu, 3 Dec 2015 11:29:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAE957A148; Thu, 3 Dec 2015 03:29:18 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D05B7A145; Thu, 3 Dec 2015 03:29:15 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 03 Dec 2015 03:29:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,378,1444719600"; d="scan'208";a="6790503" Received: from shashanks-desktop.iind.intel.com ([10.223.26.81]) by fmsmga004.fm.intel.com with ESMTP; 03 Dec 2015 03:29:11 -0800 From: Shashank Sharma To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jim.bish@intel.com, robert.bradford@intel.com, matthew.d.roper@intel.com Subject: [PATCH v8 25/25] drm/i915: Commit color correction only when needed Date: Thu, 3 Dec 2015 17:07:01 +0530 Message-Id: <1449142621-16602-26-git-send-email-shashank.sharma@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1449142621-16602-1-git-send-email-shashank.sharma@intel.com> References: <1449142621-16602-1-git-send-email-shashank.sharma@intel.com> Cc: avinash.reddy.palleti@intel.com, emil.l.velikov@gmail.com, kausalmalladi@gmail.com, =gary.k.smith@intel.com, daniel.vetter@intel.com, kiran.s.kumar@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,