From f6cfe46a3cfee0d640bd631d7cd04f3cbe277c95 Mon Sep 17 00:00:00 2001 From: Steve Cohen Date: Tue, 10 Nov 2020 14:45:45 -0500 Subject: [PATCH] Revert "disp: msm: sde: fix race between disable commit and vblank work" This is a partial revert of commit: 31dd25c623babc9b53d70e028c6499ed4673d227. The enc->crtc link cannot be relied upon outside of the display thread context since the DRM legacy modeset API will detach and re-attach this connection on every commit. The logic to flush the event thread in all cases during the CRTC disable is kept from the original patch. Change-Id: I2cd4ae47589bb397c72de0e9deba9b0c710d379a Signed-off-by: Steve Cohen --- msm/sde/sde_crtc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index 44a48041d6..8c8aa250b8 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -3850,10 +3850,8 @@ static int _sde_crtc_vblank_enable_no_lock( if (ret < 0) return ret; - drm_for_each_encoder(enc, crtc->dev) { - if (enc->crtc != crtc) - continue; - + drm_for_each_encoder_mask(enc, crtc->dev, + crtc->state->encoder_mask) { SDE_EVT32(DRMID(&sde_crtc->base), DRMID(enc), enable, sde_crtc->enabled); @@ -3861,10 +3859,8 @@ static int _sde_crtc_vblank_enable_no_lock( sde_crtc_vblank_cb, (void *)crtc); } } else { - drm_for_each_encoder(enc, crtc->dev) { - if (enc->crtc != crtc) - continue; - + drm_for_each_encoder_mask(enc, crtc->dev, + crtc->state->encoder_mask) { SDE_EVT32(DRMID(&sde_crtc->base), DRMID(enc), enable, sde_crtc->enabled);