All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Schwartz <matthew.schwartz@linux.dev>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: uma.shankar@intel.com, chaitanya.kumar.borah@intel.com,
	Matthew Schwartz <matthew.schwartz@linux.dev>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Suraj Kandpal <suraj.kandpal@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 1/2] drm/i915/color: only let the owning plane program the 3D LUT
Date: Wed, 18 Nov 2026 11:15:12 -0800	[thread overview]
Message-ID: <20261118191514.2931270-2-matthew.schwartz@linux.dev> (raw)
In-Reply-To: <20261118191514.2931270-1-matthew.schwartz@linux.dev>

intel_color_plane_commit_arm() runs for every universal plane on pipes A
and B and rewrites LUT_3D_CTL from that plane's own 3D LUT state. Only
the primary plane on Xe3p_LPD can carry a 3D LUT colorop, so any other
plane update on those pipes disables the LUT the primary plane enabled,
and on older platforms every plane update writes a register no plane
owns.

Give the "Xe3p_LPD primary plane owns the 3D LUT" rule a single helper
and use it both to build the plane color pipeline and to decide who may
write LUT_3D_CTL.

Fixes: 65db7a1f9cf7 ("drm/i915/color: Add 3D LUT to color pipeline")
Signed-off-by: Matthew Schwartz <matthew.schwartz@linux.dev>
---
 drivers/gpu/drm/i915/display/intel_color.c          | 10 +++++++++-
 drivers/gpu/drm/i915/display/intel_color.h          |  3 +++
 drivers/gpu/drm/i915/display/intel_color_pipeline.c | 10 +---------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index 4070dc8d97d9..742ae471540d 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -4278,9 +4278,10 @@ void intel_color_plane_commit_arm(struct intel_dsb *dsb,
 				  const struct intel_plane_state *plane_state)
 {
 	struct intel_display *display = to_intel_display(plane_state);
+	struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
 	struct intel_crtc *crtc = to_intel_crtc(plane_state->uapi.crtc);
 
-	if (crtc && intel_color_crtc_has_3dlut(display, crtc->pipe))
+	if (crtc && intel_color_plane_has_3dlut(display, plane->pipe, plane->id))
 		glk_lut_3d_commit(dsb, crtc, !!plane_state->hw.lut_3d);
 }
 
@@ -4313,6 +4314,13 @@ intel_color_crtc_has_3dlut(struct intel_display *display, enum pipe pipe)
 		return false;
 }
 
+bool intel_color_plane_has_3dlut(struct intel_display *display,
+				 enum pipe pipe, enum plane_id plane_id)
+{
+	return DISPLAY_VER(display) >= 35 && plane_id == PLANE_PRIMARY &&
+		intel_color_crtc_has_3dlut(display, pipe);
+}
+
 static void
 intel_color_load_3dlut(struct intel_dsb *dsb,
 		       const struct intel_plane_state *plane_state)
diff --git a/drivers/gpu/drm/i915/display/intel_color.h b/drivers/gpu/drm/i915/display/intel_color.h
index f3963a8d1239..9d11741423ef 100644
--- a/drivers/gpu/drm/i915/display/intel_color.h
+++ b/drivers/gpu/drm/i915/display/intel_color.h
@@ -16,6 +16,7 @@ struct intel_dsb;
 struct intel_plane_state;
 struct drm_property_blob;
 enum pipe;
+enum plane_id;
 
 void intel_color_init_hooks(struct intel_display *display);
 int intel_color_init(struct intel_display *display);
@@ -47,6 +48,8 @@ void intel_color_plane_program_pipeline(struct intel_dsb *dsb,
 void intel_color_plane_commit_arm(struct intel_dsb *dsb,
 				  const struct intel_plane_state *plane_state);
 bool intel_color_crtc_has_3dlut(struct intel_display *display, enum pipe pipe);
+bool intel_color_plane_has_3dlut(struct intel_display *display,
+				 enum pipe pipe, enum plane_id plane_id);
 u32 intel_color_background_color_drm_to_hw(u64 drm_background_color);
 u64 intel_color_background_color_hw_to_drm(u32 hw_background_color);
 
diff --git a/drivers/gpu/drm/i915/display/intel_color_pipeline.c b/drivers/gpu/drm/i915/display/intel_color_pipeline.c
index 7fc31fe891a8..77f65182e3e3 100644
--- a/drivers/gpu/drm/i915/display/intel_color_pipeline.c
+++ b/drivers/gpu/drm/i915/display/intel_color_pipeline.c
@@ -58,14 +58,6 @@ static const u64 intel_plane_supported_csc_ff =
 		BIT(DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB) |
 		BIT(DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB);
 
-static bool plane_has_3dlut(struct intel_display *display, enum pipe pipe,
-			    struct drm_plane *plane)
-{
-	return (DISPLAY_VER(display) >= 35 &&
-		intel_color_crtc_has_3dlut(display, pipe) &&
-		plane->type == DRM_PLANE_TYPE_PRIMARY);
-}
-
 static
 struct intel_colorop *intel_color_pipeline_plane_add_colorop(struct drm_plane *plane,
 							     struct intel_colorop *prev,
@@ -144,7 +136,7 @@ int _intel_color_pipeline_plane_init(struct drm_plane *plane, struct drm_prop_en
 	int ret = 0;
 	int i;
 
-	if (plane_has_3dlut(display, pipe, plane)) {
+	if (intel_color_plane_has_3dlut(display, pipe, to_intel_plane(plane)->id)) {
 		pipeline = xe3plpd_primary_plane_pipeline;
 		pipeline_len = ARRAY_SIZE(xe3plpd_primary_plane_pipeline);
 	} else if (icl_is_hdr_plane(display, to_intel_plane(plane)->id)) {
-- 
2.56.1


  reply	other threads:[~2026-11-18 19:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 19:15 [RFC PATCH 0/2] drm/i915/color: 3D LUT fixes Matthew Schwartz
2026-11-18 19:15 ` Matthew Schwartz [this message]
2026-11-18 19:15 ` [RFC PATCH 2/2] drm/i915/color: load the 3D LUT in the order the hardware indexes it Matthew Schwartz
2026-11-19 17:51 ` ✓ CI.KUnit: success for drm/i915/color: 3D LUT fixes Patchwork
2026-11-19 17:53 ` [RFC PATCH 0/2] " Borah, Chaitanya Kumar
2026-11-19 18:28 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-11-19 22:50 ` ✓ i915.CI.BAT: " Patchwork

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=20261118191514.2931270-2-matthew.schwartz@linux.dev \
    --to=matthew.schwartz@linux.dev \
    --cc=airlied@gmail.com \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=suraj.kandpal@intel.com \
    --cc=tursulin@ursulin.net \
    --cc=uma.shankar@intel.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 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.