From patchwork Mon Mar 22 14:30:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BD1CC433C1 for ; Mon, 22 Mar 2021 06:38:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E896D61937 for ; Mon, 22 Mar 2021 06:38:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E896D61937 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A00C6E0C5; Mon, 22 Mar 2021 06:38:21 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C8766E0BA for ; Mon, 22 Mar 2021 06:38:19 +0000 (UTC) IronPort-SDR: EgMtLWx66GOh1WPSf946EgGbdWY9hIrfDB8es+uo0HHTLd3io4vYDaErq0qMQ4Ju6PpAeW32ip wAByk6SyljVA== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238709" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238709" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:19 -0700 IronPort-SDR: yT0iGX1cALTVad8jm3dx0AV70fZU06gMeDwk3m1xIBtSIqxJ/BMpoeU6MNqHTS+hS2yUfsiaFs zQCEINbnXB/g== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627103" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:17 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:02 +0530 Message-Id: <20210322143008.29250-2-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/7] drm/i915/display: Introduce vfunc read_csc() to create hw ctm X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" In this patch, a vfunc read_csc() is introduced to create a hw ctm i.e. ctm having values read from CSC registers which will later be used to compare with sw ctm to validate CSC coeff values. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 3 +++ drivers/gpu/drm/i915/i915_drv.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index ff7dcb7088bf..17bb08e9cf64 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1209,6 +1209,9 @@ void intel_color_get_config(struct intel_crtc_state *crtc_state) if (dev_priv->display.read_luts) dev_priv->display.read_luts(crtc_state); + + if (dev_priv->display.read_csc) + dev_priv->display.read_csc(crtc_state); } static bool need_plane_update(struct intel_plane *plane, diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 214fe10eb092..a8b55aca5fc4 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -327,6 +327,7 @@ struct drm_i915_display_funcs { */ void (*load_luts)(const struct intel_crtc_state *crtc_state); void (*read_luts)(struct intel_crtc_state *crtc_state); + void (*read_csc)(struct intel_crtc_state *crtc_state); }; struct intel_csr { From patchwork Mon Mar 22 14:30:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 852F1C433C1 for ; Mon, 22 Mar 2021 06:38:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F3E66195D for ; Mon, 22 Mar 2021 06:38:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F3E66195D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC6966E0BA; Mon, 22 Mar 2021 06:38:24 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73BA96E0BA for ; Mon, 22 Mar 2021 06:38:21 +0000 (UTC) IronPort-SDR: ABKlwgWNySx1iYbHDkgp6CxTWo8KqSpjEnloMiPDJIKDxwC46PcZ9HMjTy7GMkmB2OPViTs/AT sIFOmzc21C+A== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238717" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238717" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:21 -0700 IronPort-SDR: Elr1kHI93C0pG5QrnPK1KEVIYfmJvUhXv3TntwFGsXhvWB3EeavijjW2rMFN+0xN6zijQ1Gijq QBBlcs3fnrTQ== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627106" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:19 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:03 +0530 Message-Id: <20210322143008.29250-3-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/7] drm/i915/display: Add func to compare hw/sw CSC matrix X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add func intel_csc_equal() to compare hw/sw CSC coeff values. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 51 +++++++++++++++++++--- drivers/gpu/drm/i915/display/intel_color.h | 3 ++ 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 17bb08e9cf64..54dfd3523272 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -348,16 +348,11 @@ static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state) crtc_state->csc_mode); } -static void chv_load_cgm_csc(struct intel_crtc *crtc, - const struct drm_property_blob *blob) +static void chv_csc_convert_ctm(const struct drm_color_ctm *ctm, u16 coeffs[9]) { - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); - const struct drm_color_ctm *ctm = blob->data; - enum pipe pipe = crtc->pipe; - u16 coeffs[9]; int i; - for (i = 0; i < ARRAY_SIZE(coeffs); i++) { + for (i = 0; i < 9; i++) { u64 abs_coeff = ((1ULL << 63) - 1) & ctm->matrix[i]; /* Round coefficient. */ @@ -374,6 +369,17 @@ static void chv_load_cgm_csc(struct intel_crtc *crtc, coeffs[i] |= ((abs_coeff >> 32) & 7) << 12; coeffs[i] |= (abs_coeff >> 20) & 0xfff; } +} + +static void chv_load_cgm_csc(struct intel_crtc *crtc, + const struct drm_property_blob *blob) +{ + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + const struct drm_color_ctm *ctm = blob->data; + enum pipe pipe = crtc->pipe; + u16 coeffs[9]; + + chv_csc_convert_ctm(ctm, coeffs); intel_de_write(dev_priv, CGM_PIPE_CSC_COEFF01(pipe), coeffs[1] << 16 | coeffs[0]); @@ -1792,6 +1798,37 @@ bool intel_color_lut_equal(struct drm_property_blob *blob1, return true; } +bool intel_csc_equal(const struct intel_crtc_state *current_config, + struct drm_property_blob *blob1, + struct drm_property_blob *blob2) +{ + struct drm_i915_private *dev_priv = to_i915(current_config->uapi.crtc->dev); + struct drm_color_ctm *ctm1, *ctm2; + u16 coeffs[9]; + int i; + + if (!blob1 != !blob2) + return false; + + if (!blob1) + return true; + + ctm1 = blob1->data; + ctm2 = blob2->data; + + if (IS_CHERRYVIEW(dev_priv)) + chv_csc_convert_ctm(ctm1, coeffs); + else + ilk_csc_convert_ctm(current_config, coeffs); + + for (i = 0; i < 9; i++) { + if (abs(coeffs[i] - ctm2->matrix[i])) + return false; + } + + return true; +} + static struct drm_property_blob *i9xx_read_lut_8(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); diff --git a/drivers/gpu/drm/i915/display/intel_color.h b/drivers/gpu/drm/i915/display/intel_color.h index 173727aaa24d..e6bd9aa0c04a 100644 --- a/drivers/gpu/drm/i915/display/intel_color.h +++ b/drivers/gpu/drm/i915/display/intel_color.h @@ -21,5 +21,8 @@ int intel_color_get_gamma_bit_precision(const struct intel_crtc_state *crtc_stat bool intel_color_lut_equal(struct drm_property_blob *blob1, struct drm_property_blob *blob2, u32 gamma_mode, u32 bit_precision); +bool intel_csc_equal(const struct intel_crtc_state *crtc_state, + struct drm_property_blob *blob1, + struct drm_property_blob *blob2); #endif /* __INTEL_COLOR_H__ */ From patchwork Mon Mar 22 14:30:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153891 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45EEBC433E0 for ; Mon, 22 Mar 2021 06:38:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0132A61937 for ; Mon, 22 Mar 2021 06:38:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0132A61937 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 854646E2ED; Mon, 22 Mar 2021 06:38:25 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83FD56E0BA for ; Mon, 22 Mar 2021 06:38:23 +0000 (UTC) IronPort-SDR: gvqnTd9TPTIkmAzMyCoctYk8Q8MjBXpL9zD4Qch0L+jWTZ5g5STamPqtInfp3wDr3J20fyNBob Bu0uhru6BoFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238725" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238725" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:23 -0700 IronPort-SDR: t4/yCEDD0mcAFvkQrP0j6WcjDum3unhjvZZrb7s/hrlo9+vSXKuhEnMKnFBl8iJOI30/IMKkxE iS9w7VDQ9qlg== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627115" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:21 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:04 +0530 Message-Id: <20210322143008.29250-4-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/7] drm/i915/display: Add macro to compare hw/sw CSC matrix X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add macro to compare hw/sw CSC coeff values. First need to check whether hw/sw csc enable and csc mode matches or not. If not no need to compare coeff values, if matches then only compare. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_display.c | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 7b38b9a38b85..c4b9d4a238b9 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -8925,6 +8925,29 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, } \ } while (0) +#define PIPE_CONF_CHECK_CSC(name1, name2, name3) do { \ + if (current_config->name1 != pipe_config->name1) { \ + pipe_config_mismatch(fastset, crtc, __stringify(name1), \ + "(expected %s, found %s, won't compare csc coeffs)", \ + yesno(current_config->name1), \ + yesno(pipe_config->name1)); \ + ret = false;\ + } else if (current_config->name2 != pipe_config->name2) { \ + pipe_config_mismatch(fastset, crtc, __stringify(name2), \ + "(expected %i, found %i, won't compare csc coeffs)", \ + current_config->name2, \ + pipe_config->name2); \ + ret = false;\ + } else { \ + if (!intel_csc_equal(current_config, current_config->name3, \ + pipe_config->name3)) { \ + pipe_config_mismatch(fastset, crtc, __stringify(name3), \ + "hw_state doesn't match sw_state"); \ + ret = false; \ + } \ + } \ +} while (0) + #define PIPE_CONF_QUIRK(quirk) \ ((current_config->quirks | pipe_config->quirks) & (quirk)) @@ -9052,6 +9075,13 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, bp_gamma = intel_color_get_gamma_bit_precision(pipe_config); if (bp_gamma) PIPE_CONF_CHECK_COLOR_LUT(gamma_mode, hw.gamma_lut, bp_gamma); + + if (HAS_GMCH(dev_priv)) { + if (IS_CHERRYVIEW(dev_priv)) + PIPE_CONF_CHECK_CSC(csc_enable, cgm_mode, hw.ctm); + } else { + PIPE_CONF_CHECK_CSC(csc_enable, csc_mode, hw.ctm); + } } PIPE_CONF_CHECK_BOOL(double_wide); @@ -9143,6 +9173,7 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config, #undef PIPE_CONF_CHECK_FLAGS #undef PIPE_CONF_CHECK_CLOCK_FUZZY #undef PIPE_CONF_CHECK_COLOR_LUT +#undef PIPE_CONF_CHECK_CSC #undef PIPE_CONF_QUIRK return ret; From patchwork Mon Mar 22 14:30:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153893 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBEDEC433C1 for ; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9A5606195D for ; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A5606195D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 212CD6E0F8; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id B747E6E0F8 for ; Mon, 22 Mar 2021 06:38:33 +0000 (UTC) IronPort-SDR: ZUMD7fZ3JNHPU2Ce8sp5VeK/RWyqhMsfb43xE/cSOEgSQBvlgzy0Kw3xXlW/kjmUULkID+20kM TwsSCTz/38NA== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238737" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238737" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:25 -0700 IronPort-SDR: GxN09p92yxFHxWkdrztJR8oapADshMGCQiBqm7O7DfBVMpfwzfRB0sxKzvqaEpXW32Z9H5qybu Ns9MByCbw0mg== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627121" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:23 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:05 +0530 Message-Id: <20210322143008.29250-5-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 4/7] drm/i915/display: Extract chv_read_csc() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For Cherryview, add hw read out to create hw blob of ctm coeff values. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 54dfd3523272..15f97fbb77b3 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1943,6 +1943,52 @@ static void chv_read_luts(struct intel_crtc_state *crtc_state) i965_read_luts(crtc_state); } +static struct drm_property_blob *chv_read_cgm_ctm(struct intel_crtc *crtc) +{ + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + enum pipe pipe = crtc->pipe; + struct drm_property_blob *blob; + struct drm_color_ctm *ctm; + u32 temp; + + blob = drm_property_create_blob(&dev_priv->drm, + sizeof(struct drm_color_ctm), + NULL); + if (IS_ERR(blob)) + return NULL; + + ctm = blob->data; + + temp = intel_de_read(dev_priv, CGM_PIPE_CSC_COEFF01(pipe)); + ctm->matrix[0] = (temp >> 16) & 0xffff; + ctm->matrix[1] = temp & 0xffff; + + temp = intel_de_read(dev_priv, CGM_PIPE_CSC_COEFF23(pipe)); + ctm->matrix[2] = (temp >> 16) & 0xffff; + ctm->matrix[3] = temp & 0xffff; + + temp = intel_de_read(dev_priv, CGM_PIPE_CSC_COEFF45(pipe)); + ctm->matrix[4] = (temp >> 16) & 0xffff; + ctm->matrix[5] = temp & 0xffff; + + temp = intel_de_read(dev_priv, CGM_PIPE_CSC_COEFF67(pipe)); + ctm->matrix[6] = (temp >> 16) & 0xffff; + ctm->matrix[7] = temp & 0xffff; + + temp = intel_de_read(dev_priv, CGM_PIPE_CSC_COEFF8(pipe)); + ctm->matrix[8] = (temp >> 16) & 0xffff; + + return blob; +} + +static void chv_read_csc(struct intel_crtc_state *crtc_state) +{ + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); + + if (crtc_state->cgm_mode & CGM_PIPE_MODE_CSC) + crtc_state->hw.ctm = chv_read_cgm_ctm(crtc); +} + static struct drm_property_blob *ilk_read_lut_8(struct intel_crtc *crtc) { struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); @@ -2145,6 +2191,7 @@ void intel_color_init(struct intel_crtc *crtc) dev_priv->display.color_commit = i9xx_color_commit; dev_priv->display.load_luts = chv_load_luts; dev_priv->display.read_luts = chv_read_luts; + dev_priv->display.read_csc = chv_read_csc; } else if (INTEL_GEN(dev_priv) >= 4) { dev_priv->display.color_check = i9xx_color_check; dev_priv->display.color_commit = i9xx_color_commit; From patchwork Mon Mar 22 14:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05AC2C433DB for ; Mon, 22 Mar 2021 06:38:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8E9461937 for ; Mon, 22 Mar 2021 06:38:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8E9461937 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4EB526E2F2; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id F200D6E0F8 for ; Mon, 22 Mar 2021 06:38:33 +0000 (UTC) IronPort-SDR: C21sfMTFZNJIyu+IAeI1DIhtJWejylJnUuR5rKsbhCTO58zg+viVDldFwmDwG9aHo5LCVGb9tz BBcjEdhyaJMg== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238748" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238748" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:27 -0700 IronPort-SDR: 8YtNa/xszgz72BuMLFMelMoskTU+/DS2TwfnuvqMM7XCA4wW1C1ARBJpbLdn/8Vsz4YVn68Pmk +mhMXWXX9GrA== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627125" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:25 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:06 +0530 Message-Id: <20210322143008.29250-6-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 5/7] drm/i915/display: Extract ilk_read_csc() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For ilk+, add hw read out to create hw blob of ctm coeff values. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 15f97fbb77b3..877833f294bb 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -321,6 +321,54 @@ static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state) crtc_state->csc_mode); } +static struct drm_property_blob *ilk_read_csc_matrix(struct intel_crtc *crtc) +{ + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + enum pipe pipe = crtc->pipe; + struct drm_property_blob *blob; + struct drm_color_ctm *ctm; + u32 temp; + + blob = drm_property_create_blob(&dev_priv->drm, + sizeof(struct drm_color_ctm), + NULL); + if (IS_ERR(blob)) + return NULL; + + ctm = blob->data; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RY_GY(pipe)); + ctm->matrix[0] = (temp >> 16) & 0xffff; + ctm->matrix[1] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BY(pipe)); + ctm->matrix[2] = (temp >> 16) & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RU_GU(pipe)); + ctm->matrix[3] = (temp >> 16) & 0xffff; + ctm->matrix[4] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BU(pipe)); + ctm->matrix[5] = (temp >> 16) & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RV_GV(pipe)); + ctm->matrix[6] = (temp >> 16) & 0xffff; + ctm->matrix[7] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BV(pipe)); + ctm->matrix[8] = (temp >> 16) & 0xffff; + + return blob; +} + +static void ilk_read_csc(struct intel_crtc_state *crtc_state) +{ + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); + + if (crtc_state->csc_enable) + crtc_state->hw.ctm = ilk_read_csc_matrix(crtc); +} + static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state) { struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); @@ -2226,13 +2274,17 @@ void intel_color_init(struct intel_crtc *crtc) } else if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) { dev_priv->display.load_luts = glk_load_luts; dev_priv->display.read_luts = glk_read_luts; + dev_priv->display.read_csc = ilk_read_csc; } else if (INTEL_GEN(dev_priv) >= 8) { dev_priv->display.load_luts = bdw_load_luts; + dev_priv->display.read_csc = ilk_read_csc; } else if (INTEL_GEN(dev_priv) >= 7) { dev_priv->display.load_luts = ivb_load_luts; + dev_priv->display.read_csc = ilk_read_csc; } else { dev_priv->display.load_luts = ilk_load_luts; dev_priv->display.read_luts = ilk_read_luts; + dev_priv->display.read_csc = ilk_read_csc; } } From patchwork Mon Mar 22 14:30:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04642C433E2 for ; Mon, 22 Mar 2021 06:38:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7EAD6195D for ; Mon, 22 Mar 2021 06:38:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7EAD6195D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7DDD6E342; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FC226E2EF for ; Mon, 22 Mar 2021 06:38:34 +0000 (UTC) IronPort-SDR: jSqelCvWCtVeP3DFmtSZJHmJN8ycM1OKtYbiUZMlZUpJ5bmJo511v6mUWgE9ese/3HF7o7zQG7 ITzPrrsGTCfQ== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238753" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238753" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:29 -0700 IronPort-SDR: YndqRSyP5667lcdap48iaYBK6hhc1K7DYbi9Lx8AwRAVZwGU9sS9bGg/dG6loN/YnqRAur62fx 5UUBJqf4b2WQ== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627129" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:27 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:07 +0530 Message-Id: <20210322143008.29250-7-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 6/7] drm/i915/display: Extract icl_read_csc() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" For icl+, add hw read out to create hw blob of ctm coeff values. Cc: Swati Sharma Cc: Uma Shankar Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 877833f294bb..8f9727553c45 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -396,6 +396,60 @@ static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state) crtc_state->csc_mode); } +static struct drm_property_blob *icl_read_output_csc_matrix(struct intel_crtc *crtc) +{ + struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); + enum pipe pipe = crtc->pipe; + struct drm_property_blob *blob; + struct drm_color_ctm *ctm; + u32 temp; + + blob = drm_property_create_blob(&dev_priv->drm, + sizeof(struct drm_color_ctm), + NULL); + if (IS_ERR(blob)) + return NULL; + + ctm = blob->data; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_RY_GY(pipe)); + ctm->matrix[0] = (temp >> 16) & 0xffff; + ctm->matrix[1] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_BY(pipe)); + ctm->matrix[2] = (temp >> 16) & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_RU_GU(pipe)); + ctm->matrix[3] = (temp >> 16) & 0xffff; + ctm->matrix[4] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_BU(pipe)); + ctm->matrix[5] = (temp >> 16) & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_RV_GV(pipe)); + ctm->matrix[6] = (temp >> 16) & 0xffff; + ctm->matrix[7] = temp & 0xffff; + + temp = intel_de_read(dev_priv, PIPE_CSC_OUTPUT_COEFF_BV(pipe)); + ctm->matrix[8] = (temp >> 16) & 0xffff; + + return blob; +} + +static void icl_read_csc(struct intel_crtc_state *crtc_state) +{ + struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc); + + if (!crtc_state->csc_enable) + return; + + if (crtc_state->csc_mode & ICL_CSC_ENABLE) + crtc_state->hw.ctm = ilk_read_csc_matrix(crtc); + + if (crtc_state->csc_mode & ICL_OUTPUT_CSC_ENABLE) + crtc_state->hw.ctm = icl_read_output_csc_matrix(crtc); +} + static void chv_csc_convert_ctm(const struct drm_color_ctm *ctm, u16 coeffs[9]) { int i; @@ -2271,6 +2325,7 @@ void intel_color_init(struct intel_crtc *crtc) if (INTEL_GEN(dev_priv) >= 11) { dev_priv->display.load_luts = icl_load_luts; dev_priv->display.read_luts = icl_read_luts; + dev_priv->display.read_csc = icl_read_csc; } else if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) { dev_priv->display.load_luts = glk_load_luts; dev_priv->display.read_luts = glk_read_luts; From patchwork Mon Mar 22 14:30:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Modem, Bhanuprakash" X-Patchwork-Id: 12153895 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00, DATE_IN_FUTURE_06_12,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AAE5C433E0 for ; Mon, 22 Mar 2021 06:38:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0AB4361937 for ; Mon, 22 Mar 2021 06:38:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AB4361937 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3CDE46E2EF; Mon, 22 Mar 2021 06:38:35 +0000 (UTC) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A83F6E0F8 for ; Mon, 22 Mar 2021 06:38:34 +0000 (UTC) IronPort-SDR: 9H1ZQM/6ZKq8HkaACfYIQtEibKEvBAf7y/E1VBfE0XVXOrosWqGrYiNzqXYE3EAqkQm/zHvX/d dXE6UNl8dwlg== X-IronPort-AV: E=McAfee;i="6000,8403,9930"; a="190238756" X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="190238756" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:31 -0700 IronPort-SDR: OD88QqwoZVEa69k1AtT6AhruSHhxpD4pat7cIKEk+zPkeIMNgFKhpFuWOHNr1Mad45TEgT3idO fUJszY7nELhg== X-IronPort-AV: E=Sophos;i="5.81,268,1610438400"; d="scan'208";a="451627132" Received: from bhanu-nuclab.iind.intel.com ([10.145.162.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2021 23:38:30 -0700 From: Bhanuprakash Modem To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Mar 2021 20:00:08 +0530 Message-Id: <20210322143008.29250-8-bhanuprakash.modem@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com> References: <20210322143008.29250-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 7/7] FOR_TESTING_ONLY: Print coeffs of hw and sw CTM X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Signed-off-by: Bhanuprakash Modem --- drivers/gpu/drm/i915/display/intel_color.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index 8f9727553c45..caf4c3442b9e 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1909,6 +1909,8 @@ bool intel_csc_equal(const struct intel_crtc_state *current_config, u16 coeffs[9]; int i; + DRM_DEBUG_KMS("Bhanu debug--> sw_ctm[%s] hw_ctm[%s]", yesno(!!blob1), yesno(!!blob2)); + if (!blob1 != !blob2) return false; @@ -1923,6 +1925,9 @@ bool intel_csc_equal(const struct intel_crtc_state *current_config, else ilk_csc_convert_ctm(current_config, coeffs); + for (i = 0; i < 9; i++) + DRM_DEBUG_KMS("Bhanu debug--> sw_ctm[%d]=0x%x hw_ctm[%d]=0x%llx", i, coeffs[i], i, ctm2->matrix[i]); + for (i = 0; i < 9; i++) { if (abs(coeffs[i] - ctm2->matrix[i])) return false;