File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
drivers/gpu/drm/amd/display/dc Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1726,6 +1726,9 @@ static enum surface_update_type det_surface_update(const struct dc *dc,
1726
1726
if (u -> coeff_reduction_factor )
1727
1727
update_flags -> bits .coeff_reduction_change = 1 ;
1728
1728
1729
+ if (u -> gamut_remap_matrix )
1730
+ update_flags -> bits .gamut_remap_change = 1 ;
1731
+
1729
1732
if (u -> gamma ) {
1730
1733
enum surface_pixel_format format = SURFACE_PIXEL_FORMAT_GRPH_BEGIN ;
1731
1734
@@ -1751,7 +1754,8 @@ static enum surface_update_type det_surface_update(const struct dc *dc,
1751
1754
1752
1755
if (update_flags -> bits .input_csc_change
1753
1756
|| update_flags -> bits .coeff_reduction_change
1754
- || update_flags -> bits .gamma_change ) {
1757
+ || update_flags -> bits .gamma_change
1758
+ || update_flags -> bits .gamut_remap_change ) {
1755
1759
type = UPDATE_TYPE_FULL ;
1756
1760
elevate_update_type (& overall_type , type );
1757
1761
}
@@ -1996,6 +2000,10 @@ static void copy_surface_update_to_plane(
1996
2000
if (srf_update -> coeff_reduction_factor )
1997
2001
surface -> coeff_reduction_factor =
1998
2002
* srf_update -> coeff_reduction_factor ;
2003
+
2004
+ if (srf_update -> gamut_remap_matrix )
2005
+ surface -> gamut_remap_matrix =
2006
+ * srf_update -> gamut_remap_matrix ;
1999
2007
}
2000
2008
2001
2009
static void copy_stream_update_to_stream (struct dc * dc ,
Original file line number Diff line number Diff line change @@ -726,6 +726,7 @@ union surface_update_flags {
726
726
uint32_t output_tf_change :1 ;
727
727
uint32_t pixel_format_change :1 ;
728
728
uint32_t plane_size_change :1 ;
729
+ uint32_t gamut_remap_change :1 ;
729
730
730
731
/* Full updates */
731
732
uint32_t new_plane :1 ;
@@ -760,6 +761,7 @@ struct dc_plane_state {
760
761
struct dc_csc_transform input_csc_color_matrix ;
761
762
struct fixed31_32 coeff_reduction_factor ;
762
763
struct fixed31_32 hdr_mult ;
764
+ struct colorspace_transform gamut_remap_matrix ;
763
765
764
766
// TODO: No longer used, remove
765
767
struct dc_hdr_static_metadata hdr_static_ctx ;
@@ -839,6 +841,7 @@ struct dc_surface_update {
839
841
const struct dc_transfer_func * func_shaper ;
840
842
const struct dc_3dlut * lut3d_func ;
841
843
const struct dc_transfer_func * blend_tf ;
844
+ const struct colorspace_transform * gamut_remap_matrix ;
842
845
};
843
846
844
847
/*
Original file line number Diff line number Diff line change @@ -2004,6 +2004,12 @@ void dcn10_program_gamut_remap(struct pipe_ctx *pipe_ctx)
2004
2004
for (i = 0 ; i < CSC_TEMPERATURE_MATRIX_SIZE ; i ++ )
2005
2005
adjust .temperature_matrix [i ] =
2006
2006
pipe_ctx -> stream -> gamut_remap_matrix .matrix [i ];
2007
+ } else if (pipe_ctx -> plane_state &&
2008
+ pipe_ctx -> plane_state -> gamut_remap_matrix .enable_remap == true) {
2009
+ adjust .gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW ;
2010
+ for (i = 0 ; i < CSC_TEMPERATURE_MATRIX_SIZE ; i ++ )
2011
+ adjust .temperature_matrix [i ] =
2012
+ pipe_ctx -> plane_state -> gamut_remap_matrix .matrix [i ];
2007
2013
}
2008
2014
2009
2015
pipe_ctx -> plane_res .dpp -> funcs -> dpp_set_gamut_remap (pipe_ctx -> plane_res .dpp , & adjust );
You can’t perform that action at this time.
0 commit comments