@@ -498,7 +498,8 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms)
struct drm_crtc *crtc;
struct drm_plane *plane;
struct drm_encoder *encoder;
- int i;
+ struct drm_connector_list_iter conn_iter;
+ struct drm_connector *connector;
if (!dpu_kms) {
DPU_ERROR("invalid dpu_kms\n");
@@ -518,9 +519,10 @@ static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms)
drm_for_each_plane(plane, dpu_kms->dev)
plane->funcs->destroy(plane);
- for (i = 0; i < priv->num_connectors; i++)
- priv->connectors[i]->funcs->destroy(priv->connectors[i]);
- priv->num_connectors = 0;
+ drm_connector_list_iter_begin(dpu_kms->dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter)
+ connector->funcs->destroy(connector);
+ drm_connector_list_iter_end(&conn_iter);
drm_for_each_encoder(encoder, dpu_kms->dev)
encoder->funcs->destroy(encoder);
@@ -265,9 +265,6 @@ static int mdp4_modeset_init_intf(struct mdp4_kms *mdp4_kms,
DRM_DEV_ERROR(dev->dev, "failed to initialize LVDS connector\n");
return PTR_ERR(connector);
}
-
- priv->connectors[priv->num_connectors++] = connector;
-
break;
case DRM_MODE_ENCODER_TMDS:
encoder = mdp4_dtv_encoder_init(dev);
@@ -250,8 +250,6 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev,
goto fail;
}
- priv->connectors[priv->num_connectors++] = msm_dsi->connector;
-
return 0;
fail:
/* bridge/connector are normally destroyed by drm: */
@@ -148,7 +148,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
struct drm_encoder *encoder)
{
struct platform_device *pdev = edp->pdev;
- struct msm_drm_private *priv = dev->dev_private;
int ret;
edp->encoder = encoder;
@@ -188,8 +187,6 @@ int msm_edp_modeset_init(struct msm_edp *edp, struct drm_device *dev,
encoder->bridge = edp->bridge;
- priv->connectors[priv->num_connectors++] = edp->connector;
-
return 0;
fail:
@@ -291,7 +291,6 @@ static struct hdmi *msm_hdmi_init(struct platform_device *pdev)
int msm_hdmi_modeset_init(struct hdmi *hdmi,
struct drm_device *dev, struct drm_encoder *encoder)
{
- struct msm_drm_private *priv = dev->dev_private;
struct platform_device *pdev = hdmi->pdev;
int ret;
@@ -340,8 +339,6 @@ int msm_hdmi_modeset_init(struct hdmi *hdmi,
encoder->bridge = hdmi->bridge;
- priv->connectors[priv->num_connectors++] = hdmi->connector;
-
platform_set_drvdata(pdev, hdmi);
return 0;
@@ -194,9 +194,6 @@ struct msm_drm_private {
struct msm_drm_thread disp_thread[MAX_CRTCS];
struct msm_drm_thread event_thread[MAX_CRTCS];
- unsigned int num_connectors;
- struct drm_connector *connectors[MAX_CONNECTORS];
-
/* Properties */
struct drm_property *plane_property[PLANE_PROP_MAX_NUM];
@@ -174,7 +174,7 @@ struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev)
drm_fb_helper_prepare(dev, helper, &msm_fb_helper_funcs);
- ret = drm_fb_helper_init(dev, helper, priv->num_connectors);
+ ret = drm_fb_helper_init(dev, helper, dev->mode_config.num_connector);
if (ret) {
DRM_DEV_ERROR(dev->dev, "could not init fbdev: ret=%d\n", ret);
goto fail;