drm/msm/dpu: bail from _dpu_core_perf_crtc_update_bus if there are no ICC paths
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 30 Jul 2023 01:00:54 +0000 (04:00 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 2 Aug 2023 09:39:26 +0000 (12:39 +0300)
Skip bandwidth aggregation and return early if there are no interconnect
paths defined for the DPU device.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/550195/
Link: https://lore.kernel.org/r/20230730010102.350713-3-dmitry.baryshkov@linaro.org
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c

index 1d9d83d..3dbd730 100644 (file)
@@ -217,6 +217,9 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
        int i, ret = 0;
        u64 avg_bw;
 
+       if (!kms->num_paths)
+               return 0;
+
        drm_for_each_crtc(tmp_crtc, crtc->dev) {
                if (tmp_crtc->enabled &&
                        curr_client_type ==
@@ -234,9 +237,6 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,
                }
        }
 
-       if (!kms->num_paths)
-               return 0;
-
        avg_bw = perf.bw_ctl;
        do_div(avg_bw, (kms->num_paths * 1000)); /*Bps_to_icc*/