disp: msm: sde: avoid tx wait during DMS for targets with dsc rev2

This change removes tx_wait during DMS for targets which have
dsc_hw_rev_2. For targets with dsc_hw_rev_1, during DMS the
tx_wait is needed since DSC registers are not double buffered
and frame trigger needs to be serialized to avoid pp_timeout
issues.

Change-Id: I46479ed8713602d167e57c9d9d0f800f544607f2
Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
This commit is contained in:
Jayaprakash Madisetty 2022-01-10 22:12:12 +05:30
commit ff90d96806
3 changed files with 40 additions and 0 deletions

View file

@ -1874,6 +1874,18 @@ static int _sde_encoder_rc_pre_modeset(struct drm_encoder *drm_enc,
sde_enc->rc_state = SDE_ENC_RC_STATE_ON;
}
if (sde_encoder_has_dsc_hw_rev_2(sde_enc))
goto skip_wait;
ret = sde_encoder_wait_for_event(drm_enc, MSM_ENC_TX_COMPLETE);
if (ret && ret != -EWOULDBLOCK) {
SDE_ERROR_ENC(sde_enc, "wait for commit done returned %d\n", ret);
SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state, ret, SDE_EVTLOG_ERROR);
ret = -EINVAL;
goto end;
}
skip_wait:
SDE_EVT32(DRMID(drm_enc), sw_event, sde_enc->rc_state,
SDE_ENC_RC_STATE_MODESET, SDE_EVTLOG_FUNC_CASE5);

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
*/
@ -913,6 +914,26 @@ void sde_encoder_dce_set_bpp(struct msm_mode_info mode_info,
sde_crtc->src_bpp, sde_crtc->target_bpp);
}
bool sde_encoder_has_dsc_hw_rev_2(struct sde_encoder_virt *sde_enc)
{
enum msm_display_compression_type comp_type;
int i;
if (!sde_enc)
return false;
comp_type = sde_enc->mode_info.comp_info.comp_type;
if (comp_type != MSM_DISPLAY_COMPRESSION_DSC)
return false;
for (i = 0; i < MAX_CHANNELS_PER_ENC; i++)
if (sde_enc->hw_dsc[i])
return test_bit(SDE_DSC_HW_REV_1_2, &sde_enc->hw_dsc[i]->caps->features);
return false;
}
void sde_encoder_dce_disable(struct sde_encoder_virt *sde_enc)
{
enum msm_display_compression_type comp_type;

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2016-2017, 2020 The Linux Foundation. All rights reserved.
*/
@ -36,4 +37,10 @@ int sde_encoder_dce_setup(struct sde_encoder_virt *sde_enc,
*/
void sde_encoder_dce_flush(struct sde_encoder_virt *sde_enc);
/**
* sde_encoder_has_dsc_hw_rev_2 :checks if dsc_hw_rev_1_2 feature is enabled
* @sde_enc: pointer to virtual encoder structure
*/
bool sde_encoder_has_dsc_hw_rev_2(struct sde_encoder_virt *sde_enc);
#endif /* __SDE_ENCODER_DCE_H__ */