summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
diff options
context:
space:
mode:
authorhersen wu <hersenxs.wu@amd.com>2019-03-13 16:19:17 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-22 09:34:08 -0500
commit0fcf90d1775e09fbee2afe40a43f6400c103ac55 (patch)
treea6fa6a432e1bf9a2f6e8c244ec0abfd5e642c0ce /drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
parent96cb7cf13d8530099c256c053648ad576588c387 (diff)
drm/amd/display: do not need otg lock if otg is not active
[todo] need find caller bug. tempooariy fix Signed-off-by: hersen wu <hersenxs.wu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c11
1 files changed, 10 insertions, 1 deletions
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 b3fc71648d16..a546c2bc9129 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
@@ -584,6 +584,13 @@ uint32_t optc1_get_vblank_counter(struct timing_generator *optc)
void optc1_lock(struct timing_generator *optc)
{
struct optc *optc1 = DCN10TG_FROM_TG(optc);
+ uint32_t regval = 0;
+
+ regval = REG_READ(OTG_CONTROL);
+
+ /* otg is not running, do not need to be locked */
+ if ((regval & 0x1) == 0x0)
+ return;
REG_SET(OTG_GLOBAL_CONTROL0, 0,
OTG_MASTER_UPDATE_LOCK_SEL, optc->inst);
@@ -591,10 +598,12 @@ void optc1_lock(struct timing_generator *optc)
OTG_MASTER_UPDATE_LOCK, 1);
/* Should be fast, status does not update on maximus */
- if (optc->ctx->dce_environment != DCE_ENV_FPGA_MAXIMUS)
+ if (optc->ctx->dce_environment != DCE_ENV_FPGA_MAXIMUS) {
+
REG_WAIT(OTG_MASTER_UPDATE_LOCK,
UPDATE_LOCK_STATUS, 1,
1, 10);
+ }
}
void optc1_unlock(struct timing_generator *optc)