diff mbox series

[05/21] drm/msm/dpu: polish log for resource allocation

Message ID 20240829-sm8650-v6-11-hmd-pocf-mdss-quad-upstream-8-v1-5-bdb05b4b5a2e@linaro.org (mailing list archive)
State New, archived
Headers show
Series drm/msm: Support quad pipe with dual-DSI | expand

Commit Message

Jun Nie Aug. 29, 2024, 10:17 a.m. UTC
Add resource allocation type info.

Signed-off-by: Jun Nie <jun.nie@linaro.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

Comments

Dmitry Baryshkov Aug. 29, 2024, 11:05 a.m. UTC | #1
On Thu, 29 Aug 2024 at 13:19, Jun Nie <jun.nie@linaro.org> wrote:
>
> Add resource allocation type info.
>
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 23 +++++++++++++++++++----
>  1 file changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> index 15b42a6683639..e219d706610c2 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> @@ -778,6 +778,21 @@ void dpu_rm_release_all_sspp(struct dpu_global_state *global_state,
>                 ARRAY_SIZE(global_state->sspp_to_crtc_id), crtc_id);
>  }
>
> +static char *dpu_hw_blk_type_name[] = {
> +       [DPU_HW_BLK_TOP] = "blk_top",
> +       [DPU_HW_BLK_SSPP] = "blk_sspp",
> +       [DPU_HW_BLK_LM] = "blk_lm",
> +       [DPU_HW_BLK_CTL] = "blk_ctl",
> +       [DPU_HW_BLK_PINGPONG] = "blk_pingpong",
> +       [DPU_HW_BLK_INTF] = "blk_intf",
> +       [DPU_HW_BLK_WB] = "blk_wb",
> +       [DPU_HW_BLK_DSPP] = "blk_dspp",
> +       [DPU_HW_BLK_MERGE_3D] = "blk_merge_3d",
> +       [DPU_HW_BLK_DSC] = "blk_dsc",
> +       [DPU_HW_BLK_CDM] = "blk_cdm",

Drop blk_, upcase all abbreviations.

> +       [DPU_HW_BLK_MAX] = "blk_none",
> +};
> +
>  int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
>         struct dpu_global_state *global_state, uint32_t enc_id,
>         enum dpu_hw_blk_type type, struct dpu_hw_blk **blks, int blks_size)
> @@ -828,13 +843,13 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
>                         continue;
>
>                 if (num_blks == blks_size) {
> -                       DPU_ERROR("More than %d resources assigned to enc %d\n",
> -                                 blks_size, enc_id);
> +                       DPU_ERROR("More than %d %s assigned to enc %d\n",
> +                                 blks_size, dpu_hw_blk_type_name[type], enc_id);
>                         break;
>                 }
>                 if (!hw_blks[i]) {
> -                       DPU_ERROR("Allocated resource %d unavailable to assign to enc %d\n",
> -                                 type, enc_id);
> +                       DPU_ERROR("%s unavailable to assign to enc %d\n",
> +                                 dpu_hw_blk_type_name[type], enc_id);
>                         break;
>                 }
>                 blks[num_blks++] = hw_blks[i];
>
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 15b42a6683639..e219d706610c2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -778,6 +778,21 @@  void dpu_rm_release_all_sspp(struct dpu_global_state *global_state,
 		ARRAY_SIZE(global_state->sspp_to_crtc_id), crtc_id);
 }
 
+static char *dpu_hw_blk_type_name[] = {
+	[DPU_HW_BLK_TOP] = "blk_top",
+	[DPU_HW_BLK_SSPP] = "blk_sspp",
+	[DPU_HW_BLK_LM] = "blk_lm",
+	[DPU_HW_BLK_CTL] = "blk_ctl",
+	[DPU_HW_BLK_PINGPONG] = "blk_pingpong",
+	[DPU_HW_BLK_INTF] = "blk_intf",
+	[DPU_HW_BLK_WB] = "blk_wb",
+	[DPU_HW_BLK_DSPP] = "blk_dspp",
+	[DPU_HW_BLK_MERGE_3D] = "blk_merge_3d",
+	[DPU_HW_BLK_DSC] = "blk_dsc",
+	[DPU_HW_BLK_CDM] = "blk_cdm",
+	[DPU_HW_BLK_MAX] = "blk_none",
+};
+
 int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
 	struct dpu_global_state *global_state, uint32_t enc_id,
 	enum dpu_hw_blk_type type, struct dpu_hw_blk **blks, int blks_size)
@@ -828,13 +843,13 @@  int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
 			continue;
 
 		if (num_blks == blks_size) {
-			DPU_ERROR("More than %d resources assigned to enc %d\n",
-				  blks_size, enc_id);
+			DPU_ERROR("More than %d %s assigned to enc %d\n",
+				  blks_size, dpu_hw_blk_type_name[type], enc_id);
 			break;
 		}
 		if (!hw_blks[i]) {
-			DPU_ERROR("Allocated resource %d unavailable to assign to enc %d\n",
-				  type, enc_id);
+			DPU_ERROR("%s unavailable to assign to enc %d\n",
+				  dpu_hw_blk_type_name[type], enc_id);
 			break;
 		}
 		blks[num_blks++] = hw_blks[i];