From: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [CI 4/9] drm/i915/display: Program CSC on SDR planes based on Fixed Matrix Colorop
Date: Wed, 2 Sep 2026 13:24:12 +0530 [thread overview]
Message-ID: <20260902075417.656673-5-chaitanya.kumar.borah@intel.com> (raw)
In-Reply-To: <20260902075417.656673-1-chaitanya.kumar.borah@intel.com>
When a color pipeline is active, program the SDR plane fixed-function
CSC based on the Fixed Matrix Colorop's state. Re-use the existing plane
state variables for color_range and color_encoding. Track the bypass state
explicitly as a boolean since bypass is managed separately from the
FIXED_MATRIX enum value in the colorop framework. Keep the programming
based on color_encoding/color_range legacy properties intact.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
.../drm/i915/display/intel_display_types.h | 1 +
drivers/gpu/drm/i915/display/intel_plane.c | 53 ++++++++++++++++++-
.../drm/i915/display/skl_universal_plane.c | 4 +-
3 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 5f0fe18c0614..bc350f678857 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -683,6 +683,7 @@ struct intel_plane_state {
enum drm_color_range color_range;
enum drm_scaling_filter scaling_filter;
struct drm_property_blob *ctm, *degamma_lut, *gamma_lut, *lut_3d;
+ bool csc_ff_enable;
} hw;
struct i915_vma *ggtt_vma;
diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c
index d0f99a87c42e..25ca049009ef 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -462,6 +462,42 @@ intel_plane_colorop_replace_blob(struct intel_plane_state *plane_state,
return false;
}
+static u32
+fixedmatrix_colorop_to_encoding(enum drm_colorop_fixed_matrix_type fm_type)
+{
+ switch (fm_type) {
+ case DRM_COLOROP_FM_YCBCR709_FULL_RGB:
+ case DRM_COLOROP_FM_YCBCR709_LIMITED_RGB:
+ return DRM_COLOR_YCBCR_BT709;
+
+ case DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB:
+ case DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB:
+ return DRM_COLOR_YCBCR_BT2020;
+
+ case DRM_COLOROP_FM_YCBCR601_FULL_RGB:
+ case DRM_COLOROP_FM_YCBCR601_LIMITED_RGB:
+ default:
+ return DRM_COLOR_YCBCR_BT601;
+ }
+}
+
+static u32
+fixedmatrix_colorop_to_range(enum drm_colorop_fixed_matrix_type fm_type)
+{
+ switch (fm_type) {
+ case DRM_COLOROP_FM_YCBCR601_FULL_RGB:
+ case DRM_COLOROP_FM_YCBCR709_FULL_RGB:
+ case DRM_COLOROP_FM_YCBCR2020_NC_FULL_RGB:
+ return DRM_COLOR_YCBCR_FULL_RANGE;
+
+ case DRM_COLOROP_FM_YCBCR601_LIMITED_RGB:
+ case DRM_COLOROP_FM_YCBCR709_LIMITED_RGB:
+ case DRM_COLOROP_FM_YCBCR2020_NC_LIMITED_RGB:
+ default:
+ return DRM_COLOR_YCBCR_LIMITED_RANGE;
+ }
+}
+
static void
intel_plane_color_copy_uapi_to_hw_state(struct intel_atomic_state *state,
struct intel_plane_state *plane_state,
@@ -474,6 +510,7 @@ intel_plane_color_copy_uapi_to_hw_state(struct intel_atomic_state *state,
struct drm_property_blob *blob;
struct intel_crtc_state *new_crtc_state = state ?
intel_atomic_get_new_crtc_state(state, crtc) : NULL;
+ enum drm_colorop_fixed_matrix_type fm_type;
bool changed = false;
int i = 0;
@@ -485,11 +522,23 @@ intel_plane_color_copy_uapi_to_hw_state(struct intel_atomic_state *state,
while (iter_colorop) {
for_each_new_colorop_in_state(&state->base, colorop, new_colorop_state, i) {
if (new_colorop_state->colorop == iter_colorop) {
- blob = new_colorop_state->bypass ? NULL : new_colorop_state->data;
intel_colorop = to_intel_colorop(colorop);
- changed |= intel_plane_colorop_replace_blob(plane_state,
+ if (intel_colorop->id == INTEL_PLANE_CB_CSC_FF) {
+ fm_type = new_colorop_state->fixed_matrix_type;
+
+ plane_state->hw.csc_ff_enable =
+ !new_colorop_state->bypass;
+ plane_state->hw.color_encoding =
+ fixedmatrix_colorop_to_encoding(fm_type);
+ plane_state->hw.color_range =
+ fixedmatrix_colorop_to_range(fm_type);
+ } else {
+ blob = new_colorop_state->bypass ?
+ NULL : new_colorop_state->data;
+ changed |= intel_plane_colorop_replace_blob(plane_state,
intel_colorop,
blob);
+ }
}
}
iter_colorop = iter_colorop->next;
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 973062dfc558..0f604bdb4c62 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -1250,9 +1250,11 @@ static u32 glk_plane_color_ctl_input_csc(const struct intel_plane_state *plane_s
struct intel_display *display = to_intel_display(plane_state);
const struct drm_framebuffer *fb = plane_state->hw.fb;
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
+ bool color_pipeline = !!plane_state->uapi.color_pipeline;
+ bool needs_csc = color_pipeline ? plane_state->hw.csc_ff_enable : fb->format->is_yuv;
u32 ctl = 0;
- if (!fb->format->is_yuv)
+ if (!needs_csc)
return 0;
if (!icl_is_hdr_plane(display, plane->id)) {
--
2.50.1
next prev parent reply other threads:[~2026-09-02 8:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 7:54 [CI 0/9] drm/i915/color: Add YUV Support in color pipeline Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 1/9] drm/i915/color: Add CSC on SDR plane " Chaitanya Kumar Borah
2026-09-02 8:34 ` sashiko-bot
2026-09-02 7:54 ` [CI 2/9] drm/i915/display: extract glk_plane_color_ctl_input_csc helper Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 3/9] drm/i915/display: simplify glk_plane_color_ctl_input_csc Chaitanya Kumar Borah
2026-09-02 7:54 ` Chaitanya Kumar Borah [this message]
2026-09-02 7:54 ` [CI 5/9] drm/i915/color: Add support for 1D LUT in SDR planes Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 6/9] drm/i915/color: Extract HDR post-CSC LUT programming to helper function Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 7/9] drm/i915/color: Program Plane Post CSC registers for SDR planes Chaitanya Kumar Borah
2026-09-02 7:54 ` [CI 8/9] drm/i915/color: Add color pipeline support " Chaitanya Kumar Borah
2026-09-02 8:34 ` sashiko-bot
2026-09-02 7:54 ` [CI 9/9] drm/i915/color: Add YUV buffer support on HDR planes Chaitanya Kumar Borah
2026-09-02 8:28 ` sashiko-bot
2026-09-02 9:02 ` ✓ i915.CI.BAT: success for drm/i915/color: Add YUV Support in color pipeline Patchwork
2026-09-02 9:52 ` ✓ CI.KUnit: " Patchwork
2026-09-02 10:55 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-02 20:47 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-09-02 22:31 ` ✗ i915.CI.Full: " Patchwork
2026-09-07 8:14 ` ✓ i915.CI.Full: success " 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=20260902075417.656673-5-chaitanya.kumar.borah@intel.com \
--to=chaitanya.kumar.borah@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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.