On Fri, 12 Jul 2024 at 22:41, Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx> wrote: > On 6/24/2024 2:13 PM, Dmitry Baryshkov wrote: > > The commit b954fa6baaca ("drm/msm/dpu: Refactor rm iterator") removed > > zero-init of the hw_ctl array, but didn't change the error condition, > > that checked for hw_ctl[i] being NULL. Use indices check instead. > > > > Fixes: b954fa6baaca ("drm/msm/dpu: Refactor rm iterator") > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> > > --- > > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > > index 5d205e09cf45..7613005fbfea 100644 > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > > @@ -1186,7 +1186,7 @@ static void :tag(struct drm_encoder *drm_enc, > > return; > > } > > > > - if (!hw_ctl[i]) { > > + if (i >= num_ctl) { > > This is not very clear to me. > > How will we hit this condition? I dont see i going beyond 1 in this loop > and neither should num_ctl Why? the driver doesn't support flushing through a single CTL, so num_ctl = num_intf. > > Will it be just easier to bring back the NULL assignment at the top? > > struct dpu_hw_blk *hw_ctl[MAX_CHANNELS_PER_ENC] = { NULL }; > > I also see the same issue for other blocks such as hw_dsc, hw_lm Other blocks loop properly up to the num_resource. I'd prefer to drop the NULL init from the DSPP init and use num_dspp instead. > > > DPU_ERROR_ENC(dpu_enc, > > "no ctl block assigned at idx: %d\n", i); > > return; > > -- With best wishes Dmitry