[PATCH 18/23] drm/i915/color: Add framework to program PRE/POST CSC LUT
Chaitanya Kumar Borah
chaitanya.kumar.borah at intel.com
Mon Jun 16 11:54:43 UTC 2025
Add framework that will help in loading LUT to Pre/Post CSC color
blocks.
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah at intel.com>
---
drivers/gpu/drm/i915/display/intel_atomic_plane.c | 4 ++++
drivers/gpu/drm/i915/display/intel_color.c | 14 ++++++++++++++
drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
index 78c94a5f96fe..3c2dc630ad22 100644
--- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
@@ -381,6 +381,10 @@ intel_plane_colorop_replace_blob(struct intel_plane_state *plane_state,
{
if (intel_colorop->id == CB_PLANE_CSC)
drm_property_replace_blob(&plane_state->hw.ctm, blob);
+ else if (intel_colorop->id == CB_PLANE_PRE_CSC_LUT)
+ drm_property_replace_blob(&plane_state->hw.degamma_lut, blob);
+ else if (intel_colorop->id == CB_PLANE_POST_CSC_LUT)
+ drm_property_replace_blob(&plane_state->hw.gamma_lut, blob);
}
static void
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index 0075d40bc76e..a7afa03d3679 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -92,6 +92,9 @@ struct intel_color_funcs {
/* Plane CSC*/
void (*load_plane_csc_matrix)(const struct intel_plane_state *plane_state);
+
+ /* Plane Pre/Post CSC */
+ void (*load_plane_luts)(const struct intel_plane_state *plane_state);
};
#define CTM_COEFF_SIGN (1ULL << 63)
@@ -4201,10 +4204,21 @@ intel_color_load_plane_csc_matrix(const struct intel_plane_state *plane_state)
display->funcs.color->load_plane_csc_matrix(plane_state);
}
+static void
+intel_color_load_plane_luts(const struct intel_plane_state *plane_state)
+{
+ struct intel_display *display = to_intel_display(plane_state);
+
+ if (display->funcs.color->load_plane_luts)
+ display->funcs.color->load_plane_luts(plane_state);
+}
+
void intel_color_plane_program_pipeline(const struct intel_plane_state *plane_state)
{
if (plane_state->hw.ctm)
intel_color_load_plane_csc_matrix(plane_state);
+ if (plane_state->hw.degamma_lut || plane_state->hw.gamma_lut)
+ intel_color_load_plane_luts(plane_state);
}
struct intel_plane_colorop *intel_colorop_alloc(void)
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 8e08923818fb..a2e6cb123c4c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -632,7 +632,7 @@ struct intel_plane_state {
enum drm_color_encoding color_encoding;
enum drm_color_range color_range;
enum drm_scaling_filter scaling_filter;
- struct drm_property_blob *ctm;
+ struct drm_property_blob *ctm, *degamma_lut, *gamma_lut;
} hw;
struct i915_vma *ggtt_vma;
--
2.25.1
More information about the Intel-gfx-trybot
mailing list