disp: msm: sde: fix null check for encoder dsc disable

There are some scenarios where connectors can be
null during encoder dsc disable. Update the null
check to avoid error message during these scenarios.

Change-Id: I598a644f19aecf0b7d8c989a75575329903678dd
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
This commit is contained in:
Krishna Manikandan
2020-04-16 10:20:04 +05:30
committed by Gerrit - the friendly Code Review server
parent 528f0862c9
commit 8dd8a0f1bb

View File

@@ -703,13 +703,19 @@ static void _dce_dsc_disable(struct sde_encoder_virt *sde_enc)
struct sde_hw_ctl *hw_ctl = NULL;
struct sde_hw_intf_cfg_v1 cfg;
if (!sde_enc || !sde_enc->phys_encs[0] ||
!sde_enc->phys_encs[0]->connector) {
if (!sde_enc || !sde_enc->phys_encs[0]) {
SDE_ERROR("invalid params %d %d\n",
!sde_enc, sde_enc ? !sde_enc->phys_encs[0] : -1);
return;
}
/*
* Connector can be null if the first virt modeset after suspend
* is called with dynamic clock or dms enabled.
*/
if (!sde_enc->phys_encs[0]->connector)
return;
if (sde_enc->cur_master)
hw_ctl = sde_enc->cur_master->hw_ctl;