diff mbox series

[17/17] drm/msm: drop mdp_get_formats()

Message ID 20230708010407.3871346-18-dmitry.baryshkov@linaro.org
State New
Headers show
Series drm/msm/mdp[45]: use managed memory allocations | expand

Commit Message

Dmitry Baryshkov July 8, 2023, 1:04 a.m. UTC
Drop the function mdp_get_formats(), which became unused after
converting both MDP4 and MDP5 planes to use static formats arrays.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/disp/mdp_format.c | 24 ------------------------
 drivers/gpu/drm/msm/disp/mdp_kms.h    |  1 -
 2 files changed, 25 deletions(-)

Comments

Abhinav Kumar Dec. 2, 2023, 1:25 a.m. UTC | #1
On 7/7/2023 6:04 PM, Dmitry Baryshkov wrote:
> Drop the function mdp_get_formats(), which became unused after
> converting both MDP4 and MDP5 planes to use static formats arrays.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/msm/disp/mdp_format.c | 24 ------------------------
>   drivers/gpu/drm/msm/disp/mdp_kms.h    |  1 -
>   2 files changed, 25 deletions(-)
> 

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Abhinav Kumar Dec. 2, 2023, 1:33 a.m. UTC | #2
On 12/1/2023 5:25 PM, Abhinav Kumar wrote:
> 
> 
> On 7/7/2023 6:04 PM, Dmitry Baryshkov wrote:
>> Drop the function mdp_get_formats(), which became unused after
>> converting both MDP4 and MDP5 planes to use static formats arrays.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
>>   drivers/gpu/drm/msm/disp/mdp_format.c | 24 ------------------------
>>   drivers/gpu/drm/msm/disp/mdp_kms.h    |  1 -
>>   2 files changed, 25 deletions(-)
>>
> 
> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Actually, I have one concern with patch 1 and patch 17 of this series.

You cannot get rid of static const struct mdp_format formats[] because 
mdp_get_format() still uses it.

Now, we end up having to maintain two arrays to hold the formats, the 
already existing formats[] one and newly added  mdp_rgb_formats[] and 
mdp_rgb_yuv_formats[].

This is an overkill.

I am fine with overall migrating to drmm-managed APIs but I think patch 
1 and this one are not necessary.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/mdp_format.c b/drivers/gpu/drm/msm/disp/mdp_format.c
index ba9abe8b3acc..0fe430af9523 100644
--- a/drivers/gpu/drm/msm/disp/mdp_format.c
+++ b/drivers/gpu/drm/msm/disp/mdp_format.c
@@ -183,30 +183,6 @@  const uint32_t mdp_rgb_yuv_formats[] = {
 
 size_t mdp_rgb_yuv_num_formats = ARRAY_SIZE(mdp_rgb_yuv_formats);
 
-/*
- * Note:
- * @rgb_only must be set to true, when requesting
- * supported formats for RGB pipes.
- */
-uint32_t mdp_get_formats(uint32_t *pixel_formats, uint32_t max_formats,
-		bool rgb_only)
-{
-	uint32_t i;
-	for (i = 0; i < ARRAY_SIZE(formats); i++) {
-		const struct mdp_format *f = &formats[i];
-
-		if (i == max_formats)
-			break;
-
-		if (rgb_only && MDP_FORMAT_IS_YUV(f))
-			break;
-
-		pixel_formats[i] = f->base.pixel_format;
-	}
-
-	return i;
-}
-
 const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format,
 		uint64_t modifier)
 {
diff --git a/drivers/gpu/drm/msm/disp/mdp_kms.h b/drivers/gpu/drm/msm/disp/mdp_kms.h
index 11402a859574..1b2ccf7e7de6 100644
--- a/drivers/gpu/drm/msm/disp/mdp_kms.h
+++ b/drivers/gpu/drm/msm/disp/mdp_kms.h
@@ -91,7 +91,6 @@  struct mdp_format {
 #define to_mdp_format(x) container_of(x, struct mdp_format, base)
 #define MDP_FORMAT_IS_YUV(mdp_format) ((mdp_format)->is_yuv)
 
-uint32_t mdp_get_formats(uint32_t *formats, uint32_t max_formats, bool rgb_only);
 const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format, uint64_t modifier);
 
 extern const uint32_t mdp_rgb_formats[];