From patchwork Fri Apr 12 10:21:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shankar, Uma" X-Patchwork-Id: 10897795 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 E379817E1 for ; Fri, 12 Apr 2019 09:55:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C93C428E29 for ; Fri, 12 Apr 2019 09:55:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD52928E2A; Fri, 12 Apr 2019 09:55:37 +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 7C1EC28E2C for ; Fri, 12 Apr 2019 09:55:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98EF0898C0; Fri, 12 Apr 2019 09:55:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9735F898C7; Fri, 12 Apr 2019 09:55:35 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2019 02:55:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,340,1549958400"; d="scan'208";a="315350763" Received: from linuxpresi1-desktop.iind.intel.com ([10.223.74.121]) by orsmga005.jf.intel.com with ESMTP; 12 Apr 2019 02:55:31 -0700 From: Uma Shankar To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [v3 7/7] drm/i915: Enable advance gamma mode Date: Fri, 12 Apr 2019 15:51:03 +0530 Message-Id: <1555064463-18479-8-git-send-email-uma.shankar@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1555064463-18479-1-git-send-email-uma.shankar@intel.com> References: <1555064463-18479-1-git-send-email-uma.shankar@intel.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dcastagna@chromium.org, sam@ravnborg.org, emil.l.velikov@gmail.com, Uma Shankar , seanpaul@chromium.org, ville.syrjala@intel.com, maarten.lankhorst@intel.com MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Enable advance gamma modes based on client caps. Signed-off-by: Uma Shankar --- drivers/gpu/drm/i915/intel_color.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c index edf5ff8..36604c16 100644 --- a/drivers/gpu/drm/i915/intel_color.c +++ b/drivers/gpu/drm/i915/intel_color.c @@ -926,8 +926,9 @@ static void icl_load_luts(const struct intel_crtc_state *crtc_state) if ((crtc_state->gamma_mode & GAMMA_MODE_MODE_MASK) == GAMMA_MODE_MODE_8BIT) { i9xx_load_luts(crtc_state); - } else if (crtc_state->base.gamma_mode_type == - MULTI_SEGMENTED_GAMMA_MODE_12BIT) { + } else if ((crtc_state->base.gamma_mode_type == + MULTI_SEGMENTED_GAMMA_MODE_12BIT) && + crtc_state->base.advance_gamma_mode_active) { icl_load_gamma_multi_segmented_lut(crtc_state, 0); } else { bdw_load_lut_10(crtc, gamma_lut, PAL_PREC_INDEX_VALUE(0)); @@ -1352,12 +1353,13 @@ static u32 icl_gamma_mode(struct intel_crtc_state *crtc_state) !crtc_state->c8_planes) gamma_mode |= POST_CSC_GAMMA_ENABLE; - if (!crtc_state->base.gamma_lut || - crtc_state_is_legacy_gamma(crtc_state)) - gamma_mode |= GAMMA_MODE_MODE_8BIT; - else if (crtc_state->base.gamma_mode_type == - MULTI_SEGMENTED_GAMMA_MODE_12BIT) + if (crtc_state->base.gamma_mode_type == + MULTI_SEGMENTED_GAMMA_MODE_12BIT && + crtc_state->base.advance_gamma_mode_active) gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED; + else if (!crtc_state->base.gamma_lut || + crtc_state_is_legacy_gamma(crtc_state)) + gamma_mode |= GAMMA_MODE_MODE_8BIT; else gamma_mode |= GAMMA_MODE_MODE_10BIT;