aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorTony Cheng <tony.cheng@amd.com>2017-02-28 21:30:32 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:17:51 -0400
commitd98e5cc2ddacb34e9cdf1c06dce2758198af0120 (patch)
tree66a0ce231d31e37b4e2e1eaa2aede4f95a876bed /drivers/gpu/drm
parent2d60ded1325e0b4407aaa5396d1b331ea58f4f85 (diff)
drm/amd/display: clean up and simply locking logic
always take update lock instead of using HW built in update lock trigger with write to primary_addr_lo. we will be a little more inefficient with the extra registers write to lock, but this simplify code and make it always correct. Will revisit locking optimization once update sequence mature Signed-off-by: Tony Cheng <tony.cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Reviewed-by: Charlene Liu <Charlene.Liu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c32
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c3
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h1
3 files changed, 11 insertions, 25 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index efe50fd2be78..8f871924beb9 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1321,22 +1321,22 @@ void dc_update_surfaces_for_stream(struct dc *dc,
1321 1321
1322 if (pipe_ctx->surface != surface) 1322 if (pipe_ctx->surface != surface)
1323 continue; 1323 continue;
1324 /*lock all the MCPP if blnd is enable for DRR*/ 1324
1325 if ((update_type == UPDATE_TYPE_FAST && 1325 if (update_type == UPDATE_TYPE_FULL) {
1326 (dc_stream->freesync_ctx.enabled == true && 1326 /* only apply for top pipe */
1327 surface_count != context->res_ctx.pool->pipe_count)) && 1327 if (!pipe_ctx->top_pipe) {
1328 !pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) { 1328 core_dc->hwss.apply_ctx_for_surface(core_dc,
1329 lock_mask = PIPE_LOCK_CONTROL_MPCC_ADDR; 1329 surface, context);
1330 context_timing_trace(dc, &context->res_ctx);
1331 }
1330 } 1332 }
1331 1333
1332 if (update_type != UPDATE_TYPE_FAST && 1334 if (!pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
1333 !pipe_ctx->tg->funcs->is_blanked(pipe_ctx->tg)) {
1334 lock_mask = PIPE_LOCK_CONTROL_GRAPHICS | 1335 lock_mask = PIPE_LOCK_CONTROL_GRAPHICS |
1335 PIPE_LOCK_CONTROL_SCL | 1336 PIPE_LOCK_CONTROL_SCL |
1336 PIPE_LOCK_CONTROL_BLENDER | 1337 PIPE_LOCK_CONTROL_BLENDER |
1337 PIPE_LOCK_CONTROL_MODE; 1338 PIPE_LOCK_CONTROL_MODE;
1338 } 1339
1339 if (lock_mask != 0) {
1340 core_dc->hwss.pipe_control_lock( 1340 core_dc->hwss.pipe_control_lock(
1341 core_dc, 1341 core_dc,
1342 pipe_ctx, 1342 pipe_ctx,
@@ -1344,15 +1344,6 @@ void dc_update_surfaces_for_stream(struct dc *dc,
1344 true); 1344 true);
1345 } 1345 }
1346 1346
1347 if (update_type == UPDATE_TYPE_FULL) {
1348 /* only apply for top pipe */
1349 if (!pipe_ctx->top_pipe) {
1350 core_dc->hwss.apply_ctx_for_surface(core_dc,
1351 surface, context);
1352 context_timing_trace(dc, &context->res_ctx);
1353 }
1354 }
1355
1356 if (updates[i].flip_addr) 1347 if (updates[i].flip_addr)
1357 core_dc->hwss.update_plane_addr(core_dc, pipe_ctx); 1348 core_dc->hwss.update_plane_addr(core_dc, pipe_ctx);
1358 1349
@@ -1382,9 +1373,6 @@ void dc_update_surfaces_for_stream(struct dc *dc,
1382 } 1373 }
1383 } 1374 }
1384 1375
1385 if ((update_type == UPDATE_TYPE_FAST) && lock_mask == 0)
1386 return;
1387
1388 for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) { 1376 for (i = context->res_ctx.pool->pipe_count - 1; i >= 0; i--) {
1389 struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; 1377 struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
1390 1378
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c b/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c
index 1e1d60af8306..89a8274e12ea 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c
@@ -52,8 +52,7 @@ void dce_pipe_control_lock(struct core_dc *dc,
52 uint32_t lock_val = lock ? 1 : 0; 52 uint32_t lock_val = lock ? 1 : 0;
53 uint32_t dcp_grph, scl, blnd, update_lock_mode, val; 53 uint32_t dcp_grph, scl, blnd, update_lock_mode, val;
54 struct dce_hwseq *hws = dc->hwseq; 54 struct dce_hwseq *hws = dc->hwseq;
55 if (control_mask & PIPE_LOCK_CONTROL_MPCC_ADDR) 55
56 return;
57 val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx], 56 val = REG_GET_4(BLND_V_UPDATE_LOCK[pipe->pipe_idx],
58 BLND_DCP_GRPH_V_UPDATE_LOCK, &dcp_grph, 57 BLND_DCP_GRPH_V_UPDATE_LOCK, &dcp_grph,
59 BLND_SCL_V_UPDATE_LOCK, &scl, 58 BLND_SCL_V_UPDATE_LOCK, &scl,
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 a902de52107f..612910e720af 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
@@ -39,7 +39,6 @@ enum pipe_lock_control {
39 PIPE_LOCK_CONTROL_BLENDER = 1 << 1, 39 PIPE_LOCK_CONTROL_BLENDER = 1 << 1,
40 PIPE_LOCK_CONTROL_SCL = 1 << 2, 40 PIPE_LOCK_CONTROL_SCL = 1 << 2,
41 PIPE_LOCK_CONTROL_MODE = 1 << 3, 41 PIPE_LOCK_CONTROL_MODE = 1 << 3,
42 PIPE_LOCK_CONTROL_MPCC_ADDR = 1 << 4
43}; 42};
44 43
45struct dce_hwseq_wa { 44struct dce_hwseq_wa {