From patchwork Tue Jun 1 10:41:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Shankar, Uma" X-Patchwork-Id: 12290923 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 F3EC4C4708F for ; Tue, 1 Jun 2021 10:06:17 +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 C3C2F613AB for ; Tue, 1 Jun 2021 10:06:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3C2F613AB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E35F76E9C9; Tue, 1 Jun 2021 10:06:00 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C4166E9C3; Tue, 1 Jun 2021 10:05:59 +0000 (UTC) IronPort-SDR: cgztEJslFxBBWpUDUkA+PSxQDynY9ofskMBfvxPtTATzLzRp7KiK0Mg5eDen/fyxc63pibDBs1 OgLzZI0e2Bhg== X-IronPort-AV: E=McAfee;i="6200,9189,10001"; a="183197753" X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="183197753" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 03:05:54 -0700 IronPort-SDR: o76rtFl+KRO2SrF+2YJbZSX0yvpPsFylG52BqFIM1OwS9+TTVkb5i8hp/fMqNIJoBP1RfTiQrd wM/+e7dDuMDQ== X-IronPort-AV: E=Sophos;i="5.83,239,1616482800"; d="scan'208";a="399245243" Received: from linux-desktop.iind.intel.com ([10.223.34.178]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2021 03:05:53 -0700 From: Uma Shankar To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH 6/9] drm/i915/xelpd: logarithmic gamma enabled only with advance gamma mode Date: Tue, 1 Jun 2021 16:11:32 +0530 Message-Id: <20210601104135.29020-7-uma.shankar@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210601104135.29020-1-uma.shankar@intel.com> References: <20210601104135.29020-1-uma.shankar@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Uma Shankar , bhanuprakash.modem@intel.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Only Enable Logarithmic Gamma if client caps for advance gamma mode is enabled. Fallback to 10bit gamma in case its not supported. Signed-off-by: Uma Shankar --- drivers/gpu/drm/i915/display/intel_color.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c index cae96fbec1a7..18b51b9cc2aa 100644 --- a/drivers/gpu/drm/i915/display/intel_color.c +++ b/drivers/gpu/drm/i915/display/intel_color.c @@ -1606,13 +1606,17 @@ static u32 icl_gamma_mode(const struct intel_crtc_state *crtc_state) gamma_mode |= POST_CSC_GAMMA_ENABLE; if (!crtc_state->hw.gamma_lut || - crtc_state_is_legacy_gamma(crtc_state)) + crtc_state_is_legacy_gamma(crtc_state)) { gamma_mode |= GAMMA_MODE_MODE_8BIT; - else if (crtc_state->uapi.gamma_mode_type == - GAMMA_MODE_LOGARITHMIC_12BIT) - gamma_mode |= GAMMA_MODE_MODE_12BIT_LOGARITHMIC; - else + } else if (crtc_state->uapi.gamma_mode_type == + GAMMA_MODE_LOGARITHMIC_12BIT) { + if (crtc_state->uapi.advance_gamma_mode_active) + gamma_mode |= GAMMA_MODE_MODE_12BIT_LOGARITHMIC; + else + gamma_mode |= GAMMA_MODE_MODE_10BIT; + } else { gamma_mode |= GAMMA_MODE_MODE_12BIT_MULTI_SEGMENTED; + } return gamma_mode; }