Skip to contentSkip to conversation

drm/msm: stop storing the array of CRTCs in struct msm_drm_private

PATCH Applied Dmitry Baryshkov 2 participants 3 messages May 19, 2023 – Jul 11, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v7 1/1 drm/msm: stop storing the array of CRTCs in struct msm_drm_private

The array of CRTC in the struct msm_drm_private duplicates a list of CRTCs in the drm_device. Drop it and use the existing list for CRTC enumeration.

---
This was a part of https://patchwork.freedesktop.org/series/105302/

Changes since v6:
- Dropped applied patches
- Dropped msm_drm_thread::crtc as suggested by Abhinav

---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  |  2 +-
 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c |  2 +-
 drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c |  2 +-
 drivers/gpu/drm/msm/msm_drv.c            | 42 ++++++++++++------------
 drivers/gpu/drm/msm/msm_drv.h            |  2 --
 5 files changed, 24 insertions(+), 26 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +1 -1
index 0e7a68714e9e..5073f8d60e2f 100644
@@ -773,7 +773,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
 			ret = PTR_ERR(crtc);
 			return ret;
 		}
-		priv->crtcs[priv->num_crtcs++] = crtc;
+		priv->num_crtcs++;
 	}
 
 	/* All CRTCs are compatible with all encoders */
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c +1 -1
index 6e37072ed302..b6201ae5b42e 100644
@@ -332,7 +332,7 @@ static int modeset_init(struct mdp4_kms *mdp4_kms)
 			goto fail;
 		}
 
-		priv->crtcs[priv->num_crtcs++] = crtc;
+		priv->num_crtcs++;
 	}
 
 	/*
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c +1 -1
index 29ae5c9613f3..c1aab7e1a890 100644
@@ -497,7 +497,7 @@ static int modeset_init(struct mdp5_kms *mdp5_kms)
 			DRM_DEV_ERROR(dev->dev, "failed to construct crtc %d (%d)\n", i, ret);
 			goto fail;
 		}
-		priv->crtcs[priv->num_crtcs++] = crtc;
+		priv->num_crtcs++;
 	}
 
 	/*
drivers/gpu/drm/msm/msm_drv.c +21 -21

102 lines not on this page · raw message

drivers/gpu/drm/msm/msm_drv.h +0 -2
index e13a8cbd61c9..5d56ca99c1c5 100644
@@ -97,7 +97,6 @@ struct msm_display_topology {
 /* Commit/Event thread specific structure */
 struct msm_drm_thread {
 	struct drm_device *dev;
-	unsigned int crtc_id;
 	struct kthread_worker *worker;
 };
 
@@ -198,7 +197,6 @@ struct msm_drm_private {
 	struct workqueue_struct *wq;
 
 	unsigned int num_crtcs;
-	struct drm_crtc *crtcs[MAX_CRTCS];
 
 	struct msm_drm_thread event_thread[MAX_CRTCS];
 
Signature · 1 line
2.39.2
Reviewed-by on v7 1/1
#1 lore raw
Quoted 5 lines · Dmitry Baryshkov

The array of CRTC in the struct msm_drm_private duplicates a list of CRTCs in the drm_device. Drop it and use the existing list for CRTC enumeration.

Quoted 8 lines

---
This was a part of https://patchwork.freedesktop.org/series/105302/

Changes since v6:
- Dropped applied patches
- Dropped msm_drm_thread::crtc as suggested by Abhinav

---