Message ID | 20230810160314.48225-28-mwen@igalia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp537397vqi; Thu, 10 Aug 2023 09:28:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETcV7yfWjOfSk7PeyjYNhGD6BVnDSLI+2KLHosS7MkXkOFfgrADP3huMMqXZV8gBwhFXgX X-Received: by 2002:a17:902:6b81:b0:1ac:a28e:4b29 with SMTP id p1-20020a1709026b8100b001aca28e4b29mr2624053plk.26.1691684923419; Thu, 10 Aug 2023 09:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691684923; cv=none; d=google.com; s=arc-20160816; b=UTMM0kxmY9zhKkdHn8Dk0wp8GoYCY/O9+Jb+tt9fnl1KAmSpddmuYRxlykFJAoaoUt +2RYTi62Z4cgGnjGkQJ4Q6rp/5oy3K5Kgz8CwwYtu2GppJQffmo8mcyklxfKxiEDcOxr +lJF4Auwu4uM/nHDAkAAmBuBo03uCIi7n7vsB6FKXIq2wy7wK5i03VRPUxyggqTOLmHV /tIx4dNWtqKazrQs9vioNajrgEzqoPUUZ0kp6hHbcTQPr8qy+JGfSRSD84DeFq5Aj4YC VB5y/X3ymvOwWl3oBNr+jKwF5nRzutNLEoGzGjX1axwA22G8fsyVPa9kJDiit2wQioQ2 IeRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yihuxHBV+g9axyR/xTXUOWNxZvnA2KOoauyFvn8HnIA=; fh=K4g2hpcHeis9i+u86e9V+yTBU0PZFkfdrKenkMdV+qw=; b=Wv1IlH3/Fmfo4pDvSDPTndihK9xuu6xHLLkNFmVsWafB94fL1qB3SJa1iAH/tuq8q6 4Z6pRgR8ul+8Mq9JpXPRy2jYeFj90JBR6Zl5ftDQbtgdMxaC+bnpt3F0eVXmpPmzSm7B 177lKRm3WzOn54isCymENTgo84h+UkI4UiTJy2iyZWeRoasjBjULPKG0EVzkh0Ms2bYy MdJ2kH6hiWugHjIo32LhJ1JuTsSTAeDAkpOEFADSP+tHJAKHt4hNoBd3xeuPcoYjKUlz bfkVpw81qysmlqHZtqx02Sv8ovRox+7VGIfdPK9zL5ji9Jlx9FGalj2y2tVuBeajbWeO EKwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=degDQUXN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a170902e89000b001bbb39ffe06si1745057plg.69.2023.08.10.09.28.29; Thu, 10 Aug 2023 09:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=degDQUXN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236534AbjHJQGC (ORCPT <rfc822;lanlanxiyiji@gmail.com> + 99 others); Thu, 10 Aug 2023 12:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235592AbjHJQFP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Aug 2023 12:05:15 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C0083AA4 for <linux-kernel@vger.kernel.org>; Thu, 10 Aug 2023 09:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=yihuxHBV+g9axyR/xTXUOWNxZvnA2KOoauyFvn8HnIA=; b=degDQUXNrS27ScPHvVWrEef+Ka 8oWWI2o/Uc3YGBnnp4oHfbfiwXFHBWsOAxWg47+4xLg5HLnaIDz5S2ivaIuAwmRLMHeMgclnwVQPm l/AXvQhfRMOCZhvqvREYRH/Vl4FAYHWrJgYC6bhFys4Ud2p394CQXZ3KVnXU9wz1ODYUUoDeWdT5S F0EE00hnqiWo1wbOHIS2cSePvSFJvOAvEAWrCa/kd6PAIAk/0olJWtFzef5BthHj5cq0Dq84I+a1H EwAPg/PGGfrODAdBsFkUarJjU0SnGDMN3RB0+42ElSmZ3so7PFkeMS7VaDRdpeZvvH0y1uj6sj/8w Ic5mRptA==; Received: from [38.44.68.151] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qU892-00GjYD-JE; Thu, 10 Aug 2023 18:04:16 +0200 From: Melissa Wen <mwen@igalia.com> To: amd-gfx@lists.freedesktop.org, Harry Wentland <harry.wentland@amd.com>, Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>, sunpeng.li@amd.com, Alex Deucher <alexander.deucher@amd.com>, dri-devel@lists.freedesktop.org, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Joshua Ashton <joshua@froggi.es>, Sebastian Wick <sebastian.wick@redhat.com>, Xaver Hugl <xaver.hugl@gmail.com>, Shashank Sharma <Shashank.Sharma@amd.com>, Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>, sungjoon.kim@amd.com, Alex Hung <alex.hung@amd.com>, Pekka Paalanen <pekka.paalanen@collabora.com>, Simon Ser <contact@emersion.fr>, kernel-dev@igalia.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 27/34] drm/amd/display: handle empty LUTs in __set_input_tf Date: Thu, 10 Aug 2023 15:03:07 -0100 Message-Id: <20230810160314.48225-28-mwen@igalia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230810160314.48225-1-mwen@igalia.com> References: <20230810160314.48225-1-mwen@igalia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773860210298050119 X-GMAIL-MSGID: 1773860210298050119 |
Series |
drm/amd/display: add AMD driver-specific properties for color mgmt
|
|
Commit Message
Melissa Wen
Aug. 10, 2023, 4:03 p.m. UTC
From: Joshua Ashton <joshua@froggi.es> Unlike degamma, blend gamma doesn't support hardcoded curve (predefined/ROM), but we can use AMD color module to fill blend gamma parameters when we have non-linear plane gamma TF without plane gamma LUT. The regular degamma path doesn't hit this. Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Joshua Ashton <joshua@froggi.es> Signed-off-by: Melissa Wen <mwen@igalia.com> --- .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c index 58c4797f506e..2c96501d2fc0 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c @@ -551,17 +551,21 @@ static int __set_input_tf(struct dc_transfer_func *func, struct dc_gamma *gamma = NULL; bool res; - gamma = dc_create_gamma(); - if (!gamma) - return -ENOMEM; + if (lut_size) { + gamma = dc_create_gamma(); + if (!gamma) + return -ENOMEM; - gamma->type = GAMMA_CUSTOM; - gamma->num_entries = lut_size; + gamma->type = GAMMA_CUSTOM; + gamma->num_entries = lut_size; - __drm_lut_to_dc_gamma(lut, gamma, false); + __drm_lut_to_dc_gamma(lut, gamma, false); + } - res = mod_color_calculate_degamma_params(NULL, func, gamma, true); - dc_gamma_release(&gamma); + res = mod_color_calculate_degamma_params(NULL, func, gamma, gamma != NULL); + + if (gamma) + dc_gamma_release(&gamma); return res ? 0 : -ENOMEM; }