Message ID | 20230109143846.1966301-1-mwen@igalia.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2195954wrt; Mon, 9 Jan 2023 06:47:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXs76c7CB/4EjXDG4xgflZKnO8llGqHZj7RHK6H/GKgrD+QKoSbCS9W5EuhhXuFNDocy+vKW X-Received: by 2002:a17:907:8744:b0:7c0:dd66:e991 with SMTP id qo4-20020a170907874400b007c0dd66e991mr54952515ejc.6.1673275623301; Mon, 09 Jan 2023 06:47:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673275623; cv=none; d=google.com; s=arc-20160816; b=DdfMqLz+m9k2aSgJ8UCXDI6Rfby2l3awsKt8pvnXNkJWFLDes/qtixXoHcDfXzOGEU 7XqT/29MPk0F/b7VtyxscBEV0wTOPHQ4UznA0irFjQ5RSTF9igepe082DnFDY/AStcZY UPmIrsGoQHt9AVkxEFsxxTR9HsLMagnKRtlQOW6TA2Yl6h2KowGFmLK9pe8FR0D0NBMl 6W94grgYwpqUNxB/tADcAw0cVBmJAotz6uILJ/fuss1Mz/HeR9rsn0TPRKt8veZ/XfYH uEwK3iQzIvLWIv1V33LWYi1SD6LGFAZ+o5JJqC1PDOHGPaJu3U92oeKW5p12EoIgHJRY rD0g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=d8WDzN1sPI7Yo9TbrkKJVaN1hyvZR2akXJ2pfczfTE8=; b=e/3gCNXYycu/Zrc7j6brzoC8reTKzoQfQIJv/nmmS1f3mtWR1K82y5h+eeYhqF8RbI 1C6W1MJpTMStcoBgvzEMW9K6YvDpmA1PgwmJN9lxMoBNAb90CJKyDnMSTyP89tCfS8il /nADgXq63H1kuN16AWa4cM80leD0ZLxRaUBh/cGx4ZbvwzUd/mdY7RvtG9qaVVRN+Y7C lGXGOSLrWivSDvsQ7GC+8p1p04a3kcyh4An2C4fazd6VRsvs+LNyXbWACjdFQK/xEIss PBivOgBMxnij7t5WMvsOyhonVMRXHpT348RHEbY6mjDNC/tj9S7pOw9fillPn8ZNr38h UJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=hTAdZjrI; 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 qw10-20020a1709066a0a00b0080f0493b9c2si8652078ejc.249.2023.01.09.06.46.39; Mon, 09 Jan 2023 06:47:03 -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=hTAdZjrI; 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 S233393AbjAIOoO (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 9 Jan 2023 09:44:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjAIOoE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 9 Jan 2023 09:44:04 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C44791A835 for <linux-kernel@vger.kernel.org>; Mon, 9 Jan 2023 06:44:02 -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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=d8WDzN1sPI7Yo9TbrkKJVaN1hyvZR2akXJ2pfczfTE8=; b=hTAdZjrI/aOh34LmKzXARSWZWe 8/q6V6zyFHLlU5sFinbN1j2Gx0LuJC1KRFznCSB8bELo68h1s96DfsRaEpgf80VMVcHepe/ay3IAh mhVnlqq4tnm0hNuyrmmPr1T6gLOUbwmxOrAbh0wgtp+EU/BcaUk6wnb7363aUetEOLkYkCqkvqX/R SyN/S66ygNwCjo8aFZZsge8bBYfqQXQKjq42uGLSIkd5XlKXsdjL5H2oXr89+g7gECwhjtVPXiFnM RrDLSQxd/3a1pZc4KlOnBL4q7xWuOLjXGOUaUBarecfZgOb+ZgxFkZS425N48tFC3hn7MqXMJulnS KFTzkTbg==; 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-6i; Mon, 09 Jan 2023 15:43:43 +0100 From: Melissa Wen <mwen@igalia.com> To: airlied@gmail.com, alexander.deucher@amd.com, christian.koenig@amd.com, daniel@ffwll.ch, harry.wentland@amd.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, Rodrigo.Siqueira@amd.com, sunpeng.li@amd.com, tzimmermann@suse.de, Xinhui.Pan@amd.com Cc: Joshua Ashton <joshua@froggi.es>, alex.hung@amd.com, nicholas.kazlauskas@amd.com, sungjoon.kim@amd.com, seanpaul@chromium.org, bhawanpreet.lakha@amd.com, Shashank Sharma <shashank.sharma@amd.com>, ville.syrjala@linux.intel.com, kernel-dev@igalia.com, laurent.pinchart+renesas@ideasonboard.com, Melissa Wen <mwen@igalia.com>, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 00/18] Add DRM CRTC 3D LUT interface Date: Mon, 9 Jan 2023 13:38:28 -0100 Message-Id: <20230109143846.1966301-1-mwen@igalia.com> X-Mailer: git-send-email 2.35.1 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,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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754556659622375291?= X-GMAIL-MSGID: =?utf-8?q?1754556659622375291?= |
Series |
Add DRM CRTC 3D LUT interface
|
|
Message
Melissa Wen
Jan. 9, 2023, 2:38 p.m. UTC
Hi, After collecting comments in different places, here is a second version of the work on adding DRM CRTC 3D LUT support to the current DRM color mgmt interface. In comparison to previous proposals [1][2][3], here we add 3D LUT before gamma 1D LUT, but also a shaper 1D LUT before 3D LUT, that means the following DRM CRTC color correction pipeline: Blend -> Degamma 1D LUT -> CTM -> Shaper 1D LUT -> 3D LUT -> Gamma 1D LUT and we also add a DRM CRTC LUT3D_MODE property, based on Alex Hung proposal for pre-blending 3D LUT [4] (Thanks!), instead of just a LUT3D_SIZE, that allows userspace to use different supported settings of 3D LUT, fitting VA-API and new color API better. In this sense, I adjusted the pre-blending proposal for post-blending usage. Patches 1-6 targets the addition of shaper LUT and 3D LUT properties to the current DRM CRTC color mgmt pipeline. Patch 6 can be considered an extra/optional patch to define a default value for LUT3D_MODE, inspired by what we do for the plane blend mode property (pre-multiplied). Patches 7-18 targets AMD display code to enable shaper and 3D LUT usage on DCN 301 (our HW case). Patches 7-9 performs code cleanups on current AMD DM colors code, patch 10 updates AMD stream in case of user 3D LUT changes, patch 11/12 rework AMD MPC 3D LUT resource handling by context for DCN 301 (easily extendible to other DCN families). Finally, from 13-18, we wire up SHAPER LUT, LUT3D and LUT3D MODE to AMD display driver, exposing modes supported by HW and programming user shaper and 3D LUT accordingly. Our target userspace is Gamescope/SteamOS. Basic IGT tests were based on [5][6] and are available here (in-progress): https://gitlab.freedesktop.org/mwen/igt-gpu-tools/-/commits/crtc-lut3d-api [1] https://lore.kernel.org/all/20201221015730.28333-1-laurent.pinchart+renesas@ideasonboard.com/ [2] https://github.com/vsyrjala/linux/commit/4d28e8ddf2a076f30f9e5bdc17cbb4656fe23e69 [3] https://lore.kernel.org/amd-gfx/20220619223104.667413-1-mwen@igalia.com/ [4] https://lore.kernel.org/dri-devel/20221004211451.1475215-1-alex.hung@amd.com/ [5] https://patchwork.freedesktop.org/series/90165/ [6] https://patchwork.freedesktop.org/series/109402/ [VA_API] http://intel.github.io/libva/structVAProcFilterParameterBuffer3DLUT.html [KMS_pipe_API] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/11 Let me know your thoughts. Thanks, Melissa Alex Hung (2): drm: Add 3D LUT mode and its attributes drm/amd/display: Define 3D LUT struct for HDR planes Melissa Wen (16): drm/drm_color_mgmt: add shaper LUT to color mgmt properties drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt drm/drm_color_mgmt: add function to create 3D LUT modes supported drm/drm_color_mgmt: add function to attach 3D LUT props drm/drm_color_mgmt: set first lut3d mode as default drm/amd/display: remove unused regamma condition drm/amd/display: add comments to describe DM crtc color mgmt behavior drm/amd/display: encapsulate atomic regamma operation drm/amd/display: update lut3d and shaper lut to stream drm/amd/display: handle MPC 3D LUT resources for a given context drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 drm/amd/display: expand array of supported 3D LUT modes drm/amd/display: enable 3D-LUT DRM properties if supported drm/amd/display: add user 3D LUT support to the amdgpu_dm color pipeline drm/amd/display: decouple steps to reuse in shaper LUT support drm/amd/display: add user shaper LUT support to amdgpu_dm color pipeline .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 + .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 370 ++++++++++++++++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 + drivers/gpu/drm/amd/display/dc/core/dc.c | 49 ++- drivers/gpu/drm/amd/display/dc/dc.h | 8 + .../amd/display/dc/dcn301/dcn301_resource.c | 47 ++- .../amd/display/modules/color/color_gamma.h | 43 ++ drivers/gpu/drm/drm_atomic_state_helper.c | 7 + drivers/gpu/drm/drm_atomic_uapi.c | 24 ++ drivers/gpu/drm/drm_color_mgmt.c | 127 ++++++ drivers/gpu/drm/drm_fb_helper.c | 5 + drivers/gpu/drm/drm_mode_config.c | 21 + include/drm/drm_color_mgmt.h | 8 + include/drm/drm_crtc.h | 32 +- include/drm/drm_mode_config.h | 25 ++ include/drm/drm_mode_object.h | 2 +- include/uapi/drm/drm_mode.h | 17 + 18 files changed, 757 insertions(+), 39 deletions(-)
Comments
Hello I'm completing the support for 3D LUT on R-Car DU peripheral and I have used this series as a base. I'm wondering, since quite some time has passed without any update if this series is still a thing and it makes any sense for me to try to bring it forward. I'm asking as I've noticed: "[PATCH 00/36] drm/amd/display: add AMD driver-specific properties for color mgmt" which seems to supersede this proposal with driver-specific properties. I asked Melissa privately but I wasn't able to get an hold of her, so if anyone has any clue feel free to reply :) Thanks j On Mon, Jan 09, 2023 at 01:38:28PM -0100, Melissa Wen wrote: > Hi, > > After collecting comments in different places, here is a second version > of the work on adding DRM CRTC 3D LUT support to the current DRM color > mgmt interface. In comparison to previous proposals [1][2][3], here we > add 3D LUT before gamma 1D LUT, but also a shaper 1D LUT before 3D LUT, > that means the following DRM CRTC color correction pipeline: > > Blend -> Degamma 1D LUT -> CTM -> Shaper 1D LUT -> 3D LUT -> Gamma 1D LUT > > and we also add a DRM CRTC LUT3D_MODE property, based on Alex Hung > proposal for pre-blending 3D LUT [4] (Thanks!), instead of just a > LUT3D_SIZE, that allows userspace to use different supported settings of > 3D LUT, fitting VA-API and new color API better. In this sense, I > adjusted the pre-blending proposal for post-blending usage. > > Patches 1-6 targets the addition of shaper LUT and 3D LUT properties to > the current DRM CRTC color mgmt pipeline. Patch 6 can be considered an > extra/optional patch to define a default value for LUT3D_MODE, inspired > by what we do for the plane blend mode property (pre-multiplied). > > Patches 7-18 targets AMD display code to enable shaper and 3D LUT usage > on DCN 301 (our HW case). Patches 7-9 performs code cleanups on current > AMD DM colors code, patch 10 updates AMD stream in case of user 3D LUT > changes, patch 11/12 rework AMD MPC 3D LUT resource handling by context > for DCN 301 (easily extendible to other DCN families). Finally, from > 13-18, we wire up SHAPER LUT, LUT3D and LUT3D MODE to AMD display > driver, exposing modes supported by HW and programming user shaper and > 3D LUT accordingly. > > Our target userspace is Gamescope/SteamOS. > > Basic IGT tests were based on [5][6] and are available here (in-progress): > https://gitlab.freedesktop.org/mwen/igt-gpu-tools/-/commits/crtc-lut3d-api > > [1] https://lore.kernel.org/all/20201221015730.28333-1-laurent.pinchart+renesas@ideasonboard.com/ > [2] https://github.com/vsyrjala/linux/commit/4d28e8ddf2a076f30f9e5bdc17cbb4656fe23e69 > [3] https://lore.kernel.org/amd-gfx/20220619223104.667413-1-mwen@igalia.com/ > [4] https://lore.kernel.org/dri-devel/20221004211451.1475215-1-alex.hung@amd.com/ > [5] https://patchwork.freedesktop.org/series/90165/ > [6] https://patchwork.freedesktop.org/series/109402/ > [VA_API] http://intel.github.io/libva/structVAProcFilterParameterBuffer3DLUT.html > [KMS_pipe_API] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/11 > > Let me know your thoughts. > > Thanks, > > Melissa > > Alex Hung (2): > drm: Add 3D LUT mode and its attributes > drm/amd/display: Define 3D LUT struct for HDR planes > > Melissa Wen (16): > drm/drm_color_mgmt: add shaper LUT to color mgmt properties > drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt > drm/drm_color_mgmt: add function to create 3D LUT modes supported > drm/drm_color_mgmt: add function to attach 3D LUT props > drm/drm_color_mgmt: set first lut3d mode as default > drm/amd/display: remove unused regamma condition > drm/amd/display: add comments to describe DM crtc color mgmt behavior > drm/amd/display: encapsulate atomic regamma operation > drm/amd/display: update lut3d and shaper lut to stream > drm/amd/display: handle MPC 3D LUT resources for a given context > drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 > drm/amd/display: expand array of supported 3D LUT modes > drm/amd/display: enable 3D-LUT DRM properties if supported > drm/amd/display: add user 3D LUT support to the amdgpu_dm color > pipeline > drm/amd/display: decouple steps to reuse in shaper LUT support > drm/amd/display: add user shaper LUT support to amdgpu_dm color > pipeline > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 + > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + > .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 370 ++++++++++++++++-- > .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 + > drivers/gpu/drm/amd/display/dc/core/dc.c | 49 ++- > drivers/gpu/drm/amd/display/dc/dc.h | 8 + > .../amd/display/dc/dcn301/dcn301_resource.c | 47 ++- > .../amd/display/modules/color/color_gamma.h | 43 ++ > drivers/gpu/drm/drm_atomic_state_helper.c | 7 + > drivers/gpu/drm/drm_atomic_uapi.c | 24 ++ > drivers/gpu/drm/drm_color_mgmt.c | 127 ++++++ > drivers/gpu/drm/drm_fb_helper.c | 5 + > drivers/gpu/drm/drm_mode_config.c | 21 + > include/drm/drm_color_mgmt.h | 8 + > include/drm/drm_crtc.h | 32 +- > include/drm/drm_mode_config.h | 25 ++ > include/drm/drm_mode_object.h | 2 +- > include/uapi/drm/drm_mode.h | 17 + > 18 files changed, 757 insertions(+), 39 deletions(-) > > -- > 2.35.1 >
On Tue, 13 Jun 2023 17:43:55 +0200 Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > Hello > > I'm completing the support for 3D LUT on R-Car DU peripheral > and I have used this series as a base. > > I'm wondering, since quite some time has passed without any update if > this series is still a thing and it makes any sense for me to try to > bring it forward. > > I'm asking as I've noticed: > "[PATCH 00/36] drm/amd/display: add AMD driver-specific properties for color mgmt" > > which seems to supersede this proposal with driver-specific > properties. > > I asked Melissa privately but I wasn't able to get an hold of her, so > if anyone has any clue feel free to reply :) Hi, since no-one else replied, I'll point you to the thread starting at https://lists.freedesktop.org/archives/dri-devel/2023-May/403173.html and continuing to June. That is the plan of getting a common UAPI for these things. Thanks, pq > > Thanks > j > > On Mon, Jan 09, 2023 at 01:38:28PM -0100, Melissa Wen wrote: > > Hi, > > > > After collecting comments in different places, here is a second version > > of the work on adding DRM CRTC 3D LUT support to the current DRM color > > mgmt interface. In comparison to previous proposals [1][2][3], here we > > add 3D LUT before gamma 1D LUT, but also a shaper 1D LUT before 3D LUT, > > that means the following DRM CRTC color correction pipeline: > > > > Blend -> Degamma 1D LUT -> CTM -> Shaper 1D LUT -> 3D LUT -> Gamma 1D LUT > > > > and we also add a DRM CRTC LUT3D_MODE property, based on Alex Hung > > proposal for pre-blending 3D LUT [4] (Thanks!), instead of just a > > LUT3D_SIZE, that allows userspace to use different supported settings of > > 3D LUT, fitting VA-API and new color API better. In this sense, I > > adjusted the pre-blending proposal for post-blending usage. > > > > Patches 1-6 targets the addition of shaper LUT and 3D LUT properties to > > the current DRM CRTC color mgmt pipeline. Patch 6 can be considered an > > extra/optional patch to define a default value for LUT3D_MODE, inspired > > by what we do for the plane blend mode property (pre-multiplied). > > > > Patches 7-18 targets AMD display code to enable shaper and 3D LUT usage > > on DCN 301 (our HW case). Patches 7-9 performs code cleanups on current > > AMD DM colors code, patch 10 updates AMD stream in case of user 3D LUT > > changes, patch 11/12 rework AMD MPC 3D LUT resource handling by context > > for DCN 301 (easily extendible to other DCN families). Finally, from > > 13-18, we wire up SHAPER LUT, LUT3D and LUT3D MODE to AMD display > > driver, exposing modes supported by HW and programming user shaper and > > 3D LUT accordingly. > > > > Our target userspace is Gamescope/SteamOS. > > > > Basic IGT tests were based on [5][6] and are available here (in-progress): > > https://gitlab.freedesktop.org/mwen/igt-gpu-tools/-/commits/crtc-lut3d-api > > > > [1] https://lore.kernel.org/all/20201221015730.28333-1-laurent.pinchart+renesas@ideasonboard.com/ > > [2] https://github.com/vsyrjala/linux/commit/4d28e8ddf2a076f30f9e5bdc17cbb4656fe23e69 > > [3] https://lore.kernel.org/amd-gfx/20220619223104.667413-1-mwen@igalia.com/ > > [4] https://lore.kernel.org/dri-devel/20221004211451.1475215-1-alex.hung@amd.com/ > > [5] https://patchwork.freedesktop.org/series/90165/ > > [6] https://patchwork.freedesktop.org/series/109402/ > > [VA_API] http://intel.github.io/libva/structVAProcFilterParameterBuffer3DLUT.html > > [KMS_pipe_API] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/11 > > > > Let me know your thoughts. > > > > Thanks, > > > > Melissa > > > > Alex Hung (2): > > drm: Add 3D LUT mode and its attributes > > drm/amd/display: Define 3D LUT struct for HDR planes > > > > Melissa Wen (16): > > drm/drm_color_mgmt: add shaper LUT to color mgmt properties > > drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt > > drm/drm_color_mgmt: add function to create 3D LUT modes supported > > drm/drm_color_mgmt: add function to attach 3D LUT props > > drm/drm_color_mgmt: set first lut3d mode as default > > drm/amd/display: remove unused regamma condition > > drm/amd/display: add comments to describe DM crtc color mgmt behavior > > drm/amd/display: encapsulate atomic regamma operation > > drm/amd/display: update lut3d and shaper lut to stream > > drm/amd/display: handle MPC 3D LUT resources for a given context > > drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 > > drm/amd/display: expand array of supported 3D LUT modes > > drm/amd/display: enable 3D-LUT DRM properties if supported > > drm/amd/display: add user 3D LUT support to the amdgpu_dm color > > pipeline > > drm/amd/display: decouple steps to reuse in shaper LUT support > > drm/amd/display: add user shaper LUT support to amdgpu_dm color > > pipeline > > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 + > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + > > .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 370 ++++++++++++++++-- > > .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 + > > drivers/gpu/drm/amd/display/dc/core/dc.c | 49 ++- > > drivers/gpu/drm/amd/display/dc/dc.h | 8 + > > .../amd/display/dc/dcn301/dcn301_resource.c | 47 ++- > > .../amd/display/modules/color/color_gamma.h | 43 ++ > > drivers/gpu/drm/drm_atomic_state_helper.c | 7 + > > drivers/gpu/drm/drm_atomic_uapi.c | 24 ++ > > drivers/gpu/drm/drm_color_mgmt.c | 127 ++++++ > > drivers/gpu/drm/drm_fb_helper.c | 5 + > > drivers/gpu/drm/drm_mode_config.c | 21 + > > include/drm/drm_color_mgmt.h | 8 + > > include/drm/drm_crtc.h | 32 +- > > include/drm/drm_mode_config.h | 25 ++ > > include/drm/drm_mode_object.h | 2 +- > > include/uapi/drm/drm_mode.h | 17 + > > 18 files changed, 757 insertions(+), 39 deletions(-) > > > > -- > > 2.35.1 > >
Hi Pekka thanks for the reply On Thu, Jun 15, 2023 at 10:14:05AM +0300, Pekka Paalanen wrote: > On Tue, 13 Jun 2023 17:43:55 +0200 > Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > > > Hello > > > > I'm completing the support for 3D LUT on R-Car DU peripheral > > and I have used this series as a base. > > > > I'm wondering, since quite some time has passed without any update if > > this series is still a thing and it makes any sense for me to try to > > bring it forward. > > > > I'm asking as I've noticed: > > "[PATCH 00/36] drm/amd/display: add AMD driver-specific properties for color mgmt" > > > > which seems to supersede this proposal with driver-specific > > properties. > > > > I asked Melissa privately but I wasn't able to get an hold of her, so > > if anyone has any clue feel free to reply :) > > Hi, > > since no-one else replied, I'll point you to the thread starting at > https://lists.freedesktop.org/archives/dri-devel/2023-May/403173.html Yes, Melissa pointed me to that series privately yesterday. However, and here I might be missing something, per-plane properties do not apply well to the HW pipeline I'm looking at. The R-Car DU has a 1D LUT and a 3D LUT at the CRTC level (I guess 'post blending' is the right term here) ? A per-plane property doesn't seem to match how the HW work, but please feel free to correct me as this is all rather new to me and I might be overlooking something. My plan at the moment would have been to base my work on Melissa's RFC and re-send to prop discussions, unless it is certainly a dead-end and I have missed how to properly use per-plane properties on our HW. Thank you! > and continuing to June. That is the plan of getting a common UAPI for > these things. > > > Thanks, > pq > > > > > > Thanks > > j > > > > On Mon, Jan 09, 2023 at 01:38:28PM -0100, Melissa Wen wrote: > > > Hi, > > > > > > After collecting comments in different places, here is a second version > > > of the work on adding DRM CRTC 3D LUT support to the current DRM color > > > mgmt interface. In comparison to previous proposals [1][2][3], here we > > > add 3D LUT before gamma 1D LUT, but also a shaper 1D LUT before 3D LUT, > > > that means the following DRM CRTC color correction pipeline: > > > > > > Blend -> Degamma 1D LUT -> CTM -> Shaper 1D LUT -> 3D LUT -> Gamma 1D LUT > > > > > > and we also add a DRM CRTC LUT3D_MODE property, based on Alex Hung > > > proposal for pre-blending 3D LUT [4] (Thanks!), instead of just a > > > LUT3D_SIZE, that allows userspace to use different supported settings of > > > 3D LUT, fitting VA-API and new color API better. In this sense, I > > > adjusted the pre-blending proposal for post-blending usage. > > > > > > Patches 1-6 targets the addition of shaper LUT and 3D LUT properties to > > > the current DRM CRTC color mgmt pipeline. Patch 6 can be considered an > > > extra/optional patch to define a default value for LUT3D_MODE, inspired > > > by what we do for the plane blend mode property (pre-multiplied). > > > > > > Patches 7-18 targets AMD display code to enable shaper and 3D LUT usage > > > on DCN 301 (our HW case). Patches 7-9 performs code cleanups on current > > > AMD DM colors code, patch 10 updates AMD stream in case of user 3D LUT > > > changes, patch 11/12 rework AMD MPC 3D LUT resource handling by context > > > for DCN 301 (easily extendible to other DCN families). Finally, from > > > 13-18, we wire up SHAPER LUT, LUT3D and LUT3D MODE to AMD display > > > driver, exposing modes supported by HW and programming user shaper and > > > 3D LUT accordingly. > > > > > > Our target userspace is Gamescope/SteamOS. > > > > > > Basic IGT tests were based on [5][6] and are available here (in-progress): > > > https://gitlab.freedesktop.org/mwen/igt-gpu-tools/-/commits/crtc-lut3d-api > > > > > > [1] https://lore.kernel.org/all/20201221015730.28333-1-laurent.pinchart+renesas@ideasonboard.com/ > > > [2] https://github.com/vsyrjala/linux/commit/4d28e8ddf2a076f30f9e5bdc17cbb4656fe23e69 > > > [3] https://lore.kernel.org/amd-gfx/20220619223104.667413-1-mwen@igalia.com/ > > > [4] https://lore.kernel.org/dri-devel/20221004211451.1475215-1-alex.hung@amd.com/ > > > [5] https://patchwork.freedesktop.org/series/90165/ > > > [6] https://patchwork.freedesktop.org/series/109402/ > > > [VA_API] http://intel.github.io/libva/structVAProcFilterParameterBuffer3DLUT.html > > > [KMS_pipe_API] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/11 > > > > > > Let me know your thoughts. > > > > > > Thanks, > > > > > > Melissa > > > > > > Alex Hung (2): > > > drm: Add 3D LUT mode and its attributes > > > drm/amd/display: Define 3D LUT struct for HDR planes > > > > > > Melissa Wen (16): > > > drm/drm_color_mgmt: add shaper LUT to color mgmt properties > > > drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt > > > drm/drm_color_mgmt: add function to create 3D LUT modes supported > > > drm/drm_color_mgmt: add function to attach 3D LUT props > > > drm/drm_color_mgmt: set first lut3d mode as default > > > drm/amd/display: remove unused regamma condition > > > drm/amd/display: add comments to describe DM crtc color mgmt behavior > > > drm/amd/display: encapsulate atomic regamma operation > > > drm/amd/display: update lut3d and shaper lut to stream > > > drm/amd/display: handle MPC 3D LUT resources for a given context > > > drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 > > > drm/amd/display: expand array of supported 3D LUT modes > > > drm/amd/display: enable 3D-LUT DRM properties if supported > > > drm/amd/display: add user 3D LUT support to the amdgpu_dm color > > > pipeline > > > drm/amd/display: decouple steps to reuse in shaper LUT support > > > drm/amd/display: add user shaper LUT support to amdgpu_dm color > > > pipeline > > > > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 + > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + > > > .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 370 ++++++++++++++++-- > > > .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 + > > > drivers/gpu/drm/amd/display/dc/core/dc.c | 49 ++- > > > drivers/gpu/drm/amd/display/dc/dc.h | 8 + > > > .../amd/display/dc/dcn301/dcn301_resource.c | 47 ++- > > > .../amd/display/modules/color/color_gamma.h | 43 ++ > > > drivers/gpu/drm/drm_atomic_state_helper.c | 7 + > > > drivers/gpu/drm/drm_atomic_uapi.c | 24 ++ > > > drivers/gpu/drm/drm_color_mgmt.c | 127 ++++++ > > > drivers/gpu/drm/drm_fb_helper.c | 5 + > > > drivers/gpu/drm/drm_mode_config.c | 21 + > > > include/drm/drm_color_mgmt.h | 8 + > > > include/drm/drm_crtc.h | 32 +- > > > include/drm/drm_mode_config.h | 25 ++ > > > include/drm/drm_mode_object.h | 2 +- > > > include/uapi/drm/drm_mode.h | 17 + > > > 18 files changed, 757 insertions(+), 39 deletions(-) > > > > > > -- > > > 2.35.1 > > > >
On Thu, 15 Jun 2023 10:07:35 +0200 Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > Hi Pekka > thanks for the reply > > On Thu, Jun 15, 2023 at 10:14:05AM +0300, Pekka Paalanen wrote: > > On Tue, 13 Jun 2023 17:43:55 +0200 > > Jacopo Mondi <jacopo.mondi@ideasonboard.com> wrote: > > > > > Hello > > > > > > I'm completing the support for 3D LUT on R-Car DU peripheral > > > and I have used this series as a base. > > > > > > I'm wondering, since quite some time has passed without any update if > > > this series is still a thing and it makes any sense for me to try to > > > bring it forward. > > > > > > I'm asking as I've noticed: > > > "[PATCH 00/36] drm/amd/display: add AMD driver-specific properties for color mgmt" > > > > > > which seems to supersede this proposal with driver-specific > > > properties. > > > > > > I asked Melissa privately but I wasn't able to get an hold of her, so > > > if anyone has any clue feel free to reply :) > > > > Hi, > > > > since no-one else replied, I'll point you to the thread starting at > > https://lists.freedesktop.org/archives/dri-devel/2023-May/403173.html > > Yes, Melissa pointed me to that series privately yesterday. > > However, and here I might be missing something, per-plane properties do > not apply well to the HW pipeline I'm looking at. > > The R-Car DU has a 1D LUT and a 3D LUT at the CRTC level (I guess > 'post blending' is the right term here) ? A per-plane property > doesn't seem to match how the HW work, but please feel free to correct > me as this is all rather new to me and I might be overlooking > something. Post-blending, correct. The long term plan is to replicate the same idea to post-blending as it is planned for pre-blending. > > My plan at the moment would have been to base my work on Melissa's RFC > and re-send to prop discussions, unless it is certainly a dead-end and > I have missed how to properly use per-plane properties on our HW. I'm not a kernel dev nor a maintainer, so I can't comment on what would be acceptable in the mean time before the new pipeline design is implemented. The long term plan is to supersede all existing color transformation related properties with pipelines. Thanks, pq > > Thank you! > > > and continuing to June. That is the plan of getting a common UAPI for > > these things. > > > > > > Thanks, > > pq > > > > > > > > > > Thanks > > > j > > > > > > On Mon, Jan 09, 2023 at 01:38:28PM -0100, Melissa Wen wrote: > > > > Hi, > > > > > > > > After collecting comments in different places, here is a second version > > > > of the work on adding DRM CRTC 3D LUT support to the current DRM color > > > > mgmt interface. In comparison to previous proposals [1][2][3], here we > > > > add 3D LUT before gamma 1D LUT, but also a shaper 1D LUT before 3D LUT, > > > > that means the following DRM CRTC color correction pipeline: > > > > > > > > Blend -> Degamma 1D LUT -> CTM -> Shaper 1D LUT -> 3D LUT -> Gamma 1D LUT > > > > > > > > and we also add a DRM CRTC LUT3D_MODE property, based on Alex Hung > > > > proposal for pre-blending 3D LUT [4] (Thanks!), instead of just a > > > > LUT3D_SIZE, that allows userspace to use different supported settings of > > > > 3D LUT, fitting VA-API and new color API better. In this sense, I > > > > adjusted the pre-blending proposal for post-blending usage. > > > > > > > > Patches 1-6 targets the addition of shaper LUT and 3D LUT properties to > > > > the current DRM CRTC color mgmt pipeline. Patch 6 can be considered an > > > > extra/optional patch to define a default value for LUT3D_MODE, inspired > > > > by what we do for the plane blend mode property (pre-multiplied). > > > > > > > > Patches 7-18 targets AMD display code to enable shaper and 3D LUT usage > > > > on DCN 301 (our HW case). Patches 7-9 performs code cleanups on current > > > > AMD DM colors code, patch 10 updates AMD stream in case of user 3D LUT > > > > changes, patch 11/12 rework AMD MPC 3D LUT resource handling by context > > > > for DCN 301 (easily extendible to other DCN families). Finally, from > > > > 13-18, we wire up SHAPER LUT, LUT3D and LUT3D MODE to AMD display > > > > driver, exposing modes supported by HW and programming user shaper and > > > > 3D LUT accordingly. > > > > > > > > Our target userspace is Gamescope/SteamOS. > > > > > > > > Basic IGT tests were based on [5][6] and are available here (in-progress): > > > > https://gitlab.freedesktop.org/mwen/igt-gpu-tools/-/commits/crtc-lut3d-api > > > > > > > > [1] https://lore.kernel.org/all/20201221015730.28333-1-laurent.pinchart+renesas@ideasonboard.com/ > > > > [2] https://github.com/vsyrjala/linux/commit/4d28e8ddf2a076f30f9e5bdc17cbb4656fe23e69 > > > > [3] https://lore.kernel.org/amd-gfx/20220619223104.667413-1-mwen@igalia.com/ > > > > [4] https://lore.kernel.org/dri-devel/20221004211451.1475215-1-alex.hung@amd.com/ > > > > [5] https://patchwork.freedesktop.org/series/90165/ > > > > [6] https://patchwork.freedesktop.org/series/109402/ > > > > [VA_API] http://intel.github.io/libva/structVAProcFilterParameterBuffer3DLUT.html > > > > [KMS_pipe_API] https://gitlab.freedesktop.org/pq/color-and-hdr/-/issues/11 > > > > > > > > Let me know your thoughts. > > > > > > > > Thanks, > > > > > > > > Melissa > > > > > > > > Alex Hung (2): > > > > drm: Add 3D LUT mode and its attributes > > > > drm/amd/display: Define 3D LUT struct for HDR planes > > > > > > > > Melissa Wen (16): > > > > drm/drm_color_mgmt: add shaper LUT to color mgmt properties > > > > drm/drm_color_mgmt: add 3D LUT props to DRM color mgmt > > > > drm/drm_color_mgmt: add function to create 3D LUT modes supported > > > > drm/drm_color_mgmt: add function to attach 3D LUT props > > > > drm/drm_color_mgmt: set first lut3d mode as default > > > > drm/amd/display: remove unused regamma condition > > > > drm/amd/display: add comments to describe DM crtc color mgmt behavior > > > > drm/amd/display: encapsulate atomic regamma operation > > > > drm/amd/display: update lut3d and shaper lut to stream > > > > drm/amd/display: handle MPC 3D LUT resources for a given context > > > > drm/amd/display: acquire/release 3D LUT resources for ctx on DCN301 > > > > drm/amd/display: expand array of supported 3D LUT modes > > > > drm/amd/display: enable 3D-LUT DRM properties if supported > > > > drm/amd/display: add user 3D LUT support to the amdgpu_dm color > > > > pipeline > > > > drm/amd/display: decouple steps to reuse in shaper LUT support > > > > drm/amd/display: add user shaper LUT support to amdgpu_dm color > > > > pipeline > > > > > > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 + > > > > .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 3 + > > > > .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 370 ++++++++++++++++-- > > > > .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 + > > > > drivers/gpu/drm/amd/display/dc/core/dc.c | 49 ++- > > > > drivers/gpu/drm/amd/display/dc/dc.h | 8 + > > > > .../amd/display/dc/dcn301/dcn301_resource.c | 47 ++- > > > > .../amd/display/modules/color/color_gamma.h | 43 ++ > > > > drivers/gpu/drm/drm_atomic_state_helper.c | 7 + > > > > drivers/gpu/drm/drm_atomic_uapi.c | 24 ++ > > > > drivers/gpu/drm/drm_color_mgmt.c | 127 ++++++ > > > > drivers/gpu/drm/drm_fb_helper.c | 5 + > > > > drivers/gpu/drm/drm_mode_config.c | 21 + > > > > include/drm/drm_color_mgmt.h | 8 + > > > > include/drm/drm_crtc.h | 32 +- > > > > include/drm/drm_mode_config.h | 25 ++ > > > > include/drm/drm_mode_object.h | 2 +- > > > > include/uapi/drm/drm_mode.h | 17 + > > > > 18 files changed, 757 insertions(+), 39 deletions(-) > > > > > > > > -- > > > > 2.35.1 > > > > > > > >