From patchwork Sat May 4 17:11:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sharma, Swati2" X-Patchwork-Id: 10929907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3E5E15A6 for ; Sat, 4 May 2019 17:15:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8A9B287F3 for ; Sat, 4 May 2019 17:15:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 822FF28823; Sat, 4 May 2019 17:15:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 14D12287F3 for ; Sat, 4 May 2019 17:15:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FC8D891C7; Sat, 4 May 2019 17:15:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 87301891C7 for ; Sat, 4 May 2019 17:15:51 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 May 2019 10:15:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,430,1549958400"; d="scan'208";a="229328039" Received: from genxfsim-shark-bay-client-platform.iind.intel.com ([10.223.74.155]) by orsmga001.jf.intel.com with ESMTP; 04 May 2019 10:15:47 -0700 From: Swati Sharma To: intel-gfx@lists.freedesktop.org Date: Sat, 4 May 2019 22:41:29 +0530 Message-Id: <1556989900-21972-1-git-send-email-swati2.sharma@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH 00/11] drm/i915: adding state checker for gamma lut values X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jani.nikula@intel.com, daniel.vetter@ffwll.ch, ankit.k.nautiyal@intel.com MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Thanks to Jani N, Matt and Ville for the review comments. In this patch series, added state checker to validate gamma and degamma lut values. This reads hardware state, and compares the originally requested state to the state read from hardware. v1: -Implementation done for legacy platforms (removed all the placeholders) (Jani) -Added inverse function of drm_color_lut_extract to convert hardware read values back to user values (code written by Jani) -Renamed get_config() to color_config() (Jani) -Placed all platform specific shifts and masks in i915_reg.h (Jani) -Renamed i9xx_get_config to i9xx_color_config and all related functions (Jani) -Removed debug logs from compare function (Jani) -Renamed intel_compare_blob to intel_compare_lut and added platform specific bit precision of the readout into the function (Jani) -Renamed macro PIPE_CONF_CHECK_BLOB to PIPE_CONF_CHECK_COLOR_LUT (Jani) -Added check if blobs can be NULL (Jani) -Added function in intel_color.c that returns the bit precision (Jani), didn't add in device info since its gonna die soon (Ville) v2: -Moved intel_compare_lut() from intel_display.c to intel_color.c (Jani) -Changed color_config() func names to get_color_config() and same for gamma func too (Jani) -Removed blank line in i915_reg.h and aligned MASK with their register name (Jani) -Mask definition code indented and defined using REG_GENMASK() and used using REG_FIELD_GET() (Jani) -Made bit_precision func inline (Jani/Matt) -Assigned bit_precision according to GAMMA_MODE (Matt/Ville) -Changed IS_ERR(blob) condition to (!blob) (Jani) -Rearranged blob check and lut_size conditions (Jani) -Used inline function for the comparison (Jani) -Separated the get config part from the state checker part to another patch (Jani) -Retained "internal" i9xx_internal_gamma_config for consistency (Matt) -Removed crtc_state_is_legacy_gamma check and replaced with GAMMA_MODE (Matt) -Created whole platform specific patch series as submitted by Ville for clean up intel_color_check() -Rebased on top of Ville's changes v3: -Rebase v4: -Renamed intel_get_color_config to intel_color_get_config (Jani) -Wrapped get_color_config() (Jani) -Added the user early on such that support for get_color_config() can be added platform by platform incrementally (Jani) -Few changes in get_config_func (Jani) -Renamed intel_compare_color_lut() to intel_color_lut_equal() (Jani) -Corrected smatch warn "variable dereferenced before check" (Dan Carpenter) v5: -Added degamma validation (Ville) -Few other changes as suggested by Ville and Jani Swati Sharma (11): drm/i915: Introduce vfunc read_luts() to create hw lut drm/i915: Enable intel_color_read_luts() drm/i915: Extract i9xx_read_luts() drm/i915: Extract chv_read_luts() drm/i915: Extract i965_read_luts() drm/i915: Extract icl_read_luts() drm/i915: Extract glk_read_luts() drm/i915: Extract bdw_read_luts() drm/i915: Extract ivb_read_luts() drm/i915: Extract ilk_read_luts() drm/i915: Add intel_color_lut_equal() to compare hw and sw gamma/degamma lut values drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 19 ++ drivers/gpu/drm/i915/intel_color.c | 460 ++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/intel_color.h | 7 + drivers/gpu/drm/i915/intel_display.c | 16 ++ 5 files changed, 498 insertions(+), 5 deletions(-)