From 74f3b5a9de30e04553b6bb01dae98ae6a4c65058 Mon Sep 17 00:00:00 2001 From: Krishna Manikandan Date: Wed, 29 Apr 2020 14:58:07 +0530 Subject: [PATCH] disp: msm: sde: allow kthread init for off work during cwb During transition to cwb, kthread initialisation has to be done for the corresponding encoder off work so that the correct worker thread is used for this particular work. There can be scenarios where a cwb commit is received after a writeback session and the worker associated with the off work is still assigned to old crtc's worker resulting in a mismatch when this work is queued. Add support to handle such scenarios. Change-Id: I6080025e799977827f4d0f4ab7eb93c6644f981e Signed-off-by: Krishna Manikandan --- msm/sde/sde_encoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 6f4b65ea5cfc..4e8c3436b2aa 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -2652,7 +2652,9 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc) _sde_encoder_input_handler_register(drm_enc); - if (!(msm_is_mode_seamless_vrr(cur_mode) + if ((drm_enc->crtc->state->connectors_changed && + sde_encoder_in_clone_mode(drm_enc)) || + !(msm_is_mode_seamless_vrr(cur_mode) || msm_is_mode_seamless_dms(cur_mode) || msm_is_mode_seamless_dyn_clk(cur_mode))) kthread_init_delayed_work(&sde_enc->delayed_off_work,