diff options
| author | Clarence Ip <cip@codeaurora.org> | 2016-08-23 13:43:19 -0400 |
|---|---|---|
| committer | Clarence Ip <cip@codeaurora.org> | 2016-12-01 11:53:54 -0500 |
| commit | 7f9aedc870ae7b30d4afb7b6fb79995100ff4952 (patch) | |
| tree | e7919b15759f33fbd6b44a1309ced046a822f614 | |
| parent | c7ef2fa30934421806f873b8c40278376618c486 (diff) | |
drm/msm/sde: enable master physical encoder last
Update the way in which the virtual encoder requests the physical
encoder enables so that the master physical encoder is always
enabled last. This is done so that all of the slaves are fully
prepared when the master is enabled, and also allows the master
to update any necessary configuration during its enable callback.
Change-Id: Iff0d9cd08f8589889b50974fbc9819d96a15ab63
Signed-off-by: Clarence Ip <cip@codeaurora.org>
| -rw-r--r-- | drivers/gpu/drm/msm/sde/sde_encoder.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c index 63861acdb1f1..7481c2a63d7d 100644 --- a/drivers/gpu/drm/msm/sde/sde_encoder.c +++ b/drivers/gpu/drm/msm/sde/sde_encoder.c @@ -404,6 +404,7 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc) bs_set(sde_enc, 1); + sde_enc->cur_master = NULL; for (i = 0; i < sde_enc->num_phys_encs; i++) { struct sde_encoder_phys *phys = sde_enc->phys_encs[i]; @@ -411,21 +412,20 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc) atomic_set(&phys->vsync_cnt, 0); atomic_set(&phys->underrun_cnt, 0); - if (phys->ops.enable) - phys->ops.enable(phys); - - /* - * Master can switch at enable time. - * It is based on the current mode (CMD/VID) and - * the encoder role found at panel probe time - */ if (phys->ops.is_master && phys->ops.is_master(phys)) { SDE_DEBUG_ENC(sde_enc, "master is now idx %d\n", i); sde_enc->cur_master = phys; + } else if (phys->ops.enable) { + phys->ops.enable(phys); } } } + + if (!sde_enc->cur_master) + SDE_ERROR("virt encoder has no master! num_phys %d\n", i); + else if (sde_enc->cur_master->ops.enable) + sde_enc->cur_master->ops.enable(sde_enc->cur_master); } static void sde_encoder_virt_disable(struct drm_encoder *drm_enc) |
