diff options
author | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2022-04-19 18:53:42 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dmitry.baryshkov@linaro.org> | 2022-04-26 00:50:46 +0300 |
commit | e1072257ff6544ac13e59d41d5fa1f2d3a98c63a (patch) | |
tree | fc1626689ab4a66ff8cf9b566e4a138ed869ac34 /drivers/gpu/drm/msm/msm_drv.c | |
parent | 87729e2a7871564ca219132fb658113d10a33180 (diff) |
drm/msm: remove extra indirection for msm_mdss
Since now there is just one mdss subdriver, drop all the indirection,
make msm_mdss struct completely opaque (and defined inside msm_mdss.c)
and call mdss functions directly.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/482505/
Link: https://lore.kernel.org/r/20220419155346.1272627-3-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 3869209f0e2f..8230de602667 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1001,8 +1001,8 @@ static int __maybe_unused msm_runtime_suspend(struct device *dev) DBG(""); - if (mdss && mdss->funcs) - return mdss->funcs->disable(mdss); + if (mdss) + return msm_mdss_disable(mdss); return 0; } @@ -1014,8 +1014,8 @@ static int __maybe_unused msm_runtime_resume(struct device *dev) DBG(""); - if (mdss && mdss->funcs) - return mdss->funcs->enable(mdss); + if (mdss) + return msm_mdss_enable(mdss); return 0; } @@ -1241,6 +1241,7 @@ static const struct component_master_ops msm_drm_ops = { static int msm_pdev_probe(struct platform_device *pdev) { struct component_match *match = NULL; + struct msm_mdss *mdss; struct msm_drm_private *priv; int ret; @@ -1252,20 +1253,22 @@ static int msm_pdev_probe(struct platform_device *pdev) switch (get_mdp_ver(pdev)) { case KMS_MDP5: - ret = msm_mdss_init(pdev, true); + mdss = msm_mdss_init(pdev, true); break; case KMS_DPU: - ret = msm_mdss_init(pdev, false); + mdss = msm_mdss_init(pdev, false); break; default: - ret = 0; + mdss = NULL; break; } - if (ret) { - platform_set_drvdata(pdev, NULL); + if (IS_ERR(mdss)) { + ret = PTR_ERR(mdss); return ret; } + priv->mdss = mdss; + if (get_mdp_ver(pdev)) { ret = add_display_components(pdev, &match); if (ret) @@ -1292,8 +1295,8 @@ static int msm_pdev_probe(struct platform_device *pdev) fail: of_platform_depopulate(&pdev->dev); - if (priv->mdss && priv->mdss->funcs) - priv->mdss->funcs->destroy(priv->mdss); + if (priv->mdss) + msm_mdss_destroy(priv->mdss); return ret; } @@ -1306,8 +1309,8 @@ static int msm_pdev_remove(struct platform_device *pdev) component_master_del(&pdev->dev, &msm_drm_ops); of_platform_depopulate(&pdev->dev); - if (mdss && mdss->funcs) - mdss->funcs->destroy(mdss); + if (mdss) + msm_mdss_destroy(mdss); return 0; } |