Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp631385rdb; Fri, 8 Sep 2023 11:05:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2miw/aMClClgqfSUVIUuDOaaqydqibU3pFSMwIb4YGdPawJN8US8Y2KHJwTfYUgLlN4rO X-Received: by 2002:a17:907:a051:b0:9a5:8eab:49da with SMTP id gz17-20020a170907a05100b009a58eab49damr2181941ejc.19.1694196324406; Fri, 08 Sep 2023 11:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694196324; cv=none; d=google.com; s=arc-20160816; b=wPje9FYVOmfrWHifezesGlSP7Zazj67zGx5zp6asbrOg2cNsVKL8+Ojq59IVrHdq4O clkHXzEMqBlTVb69LLT8YK6CkNfDNhA/BXH0CBlTO/gWtmpgJNrgI7mSJ9IwZwMfzx9E KkrSfpj/0rRF0gELs7xRxesIhEgO1HOb0Rdp7QNuToQEFmzQQkfxq+2cskx0Xeak6Eim 28YOTbBcfhqYZUU9a5ipOTZ/f5PEI/yf4APSEPfiI8IPxz+9kBjuOl5HXvHYCuMAL5Q8 2q1BDIFhSoyTKVZq7iTnn+43aWO8ZkJyVctyhV+Z1oydWw4C8x6GXiWaM/34yEwnGHhC HtRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/3HL/MY3RdtWh1vMQUHby74pl15LcuHyGtAjiuUTn9o=; fh=sBugYdSgAWLOtnDg0LXp2MWLiWpPFXz7ioIhiUPphHI=; b=szN0KciHtGUqMe3QoYa/t1BfZGGzuxi6ljq/TCruNa+AiAJR6ENvyX69dwEoWV4iZs wBUbpeluCIMO+t6mdXAwH4rY2QB+/vSUvds6AfpcmA7TADiEkJ2+onKW5BxBzB6/4iCL btFV+vYu4ZacbkQZVlcNcMu92lRiaXGlol+H1z9+CEfiUfDWMA3+0AkHFTGNfbmqblSn Kc4TwpRrDtl5qtw+Mtq08tFAXig3N70XrFMvOW1JNwWR8gxZoyhLGw5V1++djxINw9Bc O73/woFKV5WhrEMnPN9lkxXcvNGffBvRMesJlBNzPoMQvUYuWWAKSsIiNN+fgxEa4W0h utqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=HP0JT8Co; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l17-20020a1709061c5100b0099bd5a646c2si1658915ejg.271.2023.09.08.11.04.55; Fri, 08 Sep 2023 11:05:24 -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=HP0JT8Co; 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 S241046AbjIHOT0 (ORCPT + 99 others); Fri, 8 Sep 2023 10:19:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234202AbjIHOTZ (ORCPT ); Fri, 8 Sep 2023 10:19:25 -0400 Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61651BEE for ; Fri, 8 Sep 2023 07:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=/3HL/MY3RdtWh1vMQUHby74pl15LcuHyGtAjiuUTn9o=; b=HP0JT8CodInRO7t0G/x2cSWiKb RaUD1gDG99tiv5/ScB3LcXBSM7VnBkf20RRaQB8TwufsQrz0dQ0oKeyci917iqkZQA6yygoCw++Gz gF1XTkVVhDvdGa6ItVIbVXFtQydhdPJjiEfap8p91N8FPY27xiAn7XI+oWci6qOGotzyGhj6mEZZW pJuaG7K0vUXTiL3ZEcUyX/uiZOgNpPpTYbWp8XKwORkkMvDMg+JAMXxAsvp+WG0EfzxtaZ5oJJ9Ph BemoJEYhndR8X1EMhtQwPFRLlyLSG9UGuKFa2VAwFkKa0VibEX9HA1soRNgVuOGOTvkg5VSNhvSrP YWja1a3g==; Received: from [38.44.68.151] (helo=mail.igalia.com) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1qecKC-001OxZ-Od; Fri, 08 Sep 2023 16:19:08 +0200 Date: Fri, 8 Sep 2023 13:19:02 -0100 From: Melissa Wen To: Pekka Paalanen Cc: Harry Wentland , amd-gfx@lists.freedesktop.org, 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, Joshua Ashton , Sebastian Wick , Xaver Hugl , Shashank Sharma , Nicholas Kazlauskas , sungjoon.kim@amd.com, Alex Hung , Simon Ser , kernel-dev@igalia.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 10/34] drm/amd/display: add plane 3D LUT driver-specific properties Message-ID: <20230908141902.5lfgdjusfcabgluw@mail.igalia.com> References: <20230810160314.48225-1-mwen@igalia.com> <20230810160314.48225-11-mwen@igalia.com> <758deee7-7530-4931-830e-d5a4acff337f@amd.com> <20230907105701.5b1c115f.pekka.paalanen@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230907105701.5b1c115f.pekka.paalanen@collabora.com> 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 On 09/07, Pekka Paalanen wrote: > On Wed, 6 Sep 2023 15:30:04 -0400 > Harry Wentland wrote: > > > On 2023-08-10 12:02, Melissa Wen wrote: > > > Add 3D LUT property for plane gamma correction using a 3D lookup table. > > > Since a 3D LUT has a limited number of entries in each dimension we want > > > to use them in an optimal fashion. This means using the 3D LUT in a > > > colorspace that is optimized for human vision, such as sRGB, PQ, or > > > another non-linear space. Therefore, userpace may need one 1D LUT > > > (shaper) before it to delinearize content and another 1D LUT after 3D > > > LUT (blend) to linearize content again for blending. The next patches > > > add these 1D LUTs to the plane color mgmt pipeline. > > > > > > Signed-off-by: Melissa Wen > > > --- > > > drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 10 ++++++++ > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 9 ++++++++ > > > .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 14 +++++++++++ > > > .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 23 +++++++++++++++++++ > > > 4 files changed, 56 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h > > > index 66bae0eed80c..730a88236501 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h > > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h > > > @@ -363,6 +363,16 @@ struct amdgpu_mode_info { > > > * @plane_hdr_mult_property: > > > */ > > > struct drm_property *plane_hdr_mult_property; > > > + /** > > > + * @plane_lut3d_property: Plane property for gamma correction using a > > > + * 3D LUT (pre-blending). > > > + */ > > > > I think we'll want to describe how the 3DLUT entries are laid out. > > Something that describes how userspace should fill it, like > > gamescope does for example: > > https://github.com/ValveSoftware/gamescope/blob/7108880ed80b68c21750369e2ac9b7315fecf264/src/color_helpers.cpp#L302 > > > > Something like: a three-dimensional array, with each dimension > > having a size of the cubed root of lut3d_size, blue being the > > outermost dimension, red the innermost. > > > > Here is an example of how we defined a 3D LUT layout in Weston: > > https://gitlab.freedesktop.org/wayland/weston/-/blob/68e2a606c056c8453c770263f41f34cd68bdc9d0/libweston/color.h#L114-152 > > I think that is the most clear definition it can be, without needing to > understand specific terminology. Thanks for sharing it, Pekka! I'll check Weston's definition for 3D LUT and also other elements for improving docs. Melissa > > > Thanks, > pq > > > > > > + struct drm_property *plane_lut3d_property; > > > + /** > > > + * @plane_degamma_lut_size_property: Plane property to define the max > > > + * size of 3D LUT as supported by the driver (read-only). > > > + */ > > > > We should probably document that the size of the 3DLUT should > > be the size of one dimension cubed, or that the cubed root of > > the LUT size gives the size per dimension. > > > > Harry