mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
To: Melissa Wen <mwen@igalia.com>,
	harry.wentland@amd.com, sunpeng.li@amd.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch
Cc: Nicholas.Choi@amd.com, Nicholas.Kazlauskas@amd.com,
	kernel-dev@igalia.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: don't enable DRM CRTC degamma property for DCE
Date: Sun, 13 Nov 2022 12:48:28 -0500	[thread overview]
Message-ID: <b5b44445-8ec4-7d67-149f-ec51ecf1b72c@amd.com> (raw)
In-Reply-To: <20221103184500.14450-1-mwen@igalia.com>



On 11/3/22 14:45, Melissa Wen wrote:
> DM maps DRM CRTC degamma to DPP (pre-blending) degamma block, but DCE doesn't
> support programmable degamma curve anywhere. Currently, a custom degamma is
> accepted by DM but just ignored by DCE driver and degamma correction isn't
> actually applied. There is no way to map custom degamma in DCE, therefore, DRM
> CRTC degamma property shouldn't be enabled for DCE drivers.
> 
> Signed-off-by: Melissa Wen <mwen@igalia.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> index 9ac2805c5d63..b3eadfc61555 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
> @@ -415,7 +415,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
>   {
>   	struct amdgpu_crtc *acrtc = NULL;
>   	struct drm_plane *cursor_plane;
> -
> +	bool is_dcn;
>   	int res = -ENOMEM;
>   
>   	cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL);
> @@ -453,8 +453,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
>   	acrtc->otg_inst = -1;
>   
>   	dm->adev->mode_info.crtcs[crtc_index] = acrtc;
> -	drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES,
> +
> +	/* Don't enable DRM CRTC degamma property for DCE since it doesn't
> +	 * support programmable degamma anywhere.
> +	 */
> +	is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch;
> +	drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0,
>   				   true, MAX_COLOR_LUT_ENTRIES);
> +
>   	drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES);
>   
>   	return 0;

Hi,

I tested it in a DCE device and the patch lgtm.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>

and merged it into amd-staging-drm-next.

Thanks
Siqueira

      reply	other threads:[~2022-11-13 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 18:45 Melissa Wen
2022-11-13 17:48 ` Rodrigo Siqueira [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=b5b44445-8ec4-7d67-149f-ec51ecf1b72c@amd.com \
    --to=rodrigo.siqueira@amd.com \
    --cc=Nicholas.Choi@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mwen@igalia.com \
    --cc=sunpeng.li@amd.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

all inboxes | Powered by JetHome®