diff options
author | Yue Hin Lau <Yuehin.Lau@amd.com> | 2017-06-28 17:21:42 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:08:26 -0400 |
commit | abe07e80836fb25a5bcfda573413a68be82439c6 (patch) | |
tree | 3c8232d5b2f5d63a1f0514cfdfa0d366bc8f3929 /drivers/gpu/drm/amd/display | |
parent | 1c604cd862d4f069cb3bbafb4e35db614a57b096 (diff) |
drm/amd/display: Add DC interface for custom CSC matrix
Signed-off-by: Yue Hin Lau <Yuehin.Lau@amd.com>
Reviewed-by: Vitaly Prosyak <Vitaly.Prosyak@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display')
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dc.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | 117 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h | 76 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 5 |
8 files changed, 252 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index c113c1a259d4..a9ddd0756b3b 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c | |||
@@ -221,6 +221,29 @@ static bool set_gamut_remap(struct dc *dc, const struct dc_stream *stream) | |||
221 | return ret; | 221 | return ret; |
222 | } | 222 | } |
223 | 223 | ||
224 | static bool program_csc_matrix(struct dc *dc, const struct dc_stream *stream) | ||
225 | { | ||
226 | struct core_dc *core_dc = DC_TO_CORE(dc); | ||
227 | struct core_stream *core_stream = DC_STREAM_TO_CORE(stream); | ||
228 | int i = 0; | ||
229 | bool ret = false; | ||
230 | struct pipe_ctx *pipes; | ||
231 | |||
232 | for (i = 0; i < MAX_PIPES; i++) { | ||
233 | if (core_dc->current_context->res_ctx.pipe_ctx[i].stream | ||
234 | == core_stream) { | ||
235 | |||
236 | pipes = &core_dc->current_context->res_ctx.pipe_ctx[i]; | ||
237 | core_dc->hwss.program_csc_matrix(pipes, | ||
238 | core_stream->public.output_color_space, | ||
239 | core_stream->public.csc_color_matrix.matrix); | ||
240 | ret = true; | ||
241 | } | ||
242 | } | ||
243 | |||
244 | return ret; | ||
245 | } | ||
246 | |||
224 | static void set_static_screen_events(struct dc *dc, | 247 | static void set_static_screen_events(struct dc *dc, |
225 | const struct dc_stream **stream, | 248 | const struct dc_stream **stream, |
226 | int num_streams, | 249 | int num_streams, |
@@ -373,6 +396,9 @@ static void allocate_dc_stream_funcs(struct core_dc *core_dc) | |||
373 | core_dc->public.stream_funcs.set_gamut_remap = | 396 | core_dc->public.stream_funcs.set_gamut_remap = |
374 | set_gamut_remap; | 397 | set_gamut_remap; |
375 | 398 | ||
399 | core_dc->public.stream_funcs.program_csc_matrix = | ||
400 | program_csc_matrix; | ||
401 | |||
376 | core_dc->public.stream_funcs.set_dither_option = | 402 | core_dc->public.stream_funcs.set_dither_option = |
377 | set_dither_option; | 403 | set_dither_option; |
378 | 404 | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index 18f6858e4992..3e2ed3d15379 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h | |||
@@ -118,6 +118,9 @@ struct dc_stream_funcs { | |||
118 | bool (*set_gamut_remap)(struct dc *dc, | 118 | bool (*set_gamut_remap)(struct dc *dc, |
119 | const struct dc_stream *stream); | 119 | const struct dc_stream *stream); |
120 | 120 | ||
121 | bool (*program_csc_matrix)(struct dc *dc, | ||
122 | const struct dc_stream *stream); | ||
123 | |||
121 | void (*set_static_screen_events)(struct dc *dc, | 124 | void (*set_static_screen_events)(struct dc *dc, |
122 | const struct dc_stream **stream, | 125 | const struct dc_stream **stream, |
123 | int num_streams, | 126 | int num_streams, |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index d0bddfd64c67..f404e4e5e4ea 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | |||
@@ -1623,6 +1623,28 @@ static void program_gamut_remap(struct pipe_ctx *pipe_ctx) | |||
1623 | pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust); | 1623 | pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust); |
1624 | } | 1624 | } |
1625 | 1625 | ||
1626 | |||
1627 | static void program_csc_matrix(struct pipe_ctx *pipe_ctx, | ||
1628 | enum dc_color_space colorspace, | ||
1629 | uint16_t *matrix) | ||
1630 | { | ||
1631 | int i; | ||
1632 | struct out_csc_color_matrix tbl_entry; | ||
1633 | |||
1634 | if (pipe_ctx->stream->public.csc_color_matrix.enable_adjustment | ||
1635 | == true) { | ||
1636 | enum dc_color_space color_space = | ||
1637 | pipe_ctx->stream->public.output_color_space; | ||
1638 | |||
1639 | //uint16_t matrix[12]; | ||
1640 | for (i = 0; i < 12; i++) | ||
1641 | tbl_entry.regval[i] = pipe_ctx->stream->public.csc_color_matrix.matrix[i]; | ||
1642 | |||
1643 | tbl_entry.color_space = color_space; | ||
1644 | //tbl_entry.regval = matrix; | ||
1645 | pipe_ctx->opp->funcs->opp_set_csc_adjustment(pipe_ctx->opp, &tbl_entry); | ||
1646 | } | ||
1647 | } | ||
1626 | static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx) | 1648 | static bool is_lower_pipe_tree_visible(struct pipe_ctx *pipe_ctx) |
1627 | { | 1649 | { |
1628 | if (pipe_ctx->surface->public.visible) | 1650 | if (pipe_ctx->surface->public.visible) |
@@ -2103,6 +2125,7 @@ static void dcn10_setup_stereo(struct pipe_ctx *pipe_ctx, | |||
2103 | 2125 | ||
2104 | static const struct hw_sequencer_funcs dcn10_funcs = { | 2126 | static const struct hw_sequencer_funcs dcn10_funcs = { |
2105 | .program_gamut_remap = program_gamut_remap, | 2127 | .program_gamut_remap = program_gamut_remap, |
2128 | .program_csc_matrix = program_csc_matrix, | ||
2106 | .init_hw = init_hw, | 2129 | .init_hw = init_hw, |
2107 | .apply_ctx_to_hw = dce110_apply_ctx_to_hw, | 2130 | .apply_ctx_to_hw = dce110_apply_ctx_to_hw, |
2108 | .apply_ctx_for_surface = dcn10_apply_ctx_for_surface, | 2131 | .apply_ctx_for_surface = dcn10_apply_ctx_for_surface, |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c index 148e192f5f76..a07401004f44 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c | |||
@@ -713,6 +713,48 @@ static void opp_power_on_regamma_lut( | |||
713 | 713 | ||
714 | } | 714 | } |
715 | 715 | ||
716 | void opp_set_output_csc_adjustment( | ||
717 | struct output_pixel_processor *opp, | ||
718 | const struct out_csc_color_matrix *tbl_entry) | ||
719 | { | ||
720 | |||
721 | struct dcn10_opp *oppn10 = TO_DCN10_OPP(opp); | ||
722 | //enum csc_color_mode config = CSC_COLOR_MODE_GRAPHICS_OUTPUT_CSC; | ||
723 | |||
724 | |||
725 | uint32_t ocsc_mode = 4; | ||
726 | |||
727 | /** | ||
728 | *if (tbl_entry != NULL) { | ||
729 | * switch (tbl_entry->color_space) { | ||
730 | * case COLOR_SPACE_SRGB: | ||
731 | * case COLOR_SPACE_2020_RGB_FULLRANGE: | ||
732 | * ocsc_mode = 0; | ||
733 | * break; | ||
734 | * case COLOR_SPACE_SRGB_LIMITED: | ||
735 | * case COLOR_SPACE_2020_RGB_LIMITEDRANGE: | ||
736 | * ocsc_mode = 1; | ||
737 | * break; | ||
738 | * case COLOR_SPACE_YCBCR601: | ||
739 | * case COLOR_SPACE_YCBCR601_LIMITED: | ||
740 | * ocsc_mode = 2; | ||
741 | * break; | ||
742 | * case COLOR_SPACE_YCBCR709: | ||
743 | * case COLOR_SPACE_YCBCR709_LIMITED: | ||
744 | * case COLOR_SPACE_2020_YCBCR: | ||
745 | * ocsc_mode = 3; | ||
746 | * break; | ||
747 | * case COLOR_SPACE_UNKNOWN: | ||
748 | * default: | ||
749 | * break; | ||
750 | * } | ||
751 | *} | ||
752 | */ | ||
753 | |||
754 | REG_SET(CM_OCSC_CONTROL, 0, CM_OCSC_MODE, ocsc_mode); | ||
755 | program_color_matrix(oppn10, tbl_entry); | ||
756 | } | ||
757 | |||
716 | static void opp_program_regamma_lut( | 758 | static void opp_program_regamma_lut( |
717 | struct output_pixel_processor *opp, | 759 | struct output_pixel_processor *opp, |
718 | const struct pwl_result_data *rgb, | 760 | const struct pwl_result_data *rgb, |
@@ -736,6 +778,8 @@ static void opp_program_regamma_lut( | |||
736 | 778 | ||
737 | } | 779 | } |
738 | 780 | ||
781 | |||
782 | |||
739 | static bool opp_set_regamma_pwl( | 783 | static bool opp_set_regamma_pwl( |
740 | struct output_pixel_processor *opp, const struct pwl_params *params) | 784 | struct output_pixel_processor *opp, const struct pwl_params *params) |
741 | { | 785 | { |
@@ -776,7 +820,7 @@ static void dcn10_opp_destroy(struct output_pixel_processor **opp) | |||
776 | 820 | ||
777 | static struct opp_funcs dcn10_opp_funcs = { | 821 | static struct opp_funcs dcn10_opp_funcs = { |
778 | .opp_power_on_regamma_lut = opp_power_on_regamma_lut, | 822 | .opp_power_on_regamma_lut = opp_power_on_regamma_lut, |
779 | .opp_set_csc_adjustment = NULL, | 823 | .opp_set_csc_adjustment = opp_set_output_csc_adjustment, |
780 | .opp_set_csc_default = opp_set_output_csc_default, | 824 | .opp_set_csc_default = opp_set_output_csc_default, |
781 | .opp_set_dyn_expansion = opp_set_dyn_expansion, | 825 | .opp_set_dyn_expansion = opp_set_dyn_expansion, |
782 | .opp_program_regamma_pwl = opp_set_regamma_pwl, | 826 | .opp_program_regamma_pwl = opp_set_regamma_pwl, |
@@ -802,3 +846,74 @@ void dcn10_opp_construct(struct dcn10_opp *oppn10, | |||
802 | oppn10->opp_shift = opp_shift; | 846 | oppn10->opp_shift = opp_shift; |
803 | oppn10->opp_mask = opp_mask; | 847 | oppn10->opp_mask = opp_mask; |
804 | } | 848 | } |
849 | |||
850 | |||
851 | void program_color_matrix(struct dcn10_opp *oppn10, | ||
852 | const struct out_csc_color_matrix *tbl_entry) | ||
853 | { | ||
854 | uint32_t mode; | ||
855 | |||
856 | REG_GET(CM_OCSC_CONTROL, CM_OCSC_MODE, &mode); | ||
857 | |||
858 | if (tbl_entry == NULL) { | ||
859 | BREAK_TO_DEBUGGER(); | ||
860 | return; | ||
861 | } | ||
862 | |||
863 | |||
864 | if (mode == 4) { | ||
865 | /*R*/ | ||
866 | REG_SET_2(CM_OCSC_C11_C12, 0, | ||
867 | CM_OCSC_C11, tbl_entry->regval[0], | ||
868 | CM_OCSC_C12, tbl_entry->regval[1]); | ||
869 | |||
870 | REG_SET_2(CM_OCSC_C13_C14, 0, | ||
871 | CM_OCSC_C13, tbl_entry->regval[2], | ||
872 | CM_OCSC_C14, tbl_entry->regval[3]); | ||
873 | |||
874 | /*G*/ | ||
875 | REG_SET_2(CM_OCSC_C21_C22, 0, | ||
876 | CM_OCSC_C21, tbl_entry->regval[4], | ||
877 | CM_OCSC_C22, tbl_entry->regval[5]); | ||
878 | |||
879 | REG_SET_2(CM_OCSC_C23_C24, 0, | ||
880 | CM_OCSC_C23, tbl_entry->regval[6], | ||
881 | CM_OCSC_C24, tbl_entry->regval[7]); | ||
882 | |||
883 | /*B*/ | ||
884 | REG_SET_2(CM_OCSC_C31_C32, 0, | ||
885 | CM_OCSC_C31, tbl_entry->regval[8], | ||
886 | CM_OCSC_C32, tbl_entry->regval[9]); | ||
887 | |||
888 | REG_SET_2(CM_OCSC_C33_C34, 0, | ||
889 | CM_OCSC_C33, tbl_entry->regval[10], | ||
890 | CM_OCSC_C34, tbl_entry->regval[11]); | ||
891 | } else { | ||
892 | /*R*/ | ||
893 | REG_SET_2(CM_COMB_C11_C12, 0, | ||
894 | CM_COMB_C11, tbl_entry->regval[0], | ||
895 | CM_COMB_C12, tbl_entry->regval[1]); | ||
896 | |||
897 | REG_SET_2(CM_COMB_C13_C14, 0, | ||
898 | CM_COMB_C13, tbl_entry->regval[2], | ||
899 | CM_COMB_C14, tbl_entry->regval[3]); | ||
900 | |||
901 | /*G*/ | ||
902 | REG_SET_2(CM_COMB_C21_C22, 0, | ||
903 | CM_COMB_C21, tbl_entry->regval[4], | ||
904 | CM_COMB_C22, tbl_entry->regval[5]); | ||
905 | |||
906 | REG_SET_2(CM_COMB_C23_C24, 0, | ||
907 | CM_COMB_C23, tbl_entry->regval[6], | ||
908 | CM_COMB_C24, tbl_entry->regval[7]); | ||
909 | |||
910 | /*B*/ | ||
911 | REG_SET_2(CM_COMB_C31_C32, 0, | ||
912 | CM_COMB_C31, tbl_entry->regval[8], | ||
913 | CM_COMB_C32, tbl_entry->regval[9]); | ||
914 | |||
915 | REG_SET_2(CM_COMB_C33_C34, 0, | ||
916 | CM_COMB_C33, tbl_entry->regval[10], | ||
917 | CM_COMB_C34, tbl_entry->regval[11]); | ||
918 | } | ||
919 | } | ||
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h index 113e0bc349c3..9cc4c5feaddf 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h | |||
@@ -34,6 +34,18 @@ | |||
34 | .field_name = reg_name ## __ ## field_name ## post_fix | 34 | .field_name = reg_name ## __ ## field_name ## post_fix |
35 | 35 | ||
36 | #define OPP_DCN10_REG_LIST(id) \ | 36 | #define OPP_DCN10_REG_LIST(id) \ |
37 | SRI(CM_OCSC_C11_C12, CM, id), \ | ||
38 | SRI(CM_OCSC_C13_C14, CM, id), \ | ||
39 | SRI(CM_OCSC_C21_C22, CM, id), \ | ||
40 | SRI(CM_OCSC_C23_C24, CM, id), \ | ||
41 | SRI(CM_OCSC_C31_C32, CM, id), \ | ||
42 | SRI(CM_OCSC_C33_C34, CM, id), \ | ||
43 | SRI(CM_COMB_C11_C12, CM, id), \ | ||
44 | SRI(CM_COMB_C13_C14, CM, id), \ | ||
45 | SRI(CM_COMB_C21_C22, CM, id), \ | ||
46 | SRI(CM_COMB_C23_C24, CM, id), \ | ||
47 | SRI(CM_COMB_C31_C32, CM, id), \ | ||
48 | SRI(CM_COMB_C33_C34, CM, id), \ | ||
37 | SRI(CM_RGAM_LUT_WRITE_EN_MASK, CM, id), \ | 49 | SRI(CM_RGAM_LUT_WRITE_EN_MASK, CM, id), \ |
38 | SRI(CM_RGAM_CONTROL, CM, id), \ | 50 | SRI(CM_RGAM_CONTROL, CM, id), \ |
39 | SRI(OBUF_CONTROL, DSCL, id), \ | 51 | SRI(OBUF_CONTROL, DSCL, id), \ |
@@ -109,6 +121,30 @@ | |||
109 | SRI(CM_RGAM_LUT_DATA, CM, id) | 121 | SRI(CM_RGAM_LUT_DATA, CM, id) |
110 | 122 | ||
111 | #define OPP_DCN10_MASK_SH_LIST(mask_sh) \ | 123 | #define OPP_DCN10_MASK_SH_LIST(mask_sh) \ |
124 | OPP_SF(CM0_CM_OCSC_C11_C12, CM_OCSC_C11, mask_sh), \ | ||
125 | OPP_SF(CM0_CM_OCSC_C11_C12, CM_OCSC_C12, mask_sh), \ | ||
126 | OPP_SF(CM0_CM_OCSC_C13_C14, CM_OCSC_C13, mask_sh), \ | ||
127 | OPP_SF(CM0_CM_OCSC_C13_C14, CM_OCSC_C14, mask_sh), \ | ||
128 | OPP_SF(CM0_CM_OCSC_C21_C22, CM_OCSC_C21, mask_sh), \ | ||
129 | OPP_SF(CM0_CM_OCSC_C21_C22, CM_OCSC_C22, mask_sh), \ | ||
130 | OPP_SF(CM0_CM_OCSC_C23_C24, CM_OCSC_C23, mask_sh), \ | ||
131 | OPP_SF(CM0_CM_OCSC_C23_C24, CM_OCSC_C24, mask_sh), \ | ||
132 | OPP_SF(CM0_CM_OCSC_C31_C32, CM_OCSC_C31, mask_sh), \ | ||
133 | OPP_SF(CM0_CM_OCSC_C31_C32, CM_OCSC_C32, mask_sh), \ | ||
134 | OPP_SF(CM0_CM_OCSC_C33_C34, CM_OCSC_C33, mask_sh), \ | ||
135 | OPP_SF(CM0_CM_OCSC_C33_C34, CM_OCSC_C34, mask_sh), \ | ||
136 | OPP_SF(CM0_CM_COMB_C11_C12, CM_COMB_C11, mask_sh), \ | ||
137 | OPP_SF(CM0_CM_COMB_C11_C12, CM_COMB_C12, mask_sh), \ | ||
138 | OPP_SF(CM0_CM_COMB_C13_C14, CM_COMB_C13, mask_sh), \ | ||
139 | OPP_SF(CM0_CM_COMB_C13_C14, CM_COMB_C14, mask_sh), \ | ||
140 | OPP_SF(CM0_CM_COMB_C21_C22, CM_COMB_C21, mask_sh), \ | ||
141 | OPP_SF(CM0_CM_COMB_C21_C22, CM_COMB_C22, mask_sh), \ | ||
142 | OPP_SF(CM0_CM_COMB_C23_C24, CM_COMB_C23, mask_sh), \ | ||
143 | OPP_SF(CM0_CM_COMB_C23_C24, CM_COMB_C24, mask_sh), \ | ||
144 | OPP_SF(CM0_CM_COMB_C31_C32, CM_COMB_C31, mask_sh), \ | ||
145 | OPP_SF(CM0_CM_COMB_C31_C32, CM_COMB_C32, mask_sh), \ | ||
146 | OPP_SF(CM0_CM_COMB_C33_C34, CM_COMB_C33, mask_sh), \ | ||
147 | OPP_SF(CM0_CM_COMB_C33_C34, CM_COMB_C34, mask_sh), \ | ||
112 | OPP_SF(CM0_CM_RGAM_CONTROL, CM_RGAM_LUT_MODE, mask_sh), \ | 148 | OPP_SF(CM0_CM_RGAM_CONTROL, CM_RGAM_LUT_MODE, mask_sh), \ |
113 | OPP_SF(DSCL0_OBUF_CONTROL, OBUF_BYPASS, mask_sh), \ | 149 | OPP_SF(DSCL0_OBUF_CONTROL, OBUF_BYPASS, mask_sh), \ |
114 | OPP_SF(DSCL0_OBUF_CONTROL, OBUF_H_2X_UPSCALE_EN, mask_sh), \ | 150 | OPP_SF(DSCL0_OBUF_CONTROL, OBUF_H_2X_UPSCALE_EN, mask_sh), \ |
@@ -314,6 +350,30 @@ | |||
314 | OPP_SF(FMT0_FMT_CONTROL, FMT_STEREOSYNC_OVERRIDE, mask_sh) | 350 | OPP_SF(FMT0_FMT_CONTROL, FMT_STEREOSYNC_OVERRIDE, mask_sh) |
315 | 351 | ||
316 | #define OPP_DCN10_REG_FIELD_LIST(type) \ | 352 | #define OPP_DCN10_REG_FIELD_LIST(type) \ |
353 | type CM_OCSC_C11; \ | ||
354 | type CM_OCSC_C12; \ | ||
355 | type CM_OCSC_C13; \ | ||
356 | type CM_OCSC_C14; \ | ||
357 | type CM_OCSC_C21; \ | ||
358 | type CM_OCSC_C22; \ | ||
359 | type CM_OCSC_C23; \ | ||
360 | type CM_OCSC_C24; \ | ||
361 | type CM_OCSC_C31; \ | ||
362 | type CM_OCSC_C32; \ | ||
363 | type CM_OCSC_C33; \ | ||
364 | type CM_OCSC_C34; \ | ||
365 | type CM_COMB_C11; \ | ||
366 | type CM_COMB_C12; \ | ||
367 | type CM_COMB_C13; \ | ||
368 | type CM_COMB_C14; \ | ||
369 | type CM_COMB_C21; \ | ||
370 | type CM_COMB_C22; \ | ||
371 | type CM_COMB_C23; \ | ||
372 | type CM_COMB_C24; \ | ||
373 | type CM_COMB_C31; \ | ||
374 | type CM_COMB_C32; \ | ||
375 | type CM_COMB_C33; \ | ||
376 | type CM_COMB_C34; \ | ||
317 | type CM_RGAM_LUT_MODE; \ | 377 | type CM_RGAM_LUT_MODE; \ |
318 | type OBUF_BYPASS; \ | 378 | type OBUF_BYPASS; \ |
319 | type OBUF_H_2X_UPSCALE_EN; \ | 379 | type OBUF_H_2X_UPSCALE_EN; \ |
@@ -527,6 +587,18 @@ struct dcn10_opp_mask { | |||
527 | }; | 587 | }; |
528 | 588 | ||
529 | struct dcn10_opp_registers { | 589 | struct dcn10_opp_registers { |
590 | uint32_t CM_OCSC_C11_C12; | ||
591 | uint32_t CM_OCSC_C13_C14; | ||
592 | uint32_t CM_OCSC_C21_C22; | ||
593 | uint32_t CM_OCSC_C23_C24; | ||
594 | uint32_t CM_OCSC_C31_C32; | ||
595 | uint32_t CM_OCSC_C33_C34; | ||
596 | uint32_t CM_COMB_C11_C12; | ||
597 | uint32_t CM_COMB_C13_C14; | ||
598 | uint32_t CM_COMB_C21_C22; | ||
599 | uint32_t CM_COMB_C23_C24; | ||
600 | uint32_t CM_COMB_C31_C32; | ||
601 | uint32_t CM_COMB_C33_C34; | ||
530 | uint32_t CM_RGAM_LUT_WRITE_EN_MASK; | 602 | uint32_t CM_RGAM_LUT_WRITE_EN_MASK; |
531 | uint32_t CM_RGAM_CONTROL; | 603 | uint32_t CM_RGAM_CONTROL; |
532 | uint32_t OBUF_CONTROL; | 604 | uint32_t OBUF_CONTROL; |
@@ -619,4 +691,8 @@ void dcn10_opp_construct(struct dcn10_opp *oppn10, | |||
619 | const struct dcn10_opp_shift *opp_shift, | 691 | const struct dcn10_opp_shift *opp_shift, |
620 | const struct dcn10_opp_mask *opp_mask); | 692 | const struct dcn10_opp_mask *opp_mask); |
621 | 693 | ||
694 | void program_color_matrix( | ||
695 | struct dcn10_opp *oppn10, | ||
696 | const struct out_csc_color_matrix *tbl_entry); | ||
697 | |||
622 | #endif | 698 | #endif |
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c index d9815a991682..92322b75d868 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_transform.c | |||
@@ -1027,9 +1027,8 @@ static struct transform_funcs dcn10_transform_funcs = { | |||
1027 | 1027 | ||
1028 | .transform_reset = transform_reset, | 1028 | .transform_reset = transform_reset, |
1029 | .transform_set_scaler = transform_set_scaler_manual_scale, | 1029 | .transform_set_scaler = transform_set_scaler_manual_scale, |
1030 | .transform_get_optimal_number_of_taps = | 1030 | .transform_get_optimal_number_of_taps = transform_get_optimal_number_of_taps, |
1031 | transform_get_optimal_number_of_taps, | 1031 | .transform_set_gamut_remap = dcn_transform_set_gamut_remap, |
1032 | .transform_set_gamut_remap = dcn_transform_set_gamut_remap | ||
1033 | }; | 1032 | }; |
1034 | 1033 | ||
1035 | /*****************************************/ | 1034 | /*****************************************/ |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h index 8325a0a47179..b4862c376b41 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/transform.h | |||
@@ -180,6 +180,7 @@ struct transform_funcs { | |||
180 | struct transform *xfm, | 180 | struct transform *xfm, |
181 | const struct xfm_grph_csc_adjustment *adjust); | 181 | const struct xfm_grph_csc_adjustment *adjust); |
182 | 182 | ||
183 | |||
183 | void (*transform_set_pixel_storage_depth)( | 184 | void (*transform_set_pixel_storage_depth)( |
184 | struct transform *xfm, | 185 | struct transform *xfm, |
185 | enum lb_pixel_depth depth, | 186 | enum lb_pixel_depth depth, |
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h index 642ae5e4ee1c..97dbd259f66c 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | |||
@@ -70,6 +70,11 @@ struct hw_sequencer_funcs { | |||
70 | void (*program_gamut_remap)( | 70 | void (*program_gamut_remap)( |
71 | struct pipe_ctx *pipe_ctx); | 71 | struct pipe_ctx *pipe_ctx); |
72 | 72 | ||
73 | void (*program_csc_matrix)( | ||
74 | struct pipe_ctx *pipe_ctx, | ||
75 | enum dc_color_space colorspace, | ||
76 | uint16_t *matrix); | ||
77 | |||
73 | void (*update_plane_addr)( | 78 | void (*update_plane_addr)( |
74 | const struct core_dc *dc, | 79 | const struct core_dc *dc, |
75 | struct pipe_ctx *pipe_ctx); | 80 | struct pipe_ctx *pipe_ctx); |