Add CSC mode to hw plane state to enable programming the fixed-function
CSC block for SDR planes based on the DRM_COLOROP_FIXED_MATRIX state.

Track the bypass state explicitly as a boolean since bypass is managed
separately from the FIXED_MATRIX enum value in the colorop framework.

Signed-off-by: Chaitanya Kumar Borah <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_types.h |  2 ++
 drivers/gpu/drm/i915/display/intel_plane.c         | 12 ++++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index 6cd102a3b610..1b5a3c84a7f3 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -681,6 +681,8 @@ 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;
+               enum drm_colorop_fixed_matrix_type csc_ff_type; /* For SDR 
plane */
+               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 3eaf82477f49..78ee3c357d8a 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -430,11 +430,19 @@ 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) 
{
+                                       plane_state->hw.csc_ff_enable =
+                                               !new_colorop_state->bypass;
+                                       plane_state->hw.csc_ff_type =
+                                               
new_colorop_state->fixed_matrix_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;
-- 
2.25.1

Reply via email to