Commit 745b5158 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov

drm/msm/dpu: remove manual destruction of DRM objects

Remove manual removal of DRM modesetting objects, it is done anyway by
the drm_mode_config_cleanup() called from msm_drm_uninit(). Other
MSM display drivers (MDP4, MDP5) do not manually destroy objects and
trust generic code to do it's work.
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/480943/
Link: https://lore.kernel.org/r/20220406101247.483649-2-dmitry.baryshkov@linaro.orgSigned-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
parent d28ea556
...@@ -679,30 +679,6 @@ static int _dpu_kms_setup_displays(struct drm_device *dev, ...@@ -679,30 +679,6 @@ static int _dpu_kms_setup_displays(struct drm_device *dev,
return rc; return rc;
} }
static void _dpu_kms_drm_obj_destroy(struct dpu_kms *dpu_kms)
{
struct msm_drm_private *priv;
int i;
priv = dpu_kms->dev->dev_private;
for (i = 0; i < priv->num_crtcs; i++)
priv->crtcs[i]->funcs->destroy(priv->crtcs[i]);
priv->num_crtcs = 0;
for (i = 0; i < priv->num_planes; i++)
priv->planes[i]->funcs->destroy(priv->planes[i]);
priv->num_planes = 0;
for (i = 0; i < priv->num_connectors; i++)
priv->connectors[i]->funcs->destroy(priv->connectors[i]);
priv->num_connectors = 0;
for (i = 0; i < priv->num_encoders; i++)
priv->encoders[i]->funcs->destroy(priv->encoders[i]);
priv->num_encoders = 0;
}
static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
{ {
struct drm_device *dev; struct drm_device *dev;
...@@ -725,7 +701,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ...@@ -725,7 +701,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
*/ */
ret = _dpu_kms_setup_displays(dev, priv, dpu_kms); ret = _dpu_kms_setup_displays(dev, priv, dpu_kms);
if (ret) if (ret)
goto fail; return ret;
max_crtc_count = min(catalog->mixer_count, priv->num_encoders); max_crtc_count = min(catalog->mixer_count, priv->num_encoders);
...@@ -750,7 +726,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ...@@ -750,7 +726,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
if (IS_ERR(plane)) { if (IS_ERR(plane)) {
DPU_ERROR("dpu_plane_init failed\n"); DPU_ERROR("dpu_plane_init failed\n");
ret = PTR_ERR(plane); ret = PTR_ERR(plane);
goto fail; return ret;
} }
priv->planes[priv->num_planes++] = plane; priv->planes[priv->num_planes++] = plane;
...@@ -767,7 +743,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ...@@ -767,7 +743,7 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]); crtc = dpu_crtc_init(dev, primary_planes[i], cursor_planes[i]);
if (IS_ERR(crtc)) { if (IS_ERR(crtc)) {
ret = PTR_ERR(crtc); ret = PTR_ERR(crtc);
goto fail; return ret;
} }
priv->crtcs[priv->num_crtcs++] = crtc; priv->crtcs[priv->num_crtcs++] = crtc;
} }
...@@ -777,9 +753,6 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms) ...@@ -777,9 +753,6 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
priv->encoders[i]->possible_crtcs = (1 << priv->num_crtcs) - 1; priv->encoders[i]->possible_crtcs = (1 << priv->num_crtcs) - 1;
return 0; return 0;
fail:
_dpu_kms_drm_obj_destroy(dpu_kms);
return ret;
} }
static void _dpu_kms_hw_destroy(struct dpu_kms *dpu_kms) static void _dpu_kms_hw_destroy(struct dpu_kms *dpu_kms)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment