Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07A99CD4F26 for ; Fri, 19 Jun 2026 10:55:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B74310F52A; Fri, 19 Jun 2026 10:55:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="gZ82MfrW"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2D98710E067; Fri, 19 Jun 2026 10:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=qr1NrmRo7P6MsvymuHxT1HILaxUPKp/Cz3MQaTaSZ2E=; b=gZ82MfrWosU1TyFrww2RyIBMwF ritxzGvlvPiwOafow16hnKxVVr42rl5Fg5ePEo2pfimS3M7fu3cl3vWYApXsuzw8STYSG8Z1RWxlm Pzgow7iZhWHYypfax4ySfHCZHnw1/7Yy94wPWhQMg4u8UIuPrfbJrdjQIWEsM3ctMZVIiwD2L8BaO jHacBoCS3ti3oWyk2Si0mJGJ5HL29ZnwV+hEXpVICtvvPEX7My6upFW+pyueAbmEsrc9xBLhcTx3A F6HAVjXVU63AKhPPmD8h69YX9LtFGVm/MXdESqGUkhBzjm8QZ0T4ihcb8sZ6sgnN/LWhZo8B01nj4 UtSzlGXQ==; Received: from [77.26.202.28] (helo=[10.0.21.106]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1waWs4-002UH8-Eb; Fri, 19 Jun 2026 12:54:48 +0200 Message-ID: Date: Fri, 19 Jun 2026 12:54:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/5] better LUT segmentation for EOTFs To: Harry Wentland , airlied@gmail.com, alexander.deucher@amd.com, christian.koenig@amd.com, simona@ffwll.ch, siqueira@igalia.com, sunpeng.li@amd.com Cc: Krunoslav Kovac , "Dr . David Alan Gilbert" , Bhawanpreet Lakha , Alex Hung , Aurabindo Pillai , Matthew Schwartz , pekka.paalanen@collabora.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-dev@igalia.com References: <20260506191606.15022-1-mwen@igalia.com> <2a48f435-10d9-4e6e-8979-bfd61451a93e@igalia.com> <7934974e-adf1-4507-98ab-708095cce491@amd.com> Content-Language: en-US From: Melissa Wen In-Reply-To: <7934974e-adf1-4507-98ab-708095cce491@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On 31/05/2026 19:15, Harry Wentland wrote: > On 2026-05-21 10:50, Melissa Wen wrote: >> >> >> On 06/05/2026 21:11, Melissa Wen wrote: >>> Hi, >>> >>> With an external HDR monitor, we can see gradient banding around the >>> sun >>> in the intro of Ori and the Will of the Wisps game on >>> steamOS/Gamescope. >>> Gamescope uses AMD predefined transfer functions for degamma, >>> shaper/pre-3D-LUT and blend/post-3D-LUT plus CRTC regamma, however, >>> only >>> degamma block has hardware curves. Shaper, blend, regamma predefined >>> TFs >>> are software-computed by AMD color module into PWL LUTs. In >>> addition, we >>> cannot use hardware curves on PRE_DEGAM with subsampled format, so >>> that, >>> predefined TFs are also translated to LUTs in this situation, using >>> GAMCOR block instead. For this translation, the driver originally used >>> the same helper for EOTFs and inverse EOTFs, even though they differ in >>> input domain, number of regions and number of TF points per region. >> >> Hello, >> >> Can someone review this series - and merge it, if everything is okay? >> > > Series is > Reviewed-by: Harry Wentland Hey Harry, Thanks for reviewing. Was this series applied to AMD's branch? Melissa > > Harry > >> Thanks, >> >> Melissa >> >>> >>> Baring this in mind, patch 1 maps degamma predefined curves as LUT >>> using >>> GAMCOR block for AMD driver-specific property that are still in use by >>> current gamescope. This was inspired by a similar patch from Harry for >>> colorop [1]. Patch 2 reverts commit 8b89acc0b2ba ("drm/amd/display: >>> Remove unused cm3_helper_translate_curve_to_degamma_hw_format") to >>> reintroduce cm3_helper_translate_curve_to_degamma_hw_format() and patch >>> 3 wire it up for encoded -> linear-light LUTs (degamma/blend). With 16 >>> samples per region across 12 regions for blend LUT (where hardware >>> fixed-function curves are not available and predefined TFs are >>> software-computed into LUTs), banding becomes almost imperceptible. >>> >>> Patch 4 and 5 increase precision in the brightest half, where PQ/SRGB >>> EOTFs are steeper, by enabling up to 256 samples per region and halving >>> the per-region point count across 9 regions (128 in [0.5, 1], 64 in >>> [0.25, 0.5], …). This better matches the shape of PQ/SRGB EOTFs. >>> Although patches 4 and 5 seem conceptually correct to me, I couldn't >>> see >>> clear improvement in the bright end with or without them. >>> >>> This series targets DCN3+ hw families. With this series: >>> - degamma and blend LUTs use >>>    cm3_helper_translate_curve_to_degamma_hw_format(): encoded input, >>>    non-zero end slope, up to 256 points linearly interpolated between >>>    adjacent TF pts, fitting [0,1] encoded input range. >>> - shaper and regamma LUTs continue using >>>    cm3_helper_translate_curve_to_hw_format(): linear-light input, zero >>>    end slope, 16 points per region across 32 regions. >>> >>> [1] https://lore.kernel.org/dri-devel/20260330153451.99472-8- >>> harry.wentland@amd.com/ >>> >>> [v1] https://lore.kernel.org/dri-devel/20260414220237.184289-1- >>> mwen@igalia.com/ >>> Changes: >>> - new patch for GAMCOR usage in case of degamma predefined TF with >>> subsampled formats >>> - fix misleading information regarding degamma hw curves (Kruno) >>> - clarify LUT segmentation choice using 8-bit sRGB as a reference >>> (Kruno) >>> >>> Best Regards, >>> >>> Melissa >>> >>> Melissa Wen (5): >>>    drm/amd/display: use GAMCOR for degamma private props in subsampled >>>      format >>>    Revert "drm/amd/display: Remove unused >>>      cm3_helper_translate_curve_to_degamma_hw_format" >>>    drm/amd/display: use a separate helper to translate degamma curves >>>    drm/amd/display: support up to 256 samples per region in >>> degamma/blend >>>      LUT >>>    drm/amd/display: use halving distribution for PQ/sRGB linearizing >>> LUT >>> >>>   .../amd/display/amdgpu_dm/amdgpu_dm_color.c   |  16 +- >>>   .../amd/display/dc/dcn30/dcn30_cm_common.c    | 184 >>> ++++++++++++++++++ >>>   .../display/dc/dwb/dcn30/dcn30_cm_common.h    |   4 + >>>   .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c   |  10 +- >>>   4 files changed, 204 insertions(+), 10 deletions(-) >>> >> >