disp: msm: sde: avoid mixer op setup for virtual LM

This change sets a flag to true if a mixer is a virtual mixer.
Virtual mixers will skip setting up mixer ops and debug register
dumps as their range is not valid. Since mixer ops are no longer
guaranteed to be set, add null checks before using these ops.

Change-Id: Idfe7e1e2b893dadbbe6756d69d0c4ca4fa6ae4ce
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Esse commit está contido em:
Samantha Tran
2021-04-16 17:30:45 -07:00
commit de Gerrit - the friendly Code Review server
commit ef2525e0cc
4 arquivos alterados com 24 adições e 16 exclusões

Ver arquivo

@@ -641,8 +641,9 @@ static void _sde_crtc_setup_blend_cfg(struct sde_crtc_mixer *mixer,
break;
}
lm->ops.setup_blend_config(lm, pstate->stage, fg_alpha,
bg_alpha, blend_op);
if (lm->ops.setup_blend_config)
lm->ops.setup_blend_config(lm, pstate->stage, fg_alpha, bg_alpha, blend_op);
SDE_DEBUG(
"format: %4.4s, alpha_enable %u fg alpha:0x%x bg alpha:0x%x blend_op:0x%x\n",
(char *) &format->base.pixel_format,
@@ -1284,7 +1285,8 @@ static void _sde_crtc_program_lm_output_roi(struct drm_crtc *crtc)
cfg.right_mixer = right_mixer;
cfg.flags = 0;
hw_lm->ops.setup_mixer_out(hw_lm, &cfg);
if (hw_lm->ops.setup_mixer_out)
hw_lm->ops.setup_mixer_out(hw_lm, &cfg);
lm_updated = true;
}
@@ -1828,7 +1830,8 @@ static void _sde_crtc_blend_setup(struct drm_crtc *crtc,
if (sde_kms_rect_is_null(lm_roi))
sde_crtc->mixers[i].mixer_op_mode = 0;
lm->ops.setup_alpha_out(lm, mixer[i].mixer_op_mode);
if (lm->ops.setup_alpha_out)
lm->ops.setup_alpha_out(lm, mixer[i].mixer_op_mode);
/* stage config flush mask */
ctl->ops.update_bitmask_mixer(ctl, mixer[i].hw_lm->idx, 1);
@@ -6457,24 +6460,22 @@ static ssize_t _sde_crtc_misr_read(struct file *file,
m = &sde_crtc->mixers[i];
if (!m->hw_lm || !m->hw_lm->ops.collect_misr) {
len += scnprintf(buf + len, MISR_BUFF_SIZE - len,
"invalid\n");
SDE_ERROR("crtc:%d invalid misr ops\n", DRMID(crtc));
if (!m->hw_lm || !m->hw_lm->cap->dummy_mixer) {
len += scnprintf(buf + len, MISR_BUFF_SIZE - len, "invalid\n");
SDE_ERROR("crtc:%d invalid misr ops\n", DRMID(crtc));
}
continue;
}
rc = m->hw_lm->ops.collect_misr(m->hw_lm, false, &misr_value);
if (rc) {
len += scnprintf(buf + len, MISR_BUFF_SIZE - len,
"invalid\n");
SDE_ERROR("crtc:%d failed to collect misr %d\n",
DRMID(crtc), rc);
len += scnprintf(buf + len, MISR_BUFF_SIZE - len, "invalid\n");
SDE_ERROR("crtc:%d failed to collect misr %d\n", DRMID(crtc), rc);
continue;
} else {
len += scnprintf(buf + len, MISR_BUFF_SIZE - len,
"lm idx:%d\n", m->hw_lm->idx - LM_0);
len += scnprintf(buf + len, MISR_BUFF_SIZE - len,
"0x%x\n", misr_value);
len += scnprintf(buf + len, MISR_BUFF_SIZE - len, "0x%x\n", misr_value);
}
}