aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Bernstein <eric.bernstein@amd.com>2017-12-12 14:14:10 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-12-20 14:48:47 -0500
commit72d520d4fa76e59d1882620fa34680ff4258ae6f (patch)
treeb68c3e7767e9856746bb286e1840b7e686e98758
parent4ebf8483112e3f33f7a96b5aa8779d25ad5f71b7 (diff)
drm/amd/display: Update FMT and OPPBUF functions
Updates to FMT and OPPBUF programming from HW team pseudocode review. Signed-off-by: Eric Bernstein <eric.bernstein@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c12
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c72
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h43
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c16
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h8
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw/opp.h23
6 files changed, 120 insertions, 54 deletions
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 2ca364f30e1d..82572863acab 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
@@ -462,9 +462,6 @@ static enum dc_status dcn10_prog_pixclk_crtc_otg(
462 struct dc_stream_state *stream = pipe_ctx->stream; 462 struct dc_stream_state *stream = pipe_ctx->stream;
463 enum dc_color_space color_space; 463 enum dc_color_space color_space;
464 struct tg_color black_color = {0}; 464 struct tg_color black_color = {0};
465 bool enableStereo = stream->timing.timing_3d_format == TIMING_3D_FORMAT_NONE ?
466 false:true;
467 bool rightEyePolarity = stream->timing.flags.RIGHT_EYE_3D_POLARITY;
468 465
469 /* by upper caller loop, pipe0 is parent pipe and be called first. 466 /* by upper caller loop, pipe0 is parent pipe and be called first.
470 * back end is set up by for pipe0. Other children pipe share back end 467 * back end is set up by for pipe0. Other children pipe share back end
@@ -499,11 +496,6 @@ static enum dc_status dcn10_prog_pixclk_crtc_otg(
499 &stream->timing, 496 &stream->timing,
500 true); 497 true);
501 498
502 pipe_ctx->stream_res.opp->funcs->opp_set_stereo_polarity(
503 pipe_ctx->stream_res.opp,
504 enableStereo,
505 rightEyePolarity);
506
507#if 0 /* move to after enable_crtc */ 499#if 0 /* move to after enable_crtc */
508 /* TODO: OPP FMT, ABM. etc. should be done here. */ 500 /* TODO: OPP FMT, ABM. etc. should be done here. */
509 /* or FPGA now. instance 0 only. TODO: move to opp.c */ 501 /* or FPGA now. instance 0 only. TODO: move to opp.c */
@@ -2251,10 +2243,10 @@ static void dcn10_setup_stereo(struct pipe_ctx *pipe_ctx, struct dc *dc)
2251 2243
2252 dcn10_config_stereo_parameters(stream, &flags); 2244 dcn10_config_stereo_parameters(stream, &flags);
2253 2245
2254 pipe_ctx->stream_res.opp->funcs->opp_set_stereo_polarity( 2246 pipe_ctx->stream_res.opp->funcs->opp_program_stereo(
2255 pipe_ctx->stream_res.opp, 2247 pipe_ctx->stream_res.opp,
2256 flags.PROGRAM_STEREO == 1 ? true:false, 2248 flags.PROGRAM_STEREO == 1 ? true:false,
2257 stream->timing.flags.RIGHT_EYE_3D_POLARITY == 1 ? true:false); 2249 &stream->timing);
2258 2250
2259 pipe_ctx->stream_res.tg->funcs->program_stereo( 2251 pipe_ctx->stream_res.tg->funcs->program_stereo(
2260 pipe_ctx->stream_res.tg, 2252 pipe_ctx->stream_res.tg,
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 5f078868676c..f6ba0eef4489 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.c
@@ -296,13 +296,75 @@ void opp1_program_fmt(
296 return; 296 return;
297} 297}
298 298
299void opp1_set_stereo_polarity( 299void opp1_program_stereo(
300 struct output_pixel_processor *opp, 300 struct output_pixel_processor *opp,
301 bool enable, bool rightEyePolarity) 301 bool enable,
302 const struct dc_crtc_timing *timing)
302{ 303{
303 struct dcn10_opp *oppn10 = TO_DCN10_OPP(opp); 304 struct dcn10_opp *oppn10 = TO_DCN10_OPP(opp);
304 305
305 REG_UPDATE(FMT_CONTROL, FMT_STEREOSYNC_OVERRIDE, enable); 306 uint32_t active_width = timing->h_addressable - timing->h_border_right - timing->h_border_right;
307 uint32_t space1_size = timing->v_total - timing->v_addressable;
308 /* TODO: confirm computation of space2_size */
309 uint32_t space2_size = timing->v_total - timing->v_addressable;
310
311 if (!enable) {
312 active_width = 0;
313 space1_size = 0;
314 space2_size = 0;
315 }
316
317 /* TODO: for which cases should FMT_STEREOSYNC_OVERRIDE be set? */
318 REG_UPDATE(FMT_CONTROL, FMT_STEREOSYNC_OVERRIDE, 0);
319
320 REG_UPDATE(OPPBUF_CONTROL, OPPBUF_ACTIVE_WIDTH, active_width);
321
322 /* Program OPPBUF_3D_VACT_SPACE1_SIZE and OPPBUF_VACT_SPACE2_SIZE registers
323 * In 3D progressive frames, Vactive space happens only in between the 2 frames,
324 * so only need to program OPPBUF_3D_VACT_SPACE1_SIZE
325 * In 3D alternative frames, left and right frames, top and bottom field.
326 */
327 if (timing->timing_3d_format == TIMING_3D_FORMAT_FRAME_ALTERNATE)
328 REG_UPDATE(OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE2_SIZE, space2_size);
329 else
330 REG_UPDATE(OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE1_SIZE, space1_size);
331
332 /* TODO: Is programming of OPPBUF_DUMMY_DATA_R/G/B needed? */
333 /*
334 REG_UPDATE(OPPBUF_3D_PARAMETERS_0,
335 OPPBUF_DUMMY_DATA_R, data_r);
336 REG_UPDATE(OPPBUF_3D_PARAMETERS_1,
337 OPPBUF_DUMMY_DATA_G, data_g);
338 REG_UPDATE(OPPBUF_3D_PARAMETERS_1,
339 OPPBUF_DUMMY_DATA_B, _data_b);
340 */
341}
342
343void opp1_program_oppbuf(
344 struct output_pixel_processor *opp,
345 struct oppbuf_params *oppbuf)
346{
347 struct dcn10_opp *oppn10 = TO_DCN10_OPP(opp);
348
349 /* Program the oppbuf active width to be the frame width from mpc */
350 REG_UPDATE(OPPBUF_CONTROL, OPPBUF_ACTIVE_WIDTH, oppbuf->active_width);
351
352 /* Specifies the number of segments in multi-segment mode (DP-MSO operation)
353 * description "In 1/2/4 segment mode, specifies the horizontal active width in pixels of the display panel.
354 * In 4 segment split left/right mode, specifies the horizontal 1/2 active width in pixels of the display panel.
355 * Used to determine segment boundaries in multi-segment mode. Used to determine the width of the vertical active space in 3D frame packed modes.
356 * OPPBUF_ACTIVE_WIDTH must be integer divisible by the total number of segments."
357 */
358 REG_UPDATE(OPPBUF_CONTROL, OPPBUF_DISPLAY_SEGMENTATION, oppbuf->mso_segmentation);
359
360 /* description "Specifies the number of overlap pixels (1-8 overlapping pixels supported), used in multi-segment mode (DP-MSO operation)" */
361 REG_UPDATE(OPPBUF_CONTROL, OPPBUF_OVERLAP_PIXEL_NUM, oppbuf->mso_overlap_pixel_num);
362
363 /* description "Specifies the number of times a pixel is replicated (0-15 pixel replications supported).
364 * A value of 0 disables replication. The total number of times a pixel is output is OPPBUF_PIXEL_REPETITION + 1."
365 */
366 REG_UPDATE(OPPBUF_CONTROL, OPPBUF_PIXEL_REPETITION, oppbuf->pixel_repetition);
367
306} 368}
307 369
308/*****************************************/ 370/*****************************************/
@@ -319,7 +381,7 @@ static struct opp_funcs dcn10_opp_funcs = {
319 .opp_set_dyn_expansion = opp1_set_dyn_expansion, 381 .opp_set_dyn_expansion = opp1_set_dyn_expansion,
320 .opp_program_fmt = opp1_program_fmt, 382 .opp_program_fmt = opp1_program_fmt,
321 .opp_program_bit_depth_reduction = opp1_program_bit_depth_reduction, 383 .opp_program_bit_depth_reduction = opp1_program_bit_depth_reduction,
322 .opp_set_stereo_polarity = opp1_set_stereo_polarity, 384 .opp_program_stereo = opp1_program_stereo,
323 .opp_destroy = opp1_destroy 385 .opp_destroy = opp1_destroy
324}; 386};
325 387
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 f3c298ec37fb..bc5058af6266 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_opp.h
@@ -41,7 +41,10 @@
41 SRI(FMT_DITHER_RAND_B_SEED, FMT, id), \ 41 SRI(FMT_DITHER_RAND_B_SEED, FMT, id), \
42 SRI(FMT_CLAMP_CNTL, FMT, id), \ 42 SRI(FMT_CLAMP_CNTL, FMT, id), \
43 SRI(FMT_DYNAMIC_EXP_CNTL, FMT, id), \ 43 SRI(FMT_DYNAMIC_EXP_CNTL, FMT, id), \
44 SRI(FMT_MAP420_MEMORY_CONTROL, FMT, id) 44 SRI(FMT_MAP420_MEMORY_CONTROL, FMT, id), \
45 SRI(OPPBUF_CONTROL, OPPBUF, id),\
46 SRI(OPPBUF_3D_PARAMETERS_0, OPPBUF, id), \
47 SRI(OPPBUF_3D_PARAMETERS_1, OPPBUF, id)
45 48
46#define OPP_REG_LIST_DCN10(id) \ 49#define OPP_REG_LIST_DCN10(id) \
47 OPP_REG_LIST_DCN(id) 50 OPP_REG_LIST_DCN(id)
@@ -54,7 +57,11 @@
54 uint32_t FMT_DITHER_RAND_B_SEED; \ 57 uint32_t FMT_DITHER_RAND_B_SEED; \
55 uint32_t FMT_CLAMP_CNTL; \ 58 uint32_t FMT_CLAMP_CNTL; \
56 uint32_t FMT_DYNAMIC_EXP_CNTL; \ 59 uint32_t FMT_DYNAMIC_EXP_CNTL; \
57 uint32_t FMT_MAP420_MEMORY_CONTROL; 60 uint32_t FMT_MAP420_MEMORY_CONTROL; \
61 uint32_t OPPBUF_CONTROL; \
62 uint32_t OPPBUF_CONTROL1; \
63 uint32_t OPPBUF_3D_PARAMETERS_0; \
64 uint32_t OPPBUF_3D_PARAMETERS_1
58 65
59#define OPP_MASK_SH_LIST_DCN(mask_sh) \ 66#define OPP_MASK_SH_LIST_DCN(mask_sh) \
60 OPP_SF(FMT0_FMT_BIT_DEPTH_CONTROL, FMT_TRUNCATE_EN, mask_sh), \ 67 OPP_SF(FMT0_FMT_BIT_DEPTH_CONTROL, FMT_TRUNCATE_EN, mask_sh), \
@@ -78,10 +85,16 @@
78 OPP_SF(FMT0_FMT_CLAMP_CNTL, FMT_CLAMP_COLOR_FORMAT, mask_sh), \ 85 OPP_SF(FMT0_FMT_CLAMP_CNTL, FMT_CLAMP_COLOR_FORMAT, mask_sh), \
79 OPP_SF(FMT0_FMT_DYNAMIC_EXP_CNTL, FMT_DYNAMIC_EXP_EN, mask_sh), \ 86 OPP_SF(FMT0_FMT_DYNAMIC_EXP_CNTL, FMT_DYNAMIC_EXP_EN, mask_sh), \
80 OPP_SF(FMT0_FMT_DYNAMIC_EXP_CNTL, FMT_DYNAMIC_EXP_MODE, mask_sh), \ 87 OPP_SF(FMT0_FMT_DYNAMIC_EXP_CNTL, FMT_DYNAMIC_EXP_MODE, mask_sh), \
81 OPP_SF(FMT0_FMT_MAP420_MEMORY_CONTROL, FMT_MAP420MEM_PWR_FORCE, mask_sh) 88 OPP_SF(FMT0_FMT_MAP420_MEMORY_CONTROL, FMT_MAP420MEM_PWR_FORCE, mask_sh), \
89 OPP_SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_ACTIVE_WIDTH, mask_sh),\
90 OPP_SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_PIXEL_REPETITION, mask_sh),\
91 OPP_SF(OPPBUF0_OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE1_SIZE, mask_sh), \
92 OPP_SF(OPPBUF0_OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE2_SIZE, mask_sh)
82 93
83#define OPP_MASK_SH_LIST_DCN10(mask_sh) \ 94#define OPP_MASK_SH_LIST_DCN10(mask_sh) \
84 OPP_MASK_SH_LIST_DCN(mask_sh) 95 OPP_MASK_SH_LIST_DCN(mask_sh), \
96 OPP_SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_DISPLAY_SEGMENTATION, mask_sh),\
97 OPP_SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_OVERLAP_PIXEL_NUM, mask_sh)
85 98
86#define OPP_DCN10_REG_FIELD_LIST(type) \ 99#define OPP_DCN10_REG_FIELD_LIST(type) \
87 type FMT_TRUNCATE_EN; \ 100 type FMT_TRUNCATE_EN; \
@@ -105,18 +118,25 @@
105 type FMT_DYNAMIC_EXP_EN; \ 118 type FMT_DYNAMIC_EXP_EN; \
106 type FMT_DYNAMIC_EXP_MODE; \ 119 type FMT_DYNAMIC_EXP_MODE; \
107 type FMT_MAP420MEM_PWR_FORCE; \ 120 type FMT_MAP420MEM_PWR_FORCE; \
108 type FMT_STEREOSYNC_OVERRIDE; 121 type FMT_STEREOSYNC_OVERRIDE; \
122 type OPPBUF_ACTIVE_WIDTH;\
123 type OPPBUF_PIXEL_REPETITION;\
124 type OPPBUF_DISPLAY_SEGMENTATION;\
125 type OPPBUF_OVERLAP_PIXEL_NUM;\
126 type OPPBUF_NUM_SEGMENT_PADDED_PIXELS; \
127 type OPPBUF_3D_VACT_SPACE1_SIZE; \
128 type OPPBUF_3D_VACT_SPACE2_SIZE
109 129
110struct dcn10_opp_registers { 130struct dcn10_opp_registers {
111 OPP_COMMON_REG_VARIABLE_LIST 131 OPP_COMMON_REG_VARIABLE_LIST;
112}; 132};
113 133
114struct dcn10_opp_shift { 134struct dcn10_opp_shift {
115 OPP_DCN10_REG_FIELD_LIST(uint8_t) 135 OPP_DCN10_REG_FIELD_LIST(uint8_t);
116}; 136};
117 137
118struct dcn10_opp_mask { 138struct dcn10_opp_mask {
119 OPP_DCN10_REG_FIELD_LIST(uint32_t) 139 OPP_DCN10_REG_FIELD_LIST(uint32_t);
120}; 140};
121 141
122struct dcn10_opp { 142struct dcn10_opp {
@@ -151,9 +171,10 @@ void opp1_program_bit_depth_reduction(
151 struct output_pixel_processor *opp, 171 struct output_pixel_processor *opp,
152 const struct bit_depth_reduction_params *params); 172 const struct bit_depth_reduction_params *params);
153 173
154void opp1_set_stereo_polarity( 174void opp1_program_stereo(
155 struct output_pixel_processor *opp, 175 struct output_pixel_processor *opp,
156 bool enable, bool rightEyePolarity); 176 bool enable,
177 const struct dc_crtc_timing *timing);
157 178
158void opp1_destroy(struct output_pixel_processor **opp); 179void opp1_destroy(struct output_pixel_processor **opp);
159 180
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
index 827dd1486ce2..4bf64d1b2c60 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
@@ -91,11 +91,6 @@ static void optc1_disable_stereo(struct timing_generator *optc)
91 OTG_3D_STRUCTURE_EN, 0, 91 OTG_3D_STRUCTURE_EN, 0,
92 OTG_3D_STRUCTURE_V_UPDATE_MODE, 0, 92 OTG_3D_STRUCTURE_V_UPDATE_MODE, 0,
93 OTG_3D_STRUCTURE_STEREO_SEL_OVR, 0); 93 OTG_3D_STRUCTURE_STEREO_SEL_OVR, 0);
94
95 REG_UPDATE(OPPBUF_CONTROL,
96 OPPBUF_ACTIVE_WIDTH, 0);
97 REG_UPDATE(OPPBUF_3D_PARAMETERS_0,
98 OPPBUF_3D_VACT_SPACE1_SIZE, 0);
99} 94}
100 95
101/** 96/**
@@ -1078,16 +1073,11 @@ void optc1_get_crtc_scanoutpos(
1078 *v_position = position.vertical_count; 1073 *v_position = position.vertical_count;
1079} 1074}
1080 1075
1081
1082
1083static void optc1_enable_stereo(struct timing_generator *optc, 1076static void optc1_enable_stereo(struct timing_generator *optc,
1084 const struct dc_crtc_timing *timing, struct crtc_stereo_flags *flags) 1077 const struct dc_crtc_timing *timing, struct crtc_stereo_flags *flags)
1085{ 1078{
1086 struct optc *optc1 = DCN10TG_FROM_TG(optc); 1079 struct optc *optc1 = DCN10TG_FROM_TG(optc);
1087 1080
1088 uint32_t active_width = timing->h_addressable;
1089 uint32_t space1_size = timing->v_total - timing->v_addressable;
1090
1091 if (flags) { 1081 if (flags) {
1092 uint32_t stereo_en; 1082 uint32_t stereo_en;
1093 stereo_en = flags->FRAME_PACKED == 0 ? 1 : 0; 1083 stereo_en = flags->FRAME_PACKED == 0 ? 1 : 0;
@@ -1114,12 +1104,6 @@ static void optc1_enable_stereo(struct timing_generator *optc,
1114 OTG_3D_STRUCTURE_STEREO_SEL_OVR, flags->FRAME_PACKED); 1104 OTG_3D_STRUCTURE_STEREO_SEL_OVR, flags->FRAME_PACKED);
1115 1105
1116 } 1106 }
1117
1118 REG_UPDATE(OPPBUF_CONTROL,
1119 OPPBUF_ACTIVE_WIDTH, active_width);
1120
1121 REG_UPDATE(OPPBUF_3D_PARAMETERS_0,
1122 OPPBUF_3D_VACT_SPACE1_SIZE, space1_size);
1123} 1107}
1124 1108
1125void optc1_program_stereo(struct timing_generator *optc, 1109void optc1_program_stereo(struct timing_generator *optc,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
index eec860fa21e6..a3c7c2012f05 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h
@@ -70,8 +70,6 @@
70 SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\ 70 SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\
71 SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\ 71 SRI(OPTC_DATA_SOURCE_SELECT, ODM, inst),\
72 SRI(OPTC_INPUT_GLOBAL_CONTROL, ODM, inst),\ 72 SRI(OPTC_INPUT_GLOBAL_CONTROL, ODM, inst),\
73 SRI(OPPBUF_CONTROL, OPPBUF, inst),\
74 SRI(OPPBUF_3D_PARAMETERS_0, OPPBUF, inst),\
75 SRI(CONTROL, VTG, inst),\ 73 SRI(CONTROL, VTG, inst),\
76 SRI(OTG_VERT_SYNC_CONTROL, OTG, inst),\ 74 SRI(OTG_VERT_SYNC_CONTROL, OTG, inst),\
77 SRI(OTG_MASTER_UPDATE_MODE, OTG, inst),\ 75 SRI(OTG_MASTER_UPDATE_MODE, OTG, inst),\
@@ -129,8 +127,6 @@ struct dcn_optc_registers {
129 uint32_t OPTC_INPUT_CLOCK_CONTROL; 127 uint32_t OPTC_INPUT_CLOCK_CONTROL;
130 uint32_t OPTC_DATA_SOURCE_SELECT; 128 uint32_t OPTC_DATA_SOURCE_SELECT;
131 uint32_t OPTC_INPUT_GLOBAL_CONTROL; 129 uint32_t OPTC_INPUT_GLOBAL_CONTROL;
132 uint32_t OPPBUF_CONTROL;
133 uint32_t OPPBUF_3D_PARAMETERS_0;
134 uint32_t CONTROL; 130 uint32_t CONTROL;
135 uint32_t OTG_GSL_WINDOW_X; 131 uint32_t OTG_GSL_WINDOW_X;
136 uint32_t OTG_GSL_WINDOW_Y; 132 uint32_t OTG_GSL_WINDOW_Y;
@@ -215,8 +211,6 @@ struct dcn_optc_registers {
215 SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_GATE_DIS, mask_sh),\ 211 SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_GATE_DIS, mask_sh),\
216 SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_OCCURRED_STATUS, mask_sh),\ 212 SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_OCCURRED_STATUS, mask_sh),\
217 SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_CLEAR, mask_sh),\ 213 SF(ODM0_OPTC_INPUT_GLOBAL_CONTROL, OPTC_UNDERFLOW_CLEAR, mask_sh),\
218 SF(OPPBUF0_OPPBUF_CONTROL, OPPBUF_ACTIVE_WIDTH, mask_sh),\
219 SF(OPPBUF0_OPPBUF_3D_PARAMETERS_0, OPPBUF_3D_VACT_SPACE1_SIZE, mask_sh),\
220 SF(VTG0_CONTROL, VTG0_ENABLE, mask_sh),\ 214 SF(VTG0_CONTROL, VTG0_ENABLE, mask_sh),\
221 SF(VTG0_CONTROL, VTG0_FP2, mask_sh),\ 215 SF(VTG0_CONTROL, VTG0_FP2, mask_sh),\
222 SF(VTG0_CONTROL, VTG0_VCOUNT_INIT, mask_sh),\ 216 SF(VTG0_CONTROL, VTG0_VCOUNT_INIT, mask_sh),\
@@ -336,8 +330,6 @@ struct dcn_optc_registers {
336 type OPTC_SEG0_SRC_SEL;\ 330 type OPTC_SEG0_SRC_SEL;\
337 type OPTC_UNDERFLOW_OCCURRED_STATUS;\ 331 type OPTC_UNDERFLOW_OCCURRED_STATUS;\
338 type OPTC_UNDERFLOW_CLEAR;\ 332 type OPTC_UNDERFLOW_CLEAR;\
339 type OPPBUF_ACTIVE_WIDTH;\
340 type OPPBUF_3D_VACT_SPACE1_SIZE;\
341 type VTG0_ENABLE;\ 333 type VTG0_ENABLE;\
342 type VTG0_FP2;\ 334 type VTG0_FP2;\
343 type VTG0_VCOUNT_INIT;\ 335 type VTG0_VCOUNT_INIT;\
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
index 17e143e4cb94..ab8fb77f1ae5 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
@@ -249,6 +249,21 @@ enum ovl_csc_adjust_item {
249 OVERLAY_COLOR_TEMPERATURE 249 OVERLAY_COLOR_TEMPERATURE
250}; 250};
251 251
252enum oppbuf_display_segmentation {
253 OPPBUF_DISPLAY_SEGMENTATION_1_SEGMENT = 0,
254 OPPBUF_DISPLAY_SEGMENTATION_2_SEGMENT = 1,
255 OPPBUF_DISPLAY_SEGMENTATION_4_SEGMENT = 2,
256 OPPBUF_DISPLAY_SEGMENTATION_4_SEGMENT_SPLIT_LEFT = 3,
257 OPPBUF_DISPLAY_SEGMENTATION_4_SEGMENT_SPLIT_RIGHT = 4
258};
259
260struct oppbuf_params {
261 uint32_t active_width;
262 enum oppbuf_display_segmentation mso_segmentation;
263 uint32_t mso_overlap_pixel_num;
264 uint32_t pixel_repetition;
265};
266
252struct opp_funcs { 267struct opp_funcs {
253 268
254 269
@@ -277,10 +292,10 @@ struct opp_funcs {
277 292
278 void (*opp_destroy)(struct output_pixel_processor **opp); 293 void (*opp_destroy)(struct output_pixel_processor **opp);
279 294
280 void (*opp_set_stereo_polarity)( 295 void (*opp_program_stereo)(
281 struct output_pixel_processor *opp, 296 struct output_pixel_processor *opp,
282 bool enable, 297 bool enable,
283 bool rightEyePolarity); 298 const struct dc_crtc_timing *timing);
284 299
285}; 300};
286 301