From patchwork Mon Jan 9 14:38:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Melissa Wen X-Patchwork-Id: 40893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2195579wrt; Mon, 9 Jan 2023 06:46:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMYqCT1NuxGhNAUzgjs8KOwceOVW79KaYZsuOCXMcm9e2y9qc+GXd2AG809qHFRPsRrtd2 X-Received: by 2002:a17:907:a641:b0:7c1:4e8f:df2f with SMTP id vu1-20020a170907a64100b007c14e8fdf2fmr64964529ejc.17.1673275580159; Mon, 09 Jan 2023 06:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673275580; cv=none; d=google.com; s=arc-20160816; b=XoXjJ6g0ag4FT4m9AZAf0CxsfYG7sZhUUmNp0gJUTX5KECuDxrJGS41AJkEQfLqfCa ZZpiLulexB2LptNilJ3ZLjuT3PQxAE/pJXhujqbTV/i1UFCDllN0R+PyxrNbTKfoj6BH H5PvsG5CRQQw7src5QQOwGNlQVprcAC11KRcwmmFhTXGmp+klFT7zBnSrsaa/dyVTxls PcmOkigDYO1f71voIh+Z/e5q19gYCjHUEFh0h9uuQ+92kOO3Xbyf+Tcz4l5+XE9vzzT/ XMa2wsV6k4sxiJ0y5Ley6W+UVMTYEwBUJdTu24TgIrgOQpPAzArpz4MoM1dFUv1/zeAE jaYQ== 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=yZ+XADzHjwvGta78ZXBVQh4OGwv1Wat6G9lgsepYSyM=; b=igg+wJhSlQc+gwIkrQC+K90xaPtMGoVinxsAgpgJH1k/8C0f4rt9QcLuMWtPYSYosC H1CTrun1Mws0P5BLGT/vSapsquWtrxaIqYkmj8LwhzYUTBiOB/OWiR/JiqXLIqjC7PP+ 9Ah1qQJNsdOLJuYGzJSwVXSkMVEQ8NB6bIsh+EoAkr4JEC0JgzTC/BVXfhhYopqc3Vii i78zZNogubLaQnpuPPzBgymvnWRt57vQwwZe9gEzIcTwAH48Ow6q47IwhotTLetNBYFi Z3emXoOdRvHJYJV6XQCHiqg2F29EPpvX0yb6PyI/CTFgAXhtH591900Fsst2nQONQVnm VKGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="A/BXeZXW"; 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 a20-20020a17090680d400b007ad9adaf33dsi7488530ejx.372.2023.01.09.06.45.55; Mon, 09 Jan 2023 06:46:20 -0800 (PST) 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="A/BXeZXW"; 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 S234676AbjAIOpB (ORCPT + 99 others); Mon, 9 Jan 2023 09:45:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbjAIOoV (ORCPT ); Mon, 9 Jan 2023 09:44:21 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9CFB1E3F9 for ; Mon, 9 Jan 2023 06:44:20 -0800 (PST) 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=yZ+XADzHjwvGta78ZXBVQh4OGwv1Wat6G9lgsepYSyM=; b=A/BXeZXWL4HuH8i/jEvBcxdnAv ZDsm7EoqvVho9tRzSvxMx5l4aPf22MNse6N3kGsUoap3ZhaioKJwEu3AabOZ0SCuQyzQGjymoJIxn dFdeJ+/UaZT78/RRF8hzAL1vgoSkiPYc5W4WBtxJoxrYZiRDqvs5IYjuvy9m3P20Om7NgHGfBXYoj onOeJwyXdUwGEwix+YsVHbjprxp2c85esOC/K8ZvQLYJfkACHj/FfyRZRJaFyZxT5djIDBXBWjRqu V5K9X5grXuwBaSqY27q01RexqFEuzv9eQLEUnWCmEAvOZgoZ3vLyR5UG1fFFg247+d0p1ghdRQOQg djDdGOsA==; Received: from [41.74.137.107] (helo=killbill.home) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pEtNh-003TyM-5k; Mon, 09 Jan 2023 15:44:09 +0100 From: Melissa Wen To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch Cc: Joshua Ashton , alex.hung@amd.com, nicholas.kazlauskas@amd.com, sungjoon.kim@amd.com, seanpaul@chromium.org, bhawanpreet.lakha@amd.com, Shashank Sharma , ville.syrjala@linux.intel.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, kernel-dev@igalia.com, laurent.pinchart+renesas@ideasonboard.com, Melissa Wen , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 08/18] drm/amd/display: add comments to describe DM crtc color mgmt behavior Date: Mon, 9 Jan 2023 13:38:36 -0100 Message-Id: <20230109143846.1966301-9-mwen@igalia.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230109143846.1966301-1-mwen@igalia.com> References: <20230109143846.1966301-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 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?1754556614810135877?= X-GMAIL-MSGID: =?utf-8?q?1754556614810135877?= 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 10a29d131424..b54ef1392895 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 @@ -428,12 +428,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: even if 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: here there is no implicit sRGB regamma. 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;