disp: msm: sde: disable CWB in quad pipe
Disable CWB in quad pipe for quad LM CWB not supported to avoid out of bound access. Change-Id: I0348a7fa318b9fa9886d35d5e233d81c8135d2ee Signed-off-by: GG Hou <quic_renjhou@quicinc.com> Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
This commit is contained in:
@@ -567,6 +567,13 @@ static void _sde_encoder_phys_wb_setup_cwb(struct sde_encoder_phys *phys_enc, bo
|
||||
return;
|
||||
}
|
||||
|
||||
if (crtc->num_mixers > MAX_CWB_PER_CTL_V1) {
|
||||
SDE_ERROR("[enc:%d wb:%d] %d LM %d CWB case not supported\n",
|
||||
DRMID(phys_enc->parent), WBID(wb_enc),
|
||||
crtc->num_mixers, MAX_CWB_PER_CTL_V1);
|
||||
return;
|
||||
}
|
||||
|
||||
hw_ctl = crtc->mixers[0].hw_ctl;
|
||||
if (hw_ctl && hw_ctl->ops.setup_intf_cfg_v1 &&
|
||||
(test_bit(SDE_WB_CWB_CTRL, &hw_wb->caps->features) ||
|
||||
@@ -865,7 +872,7 @@ static int _sde_enc_phys_wb_validate_cwb(struct sde_encoder_phys *phys_enc,
|
||||
struct sde_rect wb_roi = {0,}, pu_roi = {0,};
|
||||
u32 out_width = 0, out_height = 0;
|
||||
const struct sde_format *fmt;
|
||||
int prog_line, ret = 0;
|
||||
int num_lm, prog_line, ret = 0;
|
||||
|
||||
fb = sde_wb_connector_state_get_output_fb(conn_state);
|
||||
if (!fb) {
|
||||
@@ -873,6 +880,12 @@ static int _sde_enc_phys_wb_validate_cwb(struct sde_encoder_phys *phys_enc,
|
||||
return 0;
|
||||
}
|
||||
|
||||
num_lm = sde_crtc_get_num_datapath(crtc_state->crtc, conn_state->connector, crtc_state);
|
||||
if (num_lm > MAX_CWB_PER_CTL_V1) {
|
||||
SDE_ERROR("%d LM %d CWB case not supported\n", num_lm, MAX_CWB_PER_CTL_V1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
fmt = sde_get_sde_format_ext(fb->format->format, fb->modifier);
|
||||
if (!fmt) {
|
||||
SDE_ERROR("unsupported output pixel format:%x\n", fb->format->format);
|
||||
|
||||
Reference in New Issue
Block a user