disp: msm: sde: remove clearing cur_master in encoder enable function
SDE IRQ callback can run in parallel thread to modeset after removing pp_done wait before pre_modeset. If cur_master is cleared in encoder enable function and irq callback is triggered at the same time, the irq callback could not be handled properly as cur_master is NULL. So remove clearing cur_master in encoder enable function to avoid the race condition between modeset and irq callback. Change-Id: I2059c699a68838b3c9f6a7dd658a35f178b18c42 Signed-off-by: Lei Chen <chenlei@codeaurora.org>
This commit is contained in:
@@ -2970,6 +2970,7 @@ static void sde_encoder_off_work(struct kthread_work *work)
|
|||||||
static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
|
static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
|
||||||
{
|
{
|
||||||
struct sde_encoder_virt *sde_enc = NULL;
|
struct sde_encoder_virt *sde_enc = NULL;
|
||||||
|
bool has_master_enc = false;
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
struct sde_connector_state *c_state;
|
struct sde_connector_state *c_state;
|
||||||
struct drm_display_mode *cur_mode = NULL;
|
struct drm_display_mode *cur_mode = NULL;
|
||||||
@@ -2994,18 +2995,19 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
|
|||||||
SDE_DEBUG_ENC(sde_enc, "\n");
|
SDE_DEBUG_ENC(sde_enc, "\n");
|
||||||
SDE_EVT32(DRMID(drm_enc), cur_mode->hdisplay, cur_mode->vdisplay);
|
SDE_EVT32(DRMID(drm_enc), cur_mode->hdisplay, cur_mode->vdisplay);
|
||||||
|
|
||||||
sde_enc->cur_master = NULL;
|
|
||||||
for (i = 0; i < sde_enc->num_phys_encs; i++) {
|
for (i = 0; i < sde_enc->num_phys_encs; i++) {
|
||||||
struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
|
struct sde_encoder_phys *phys = sde_enc->phys_encs[i];
|
||||||
|
|
||||||
if (phys && phys->ops.is_master && phys->ops.is_master(phys)) {
|
if (phys && phys->ops.is_master && phys->ops.is_master(phys)) {
|
||||||
SDE_DEBUG_ENC(sde_enc, "master is now idx %d\n", i);
|
SDE_DEBUG_ENC(sde_enc, "master is now idx %d\n", i);
|
||||||
sde_enc->cur_master = phys;
|
sde_enc->cur_master = phys;
|
||||||
|
has_master_enc = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sde_enc->cur_master) {
|
if (!has_master_enc) {
|
||||||
|
sde_enc->cur_master = NULL;
|
||||||
SDE_ERROR("virt encoder has no master! num_phys %d\n", i);
|
SDE_ERROR("virt encoder has no master! num_phys %d\n", i);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user