aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorAnthony Koo <Anthony.Koo@amd.com>2019-01-20 01:45:36 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-02-06 13:31:15 -0500
commit9c0fb8d45bfcf2e8f080489913db443c1fd241ed (patch)
treeee9763003583c13aad0a67227fde5fac6830e29c /drivers/gpu/drm/amd
parentd2d7885f75b614a982a73383956570d95d79c23e (diff)
drm/amd/display: refactor programming of DRR
[Why] Keep enable_stream_timing programming only timing related stuff. [How] Move DRR and static screen mask programming from enable_stream_timing to outside in apply_single_controller_ctx_to_hw Signed-off-by: Anthony Koo <Anthony.Koo@amd.com> Reviewed-by: Aric Cyr <Aric.Cyr@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c31
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c15
2 files changed, 15 insertions, 31 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 21ceda410244..a4386348a981 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -1250,8 +1250,6 @@ static enum dc_status dce110_enable_stream_timing(
1250 struct pipe_ctx *pipe_ctx_old = &dc->current_state->res_ctx. 1250 struct pipe_ctx *pipe_ctx_old = &dc->current_state->res_ctx.
1251 pipe_ctx[pipe_ctx->pipe_idx]; 1251 pipe_ctx[pipe_ctx->pipe_idx];
1252 struct tg_color black_color = {0}; 1252 struct tg_color black_color = {0};
1253 struct drr_params params = {0};
1254 unsigned int event_triggers = 0;
1255 1253
1256 if (!pipe_ctx_old->stream) { 1254 if (!pipe_ctx_old->stream) {
1257 1255
@@ -1280,20 +1278,6 @@ static enum dc_status dce110_enable_stream_timing(
1280 pipe_ctx->stream_res.tg, 1278 pipe_ctx->stream_res.tg,
1281 &stream->timing, 1279 &stream->timing,
1282 true); 1280 true);
1283
1284 params.vertical_total_min = stream->adjust.v_total_min;
1285 params.vertical_total_max = stream->adjust.v_total_max;
1286 if (pipe_ctx->stream_res.tg->funcs->set_drr)
1287 pipe_ctx->stream_res.tg->funcs->set_drr(
1288 pipe_ctx->stream_res.tg, &params);
1289
1290 // DRR should set trigger event to monitor surface update event
1291 if (stream->adjust.v_total_min != 0 &&
1292 stream->adjust.v_total_max != 0)
1293 event_triggers = 0x80;
1294 if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control)
1295 pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
1296 pipe_ctx->stream_res.tg, event_triggers);
1297 } 1281 }
1298 1282
1299 if (!pipe_ctx_old->stream) { 1283 if (!pipe_ctx_old->stream) {
@@ -1313,6 +1297,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(
1313 struct dc *dc) 1297 struct dc *dc)
1314{ 1298{
1315 struct dc_stream_state *stream = pipe_ctx->stream; 1299 struct dc_stream_state *stream = pipe_ctx->stream;
1300 struct drr_params params = {0};
1301 unsigned int event_triggers = 0;
1316 1302
1317 if (pipe_ctx->stream_res.audio != NULL) { 1303 if (pipe_ctx->stream_res.audio != NULL) {
1318 struct audio_output audio_output; 1304 struct audio_output audio_output;
@@ -1348,6 +1334,19 @@ static enum dc_status apply_single_controller_ctx_to_hw(
1348 pipe_ctx->stream_res.tg, 1334 pipe_ctx->stream_res.tg,
1349 &stream->timing); 1335 &stream->timing);
1350 1336
1337 params.vertical_total_min = stream->adjust.v_total_min;
1338 params.vertical_total_max = stream->adjust.v_total_max;
1339 if (pipe_ctx->stream_res.tg->funcs->set_drr)
1340 pipe_ctx->stream_res.tg->funcs->set_drr(
1341 pipe_ctx->stream_res.tg, &params);
1342
1343 // DRR should set trigger event to monitor surface update event
1344 if (stream->adjust.v_total_min != 0 && stream->adjust.v_total_max != 0)
1345 event_triggers = 0x80;
1346 if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control)
1347 pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
1348 pipe_ctx->stream_res.tg, event_triggers);
1349
1351 if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL) 1350 if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL)
1352 pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg( 1351 pipe_ctx->stream_res.stream_enc->funcs->dig_connect_to_otg(
1353 pipe_ctx->stream_res.stream_enc, 1352 pipe_ctx->stream_res.stream_enc,
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 7117144d48bd..a03bbbf94d5d 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
@@ -636,8 +636,6 @@ static enum dc_status dcn10_enable_stream_timing(
636 struct dc_stream_state *stream = pipe_ctx->stream; 636 struct dc_stream_state *stream = pipe_ctx->stream;
637 enum dc_color_space color_space; 637 enum dc_color_space color_space;
638 struct tg_color black_color = {0}; 638 struct tg_color black_color = {0};
639 struct drr_params params = {0};
640 unsigned int event_triggers = 0;
641 639
642 /* by upper caller loop, pipe0 is parent pipe and be called first. 640 /* by upper caller loop, pipe0 is parent pipe and be called first.
643 * back end is set up by for pipe0. Other children pipe share back end 641 * back end is set up by for pipe0. Other children pipe share back end
@@ -705,19 +703,6 @@ static enum dc_status dcn10_enable_stream_timing(
705 return DC_ERROR_UNEXPECTED; 703 return DC_ERROR_UNEXPECTED;
706 } 704 }
707 705
708 params.vertical_total_min = stream->adjust.v_total_min;
709 params.vertical_total_max = stream->adjust.v_total_max;
710 if (pipe_ctx->stream_res.tg->funcs->set_drr)
711 pipe_ctx->stream_res.tg->funcs->set_drr(
712 pipe_ctx->stream_res.tg, &params);
713
714 // DRR should set trigger event to monitor surface update event
715 if (stream->adjust.v_total_min != 0 && stream->adjust.v_total_max != 0)
716 event_triggers = 0x80;
717 if (pipe_ctx->stream_res.tg->funcs->set_static_screen_control)
718 pipe_ctx->stream_res.tg->funcs->set_static_screen_control(
719 pipe_ctx->stream_res.tg, event_triggers);
720
721 /* TODO program crtc source select for non-virtual signal*/ 706 /* TODO program crtc source select for non-virtual signal*/
722 /* TODO program FMT */ 707 /* TODO program FMT */
723 /* TODO setup link_enc */ 708 /* TODO setup link_enc */