All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: <dri-devel@lists.freedesktop.org>, <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>
Subject: [RFC PATCH v2 8/9] drm/amd/display: Check actual state during commit_tail
Date: Mon, 30 Mar 2026 11:34:50 -0400	[thread overview]
Message-ID: <20260330153451.99472-9-harry.wentland@amd.com> (raw)
In-Reply-To: <20260330153451.99472-1-harry.wentland@amd.com>

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 CSC properties, or whether we should
look at legacy plane encoding and range.

The problem is that we also call this during commit_tail, during
which plane_state doesn't have the state backpointer. This meant
that during commit_tail we'd look at the legacy plane COLOR_RANGE
and COLOR_ENCODING values and overwrite what we pulled from the
CSC colorop in atomic_check previously.

Instead pass the drm_atomic_state in explicitly and check that.

Co-developed by Claude Sonnet 4.5.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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 a0d4ab4590e1..c3c6211d15cd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6006,7 +6006,8 @@ static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {
 };
 
 static int
-fill_plane_color_attributes(const struct drm_plane_state *plane_state,
+fill_plane_color_attributes(struct drm_atomic_state *state,
+			    const struct drm_plane_state *plane_state,
 			    const enum surface_pixel_format format,
 			    enum dc_color_space *color_space)
 {
@@ -6015,7 +6016,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;
 
 	/* DRM color properties only affect non-RGB formats. */
@@ -6055,6 +6056,7 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state,
 
 static int
 fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
+			    struct drm_atomic_state *state,
 			    const struct drm_plane_state *plane_state,
 			    const u64 tiling_flags,
 			    struct dc_plane_info *plane_info,
@@ -6148,7 +6150,7 @@ fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
 
 	plane_info->layer_index = plane_state->normalized_zpos;
 
-	ret = fill_plane_color_attributes(plane_state, plane_info->format,
+	ret = fill_plane_color_attributes(state, plane_state, plane_info->format,
 					  &plane_info->color_space);
 	if (ret)
 		return ret;
@@ -6189,7 +6191,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev,
 	dc_plane_state->clip_rect = scaling_info.clip_rect;
 	dc_plane_state->scaling_quality = scaling_info.scaling_quality;
 
-	ret = fill_dc_plane_info_and_addr(adev, plane_state,
+	ret = fill_dc_plane_info_and_addr(adev, plane_state->state, plane_state,
 					  afb->tiling_flags,
 					  &plane_info,
 					  &dc_plane_state->address,
@@ -9984,7 +9986,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 		}
 
 		fill_dc_plane_info_and_addr(
-			dm->adev, new_plane_state,
+			dm->adev, state, new_plane_state,
 			afb->tiling_flags,
 			&bundle->plane_infos[planes_count],
 			&bundle->flip_addrs[planes_count].address,
-- 
2.53.0


  parent reply	other threads:[~2026-03-30 15:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 15:34 [RFC PATCH v2 0/9] YUV conversion colorop with amdgpu and VKMS Harry Wentland
2026-03-30 15:34 ` [RFC PATCH v2 1/9] drm/colorop: Add DRM_COLOROP_CSC_FF Harry Wentland
2026-04-08 11:31   ` Borah, Chaitanya Kumar
2026-03-30 15:34 ` [RFC PATCH v2 2/9] drm/colorop: Add limited-range YUV-to-RGB CSC FF enum values Harry Wentland
2026-04-21 21:22   ` Alex Hung
2026-04-23  9:34   ` Borah, Chaitanya Kumar
2026-04-30 18:19     ` Harry Wentland
2026-05-05 10:17       ` Borah, Chaitanya Kumar
2026-03-30 15:34 ` [RFC PATCH v2 3/9] drm/vkms: Add CSC FF colorop to color pipeline Harry Wentland
2026-04-21 21:21   ` Alex Hung
2026-03-30 15:34 ` [RFC PATCH v2 4/9] drm/vkms: Add atomic check and matrix handling for CSC FF colorop Harry Wentland
2026-04-21 21:20   ` Alex Hung
2026-03-30 15:34 ` [RFC PATCH v2 5/9] drm/amd/display: Add CSC FF colorop to color pipeline Harry Wentland
2026-04-21 21:14   ` Alex Hung
2026-03-30 15:34 ` [RFC PATCH v2 6/9] drm/amd/display: Implement CSC FF colorop color space mapping Harry Wentland
2026-04-21 21:13   ` Alex Hung
2026-03-30 15:34 ` [RFC PATCH v2 7/9] drm/amd/display: Use GAMCOR for first TF if CSC is used Harry Wentland
2026-04-21 21:08   ` Alex Hung
2026-04-30 20:43     ` Harry Wentland
2026-04-24 14:48   ` Melissa Wen
2026-03-30 15:34 ` Harry Wentland [this message]
2026-04-21 21:12   ` [RFC PATCH v2 8/9] drm/amd/display: Check actual state during commit_tail Alex Hung
2026-05-01 16:03     ` Harry Wentland
2026-03-30 15:34 ` [RFC PATCH v2 9/9] drm/amd/display: Set color_space to plane_infos Harry Wentland
2026-04-21 21:23   ` Alex Hung
2026-04-22 21:40 ` [RFC PATCH v2 0/9] YUV conversion colorop with amdgpu and VKMS Melissa Wen

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=20260330153451.99472-9-harry.wentland@amd.com \
    --to=harry.wentland@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /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.