[bug report] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output
Dan Carpenter
dan.carpenter at linaro.org
Wed Jan 10 18:51:37 UTC 2024
Hello Abhinav Kumar,
This is a semi-automatic email about new static checker warnings.
The patch 8b45a26f2ba9: "drm/msm/dpu: reserve cdm blocks for
writeback in case of YUV output" from Dec 12, 2023, leads to the
following Smatch complaint:
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c:2084 dpu_encoder_helper_phys_cleanup()
warn: variable dereferenced before check 'phys_enc->hw_pp' (see line 2075)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
2074 /* reset the merge 3D HW block */
2075 if (phys_enc->hw_pp->merge_3d) {
^^^^^^^^^^^^^^^
The existing code assumed that phys_enc->hw_pp is vald.
2076 phys_enc->hw_pp->merge_3d->ops.setup_3d_mode(phys_enc->hw_pp->merge_3d,
2077 BLEND_3D_NONE);
2078 if (phys_enc->hw_ctl->ops.update_pending_flush_merge_3d)
2079 phys_enc->hw_ctl->ops.update_pending_flush_merge_3d(ctl,
2080 phys_enc->hw_pp->merge_3d->idx);
2081 }
2082
2083 if (phys_enc->hw_cdm) {
2084 if (phys_enc->hw_cdm->ops.bind_pingpong_blk && phys_enc->hw_pp)
^^^^^^^^^^^^^^^
But the patch assumes it can be NULL.
2085 phys_enc->hw_cdm->ops.bind_pingpong_blk(phys_enc->hw_cdm,
2086 PINGPONG_NONE);
regards,
dan carpenter
More information about the Freedreno
mailing list