Skip to content

Commit 3b7476e

Browse files
uma-inteljnikula
authored andcommitted
drm/i915/color: Add framework to program PRE/POST CSC LUT
Add framework that will help in loading LUT to Pre/Post CSC color blocks. v2: Add dsb support v3: Align enum names v4: Propagate change in lut data to crtc_state Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Signed-off-by: Uma Shankar <uma.shankar@intel.com> Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com> Link: https://patch.msgid.link/20251203085211.3663374-11-uma.shankar@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 05df715 commit 3b7476e

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_color.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ struct intel_color_funcs {
9393
/* Plane CSC*/
9494
void (*load_plane_csc_matrix)(struct intel_dsb *dsb,
9595
const struct intel_plane_state *plane_state);
96+
97+
/* Plane Pre/Post CSC */
98+
void (*load_plane_luts)(struct intel_dsb *dsb,
99+
const struct intel_plane_state *plane_state);
96100
};
97101

98102
#define CTM_COEFF_SIGN (1ULL << 63)
@@ -4077,11 +4081,23 @@ intel_color_load_plane_csc_matrix(struct intel_dsb *dsb,
40774081
display->funcs.color->load_plane_csc_matrix(dsb, plane_state);
40784082
}
40794083

4084+
static void
4085+
intel_color_load_plane_luts(struct intel_dsb *dsb,
4086+
const struct intel_plane_state *plane_state)
4087+
{
4088+
struct intel_display *display = to_intel_display(plane_state);
4089+
4090+
if (display->funcs.color->load_plane_luts)
4091+
display->funcs.color->load_plane_luts(dsb, plane_state);
4092+
}
4093+
40804094
void intel_color_plane_program_pipeline(struct intel_dsb *dsb,
40814095
const struct intel_plane_state *plane_state)
40824096
{
40834097
if (plane_state->hw.ctm)
40844098
intel_color_load_plane_csc_matrix(dsb, plane_state);
4099+
if (plane_state->hw.degamma_lut || plane_state->hw.gamma_lut)
4100+
intel_color_load_plane_luts(dsb, plane_state);
40854101
}
40864102

40874103
void intel_color_crtc_init(struct intel_crtc *crtc)

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ struct intel_plane_state {
646646
enum drm_color_encoding color_encoding;
647647
enum drm_color_range color_range;
648648
enum drm_scaling_filter scaling_filter;
649-
struct drm_property_blob *ctm;
649+
struct drm_property_blob *ctm, *degamma_lut, *gamma_lut;
650650
} hw;
651651

652652
struct i915_vma *ggtt_vma;

drivers/gpu/drm/i915/display/intel_plane.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ intel_plane_colorop_replace_blob(struct intel_plane_state *plane_state,
344344
{
345345
if (intel_colorop->id == INTEL_PLANE_CB_CSC)
346346
return drm_property_replace_blob(&plane_state->hw.ctm, blob);
347+
else if (intel_colorop->id == INTEL_PLANE_CB_PRE_CSC_LUT)
348+
return drm_property_replace_blob(&plane_state->hw.degamma_lut, blob);
349+
else if (intel_colorop->id == INTEL_PLANE_CB_POST_CSC_LUT)
350+
return drm_property_replace_blob(&plane_state->hw.gamma_lut, blob);
347351

348352
return false;
349353
}

0 commit comments

Comments
 (0)