mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Hung <alex.hung@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>,
	Leorize <leorize+oss@disroot.org>,
	"Wentland, Harry" <Harry.Wentland@amd.com>,
	"Leo (Sunpeng) Li" <Sunpeng.Li@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Rodrigo Siqueira" <siqueira@igalia.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: add missing CSC entries for BT.2020 for DCE IPs
Date: Thu, 28 May 2026 16:33:20 -0600	[thread overview]
Message-ID: <460fcf7c-3e45-4c7a-899a-ba6cfd207aba@amd.com> (raw)
In-Reply-To: <CADnq5_OBaVum+jV3HBL3mqXfvrhqVOu+gcU9Y2QHdRryQDw8SA@mail.gmail.com>



On 5/28/26 13:03, Alex Deucher wrote:
> On Thu, May 28, 2026 at 3:39 AM Leorize <leorize+oss@disroot.org> wrote:
>>
>> DCE-based hardware does not have the CSC matrices for BT.2020, which
>> causes the driver to fallback to the GPU built-in matrices. This does
>> not appear to cause any issues for RGB sinks, but causes major color
>> artifacts for YCbCr ones (e.g. black becomes green).
>>
>> This commit adds the missing CSC matrices (taken from DC common) to DCE
>> CSC tables, resolving the issue.
>>
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/3358
>> Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5333
>> Assisted-by: oh-my-pi:GPT-5.5
>> Signed-off-by: Leorize <leorize+oss@disroot.org>
> 
> This looks reasonable to me.  @Wentland, Harry, @Leo (Sunpeng) Li any concerns?
> 
> Alex

Reviewed-by: Alex Hung <alex.hung@amd.com>

> 
>> ---
>>   drivers/gpu/drm/amd/display/dc/dce/dce_transform.c     | 10 +++++++++-
>>   .../gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c   | 10 +++++++++-
>>   2 files changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
>> index b3640682fa60..12c85c3afd6a 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_transform.c
>> @@ -110,7 +110,15 @@ static const struct out_csc_color_matrix global_color_matrix[] = {
>>   { COLOR_SPACE_YCBCR601_LIMITED, { 0xE00, 0xF447, 0xFDB9, 0x1000, 0x991,
>>          0x12C9, 0x3A6, 0x200, 0xFB47, 0xF6B9, 0xE00, 0x1000} },
>>   { COLOR_SPACE_YCBCR709_LIMITED, { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3,
>> -       0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }
>> +       0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} },
>> +{ COLOR_SPACE_2020_RGB_FULLRANGE,
>> +       { 0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} },
>> +{ COLOR_SPACE_2020_RGB_LIMITEDRANGE,
>> +       { 0x1B67, 0, 0, 0x201, 0, 0x1B67, 0, 0x201, 0, 0, 0x1B67, 0x201} },
>> +{ COLOR_SPACE_2020_YCBCR_LIMITED, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868,
>> +       0x15B2, 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} },
>> +{ COLOR_SPACE_2020_YCBCR_FULL, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2,
>> +       0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }
>>   };
>>
>>   static bool setup_scaling_configuration(
>> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
>> index cf63fac82832..1ed018aaa4bb 100644
>> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
>> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c
>> @@ -88,7 +88,15 @@ static const struct out_csc_color_matrix global_color_matrix[] = {
>>   { COLOR_SPACE_YCBCR601_LIMITED, { 0xE00, 0xF447, 0xFDB9, 0x1000, 0x991,
>>          0x12C9, 0x3A6, 0x200, 0xFB47, 0xF6B9, 0xE00, 0x1000} },
>>   { COLOR_SPACE_YCBCR709_LIMITED, { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3,
>> -       0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }
>> +       0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} },
>> +{ COLOR_SPACE_2020_RGB_FULLRANGE,
>> +       { 0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} },
>> +{ COLOR_SPACE_2020_RGB_LIMITEDRANGE,
>> +       { 0x1B67, 0, 0, 0x201, 0, 0x1B67, 0, 0x201, 0, 0, 0x1B67, 0x201} },
>> +{ COLOR_SPACE_2020_YCBCR_LIMITED, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868,
>> +       0x15B2, 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} },
>> +{ COLOR_SPACE_2020_YCBCR_FULL, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2,
>> +       0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }
>>   };
>>
>>   enum csc_color_mode {
>> --
>> 2.54.0
>>


      reply	other threads:[~2026-05-28 22:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  6:58 Leorize
2026-05-28 19:03 ` Alex Deucher
2026-05-28 22:33   ` Alex Hung [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460fcf7c-3e45-4c7a-899a-ba6cfd207aba@amd.com \
    --to=alex.hung@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=leorize+oss@disroot.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=siqueira@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome