From patchwork Sun Apr 23 14:10:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 86732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2221330vqo; Sun, 23 Apr 2023 07:23:59 -0700 (PDT) X-Google-Smtp-Source: AKy350aa84s1naQZrmulR9NHAtFmF9yFc1V9qodzZu0ctXXVbHArKc43pYqc8iUjNQcEs9pAe2SW X-Received: by 2002:a05:6a20:a1a0:b0:de:247e:d1fe with SMTP id r32-20020a056a20a1a000b000de247ed1femr10258924pzk.1.1682259839334; Sun, 23 Apr 2023 07:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682259839; cv=none; d=google.com; s=arc-20160816; b=cR/SIDkexTZP58pceHcVN/6c2k3+4OH2W6fPUoK32+XStQz+WQM9ySCK7lsuW7PgKf rgKTbG75BCQX+W9OX3mXIGGBu8TtgG3FYylgEgf89UKYLg6WQzX6Ym/rrC95iDvnvpxv 9IJLGmhmXgEub/aeXpu8PDchHULdcYVvqex7Dw6M/rGXFzH9BD1p4WP0+ETW4xPizLAC q6Wg6aScOh5yhMWdiTVLNTPv9BMozuJnTWG4orj0TZ29Wx5PYJ6BqPudUQeSq85/PPA8 sj1Ewke8L90QfBK+jNVtBdrKSzchFFM+Nq8L12/jBtGQKXJvriJASmdCPzeVMsBhBk+s SHpA== 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=K+6HAiokAFpNjOZfe6WgA9HAsgScvAWCci4ACm8KQN8=; b=p9r8+v/0uc721Pxodu0sSf3zXOQSDXYALH42LLxQ7UY3fcjFAkF96r4hYEITtE5Lf9 j4ACVuA38AjJic2rA17XdNl86VcWk+d2jEd6Tjg2OsOqlRpqALzy6x8f+/C92xxFgStS TeYeW5KICT6HSZyQBlUYyoaIfy+Dk6mKTQ+34oKHFLgwqB1QrinutAjEmViIEFRH4bS3 7Umhk/hIHiO6goySJY1TbHLk+qdGBPleFQocaB8gapx0q6Bat2Lpd6Du8A3nu79VWDTt 3RBS113139EXJ6l/m/ERrbIRYhfU70ubDeOdtI7+GNsnARhK6CHftCeEqXV2M+fFBJFm AqiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=hx19W7o9; 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 o16-20020a635a10000000b0051b3d5543c3si8918177pgb.130.2023.04.23.07.23.44; Sun, 23 Apr 2023 07:23:59 -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=hx19W7o9; 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 S230260AbjDWOOa (ORCPT + 99 others); Sun, 23 Apr 2023 10:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230231AbjDWOO1 (ORCPT ); Sun, 23 Apr 2023 10:14:27 -0400 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBDC30DB for ; Sun, 23 Apr 2023 07:13:53 -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=K+6HAiokAFpNjOZfe6WgA9HAsgScvAWCci4ACm8KQN8=; b=hx19W7o99rbwOcYM34nXNbSSO2 wNL6y1AqnOcuv62B7tlO7cHm2Mamz7TFvnDOpoVdX4iSCqBDLy14RJJhCiu5e9fAAzMxhYCxxlaXl hySJDSRTL/Cv8+a33gH5aQIROjh5lQr06r9/8oQLXkcUXZ59HIWqAwXQnSLB9RRaKYYFb+Gs/qQyM PgNCnsEa34yModOd4L5BkD2Noo5QY4wFU+UvANqowu7JU7BehKBJnr4hxXkt4yPQWMWT4FZFDK1t6 UfbeEMnf8VkLNQVqDokT5RCPODHQYd5XKsjPOziSs/PvQev4t0yHiP0N/qayIdHHz940+zkg1PH0C JVIariXg==; Received: from nat-wifi.fi.muni.cz ([147.251.43.9] helo=killbill.fi.muni.cz) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pqaST-00ANVs-FW; Sun, 23 Apr 2023 16:12:53 +0200 From: Melissa Wen To: amd-gfx@lists.freedesktop.org, Harry Wentland , Rodrigo Siqueira , sunpeng.li@amd.com, Alex Deucher , dri-devel@lists.freedesktop.org, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Joshua Ashton , Sebastian Wick , Xaver Hugl , Shashank Sharma , Nicholas Kazlauskas , sungjoon.kim@amd.com, Alex Hung , Melissa Wen , linux-kernel@vger.kernel.org Subject: [RFC PATCH 17/40] drm/amd/display: add comments to describe DM crtc color mgmt behavior Date: Sun, 23 Apr 2023 13:10:29 -0100 Message-Id: <20230423141051.702990-18-mwen@igalia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230423141051.702990-1-mwen@igalia.com> References: <20230423141051.702990-1-mwen@igalia.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763977293076988503?= X-GMAIL-MSGID: =?utf-8?q?1763977293076988503?= Describe some expected behavior of the AMD DM color mgmt programming. Signed-off-by: Melissa Wen --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 a4cb23d059bd..fe779d10834e 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 @@ -440,12 +440,23 @@ int amdgpu_dm_update_crtc_color_mgmt(struct dm_crtc_state *crtc) stream->out_transfer_func->type = TF_TYPE_DISTRIBUTED_POINTS; stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; + /* Note: although we pass has_rom as parameter here, we never + * actually use ROM because the color module only takes the ROM + * path if transfer_func->type == PREDEFINED. + * + * See more in mod_color_calculate_regamma_params() + */ r = __set_legacy_tf(stream->out_transfer_func, regamma_lut, regamma_size, has_rom); if (r) return r; } else if (has_regamma) { - /* If atomic regamma, CRTC RGM goes into RGM LUT. */ + /* CRTC RGM goes into RGM LUT. + * + * Note: there is no implicit sRGB regamma here. We are using + * degamma calculation from color module to calculate the curve + * from a linear base. + */ stream->out_transfer_func->type = TF_TYPE_DISTRIBUTED_POINTS; stream->out_transfer_func->tf = TRANSFER_FUNCTION_LINEAR;