All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Harry Wentland" <harry.wentland@amd.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 09/11] drm/amd/display: Check actual state during commit_tail
Date: Wed, 22 Jul 2026 14:08:48 +0000	[thread overview]
Message-ID: <20260722140849.296691F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260722134607.136293-10-harry.wentland@amd.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Build Breakage / Function Prototype Mismatch
- [High] Logic Error overwriting correctly calculated color_space with SRGB during commit_tail
--

--- Patch [9]: [PATCH v4 09/11] drm/amd/display: Check actual state during commit_tail ---
commit 7fa51e59a15d532394f2e3959287098fefb48b8d
Author: Harry Wentland <harry.wentland@amd.com>

drm/amd/display: Check actual state during commit_tail

Previously we checked the plane_state->state's plane_color_pipeline
client config when determining whether fill_plane_color_attributes
should run, i.e., whether we had a plane color pipeline and should
use that code for handling fixed matrix properties, or whether we
should look at legacy plane encoding and range.

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index e7080880b2211..4f07fe5688262 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3008,7 +3008,8 @@ STATIC_IFN_KUNIT bool modereset_required(struct drm_crtc_state *crtc_state)
>  EXPORT_IF_KUNIT(modereset_required);
>  
>  STATIC_IFN_KUNIT int
> -fill_plane_color_attributes(const struct drm_plane_state *plane_state,
> +fill_plane_color_attributes(struct drm_atomic_commit *state,
> +			    const struct drm_plane_state *plane_state,
>  			    const enum surface_pixel_format format,
>  			    enum dc_color_space *color_space)
>  {

[Severity: High]
Will this break the build when CONFIG_DRM_AMD_DC_KUNIT_TEST is enabled?

The old prototype remains in drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:

    int fill_plane_color_attributes(const struct drm_plane_state *plane_state,
                                    const enum surface_pixel_format format,
                                    enum dc_color_space *color_space);

And the KUnit tests still call the function with 3 arguments:

drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_test.c:dm_test_fill_color_attr_rgb_format() {
    ...
    ret = fill_plane_color_attributes(&plane_state,
                                      SURFACE_PIXEL_FORMAT_GRPH_ARGB8888,
                                      &color_space);
    ...
}

> @@ -3017,7 +3018,7 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state,
>  	*color_space = COLOR_SPACE_SRGB;
>  
>  	/* Ignore properties when DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE is set */
> -	if (plane_state->state && plane_state->state->plane_color_pipeline)
> +	if (state && state->plane_color_pipeline)
>  		return 0;

[Severity: High]
Could this unintentionally overwrite the correctly calculated color_space with
COLOR_SPACE_SRGB during commit_tail?

Because *color_space is initialized to COLOR_SPACE_SRGB before the early
return, when the color pipeline is active, fill_plane_color_attributes() sets
plane_info->color_space to COLOR_SPACE_SRGB.

Later, DC core's copy_surface_update_to_plane() unconditionally copies this
value to surface->color_space:

drivers/gpu/drm/amd/display/dc/core/dc.c:copy_surface_update_to_plane() {
    ...
    if (srf_update->plane_info) {
        surface->color_space =
                srf_update->plane_info->color_space;
    ...
}

Can this clobber the fixed matrix value calculated during atomic check,
causing YUV-to-RGB conversion to be bypassed for YUV framebuffers?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260722134607.136293-1-harry.wentland@amd.com?part=9

  reply	other threads:[~2026-07-22 14:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 13:45 [PATCH v4 00/11] YUV conversion colorop with amdgpu and VKMS Harry Wentland
2026-07-22 13:45 ` [PATCH v4 01/11] drm/colorop: Add DRM_COLOROP_FIXED_MATRIX Harry Wentland
2026-07-22 13:55   ` sashiko-bot
2026-07-22 13:45 ` [PATCH v4 02/11] drm/vkms: Fix limited-range YCbCr to RGB conversion scaling Harry Wentland
2026-07-22 13:45 ` [PATCH v4 03/11] drm/vkms: Add KUnit test for YCbCr to RGB conversion matrices Harry Wentland
2026-07-22 14:01   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 04/11] drm/vkms: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 13:46 ` [PATCH v4 05/11] drm/vkms: Add atomic check and matrix handling for fixed matrix colorop Harry Wentland
2026-07-22 13:59   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 06/11] drm/amd/display: Add fixed matrix colorop to color pipeline Harry Wentland
2026-07-22 14:03   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 07/11] drm/amd/display: Implement fixed matrix colorop color space mapping Harry Wentland
2026-07-22 14:14   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 08/11] drm/amd/display: Use GAMCOR for first TF if YUV conversion is needed Harry Wentland
2026-07-22 13:46 ` [PATCH v4 09/11] drm/amd/display: Check actual state during commit_tail Harry Wentland
2026-07-22 14:08   ` sashiko-bot [this message]
2026-07-22 13:46 ` [PATCH v4 10/11] drm/amd/display: Set color_space to plane_infos Harry Wentland
2026-07-22 14:13   ` sashiko-bot
2026-07-22 13:46 ` [PATCH v4 11/11] drm/amd/display: Force GAMCOR for subsampled surfaces with PQ/Gamma22/HLG Harry Wentland

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=20260722140849.296691F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.