From 1fb461e35e5581cddb039359f6f58efe89bc1923 Mon Sep 17 00:00:00 2001 From: Fuad Hossain Date: Wed, 26 Jun 2019 16:15:08 -0400 Subject: [PATCH] disp: msm: sde: Ensure that dirty dsc blocks are flushed properly When a dsc block gets disabled, it is not being flushed properly because the kms_commit clears the flush bits before the next vsync. In a two commit scenario where the first commit disables both dsc blocks within the same dsc block pair, and where the second commit enables only one of the dsc blocks in the pair, only the second commit's dsc block gets flushed properly because checks for dirty dsc blocks are currently only happening if dsc is disabled for the encoder. Since the first commit's disabled dsc block was not flushed to hardware, there will be errors such as pingpong timeouts and fifo underruns, which can lead to distorted images on the panel. This problem manifests itself in suspend/resume scenarios involving dp dsc connections which only use one dsc block. During a suspend, the two dsc blocks that were used by dsi are released due to a null commit coming from userspace. While resuming, depending on the mode, one of these released dsc blocks will be alloted to dp, leading to the problem described above. CRs-Fixed: 2471336 Change-Id: Ifd71c980a04d63a87923eb0bece96646d4804533 Signed-off-by: Fuad Hossain --- msm/sde/sde_encoder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 5447b5d5e51e..062dbaa22653 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -4743,10 +4743,11 @@ int sde_encoder_prepare_for_kickoff(struct drm_encoder *drm_enc, SDE_ERROR_ENC(sde_enc, "failed to setup DSC: %d\n", rc); ret = rc; } - } else if (_sde_encoder_dsc_is_dirty(sde_enc)) { - _helper_flush_dsc(sde_enc); } + if (_sde_encoder_dsc_is_dirty(sde_enc)) + _helper_flush_dsc(sde_enc); + if (sde_enc->cur_master && !sde_enc->cur_master->cont_splash_enabled) sde_configure_qdss(sde_enc, sde_enc->cur_master->hw_qdss, sde_enc->cur_master, sde_kms->qdss_enabled);