disp: msm: sde: fix RM poll timeouts during PM suspend/resume usecase

When PM resume commit occurs with mode_changed, enable flag set and
active_changed flag not set, the RM reservation allocated is not cleared
during crtc_destroy_state as encoder_mask in old_crtc_state is NULL.
When there is resume commit from HAL, it polls for this pending reservation
to be cleared causing poll timeouts. This change releases the pending
reservation from the crtc->state->encoder mask, as the old_crtc_state
encoder_mask will be reset with default values at start of PM resume.

Change-Id: Ica1c90a6ea7ef7df08fcb976b6f1b54bbfeea357
Signed-off-by: Andhavarapu Karthik <quic_kartkart@quicinc.com>
This commit is contained in:
Andhavarapu Karthik 2022-01-10 12:33:39 +05:30
commit bcb9619f9f

View file

@ -1,4 +1,5 @@
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@ -3482,6 +3483,7 @@ static void sde_crtc_destroy_state(struct drm_crtc *crtc,
struct sde_crtc_state *cstate;
struct drm_encoder *enc;
struct sde_kms *sde_kms;
u32 encoder_mask;
if (!crtc || !state) {
SDE_ERROR("invalid argument(s)\n");
@ -3497,9 +3499,11 @@ static void sde_crtc_destroy_state(struct drm_crtc *crtc,
return;
}
SDE_DEBUG("crtc%d\n", crtc->base.id);
encoder_mask = state->encoder_mask ? state->encoder_mask :
crtc->state->encoder_mask;
SDE_DEBUG("crtc%d\n, encoder_mask=%d", crtc->base.id, encoder_mask);
drm_for_each_encoder_mask(enc, crtc->dev, state->encoder_mask)
drm_for_each_encoder_mask(enc, crtc->dev, encoder_mask)
sde_rm_release(&sde_kms->rm, enc, true);
__drm_atomic_helper_crtc_destroy_state(state);