drm/msm/sde: Skip heavy autorefresh checks when it's not enabled

These heavy checks for seeing if autorefresh is enabled are unneeded
when the autorefresh config is disabled. These checks are performed on
every display commit and show up as using a significant amount of CPU
time in perf top. Skip them when it's unnecessary in order to improve
display rendering performance.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
This commit is contained in:
Sultan Alsawaf 2021-01-25 23:37:56 -08:00 committed by spakkkk
parent ee675ad54d
commit eb696e16c7

View File

@ -1181,12 +1181,20 @@ static void sde_encoder_phys_cmd_enable(struct sde_encoder_phys *phys_enc)
static bool sde_encoder_phys_cmd_is_autorefresh_enabled( static bool sde_encoder_phys_cmd_is_autorefresh_enabled(
struct sde_encoder_phys *phys_enc) struct sde_encoder_phys *phys_enc)
{ {
struct sde_encoder_phys_cmd *cmd_enc;
struct sde_hw_pingpong *hw_pp; struct sde_hw_pingpong *hw_pp;
struct sde_hw_intf *hw_intf; struct sde_hw_intf *hw_intf;
struct sde_hw_autorefresh cfg; struct sde_hw_autorefresh cfg;
int ret; int ret;
if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_intf) if (!phys_enc)
return false;
cmd_enc = to_sde_encoder_phys_cmd(phys_enc);
if (!cmd_enc->autorefresh.cfg.enable)
return false;
if (!phys_enc->hw_pp || !phys_enc->hw_intf)
return false; return false;
if (!sde_encoder_phys_cmd_is_master(phys_enc)) if (!sde_encoder_phys_cmd_is_master(phys_enc))