summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_mdss.c
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2022-04-19 18:53:46 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2022-04-26 00:50:46 +0300
commit6874f48bb8b050b695698f1145e6846ba08baa75 (patch)
tree9df7bf6ea24b6573c3303e901dc52f15543ee161 /drivers/gpu/drm/msm/msm_mdss.c
parentdc43e923cd1478fad5ec7a2bbb67dc3d00c24f84 (diff)
downloadlwn-6874f48bb8b050b695698f1145e6846ba08baa75.tar.gz
lwn-6874f48bb8b050b695698f1145e6846ba08baa75.zip
drm/msm: make mdp5/dpu devices master components
The msm_mdss serves several roles at this moment. It provides IRQ domain used by MDP5 and DPU drivers but it also serves as a component master for both those usecases. MDP4 (which does not have separate MDSS device) is the component master on it's own. Remove this assymmetry and make both MDP5 and DPU component masters too. This removes a need to care about drm/components from msm_mdss driver, removes an mdss pointer from struct msm_drm_private and simplifies the interface between mdp5/dpu and msm_drv. Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/482512/ Link: https://lore.kernel.org/r/20220419155346.1272627-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_mdss.c')
-rw-r--r--drivers/gpu/drm/msm/msm_mdss.c67
1 files changed, 8 insertions, 59 deletions
diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c
index 0af86fc1a130..f6f0d0fa5ab2 100644
--- a/drivers/gpu/drm/msm/msm_mdss.c
+++ b/drivers/gpu/drm/msm/msm_mdss.c
@@ -270,20 +270,20 @@ static struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5
static int __maybe_unused mdss_runtime_suspend(struct device *dev)
{
- struct msm_drm_private *priv = dev_get_drvdata(dev);
+ struct msm_mdss *mdss = dev_get_drvdata(dev);
DBG("");
- return msm_mdss_disable(priv->mdss);
+ return msm_mdss_disable(mdss);
}
static int __maybe_unused mdss_runtime_resume(struct device *dev)
{
- struct msm_drm_private *priv = dev_get_drvdata(dev);
+ struct msm_mdss *mdss = dev_get_drvdata(dev);
DBG("");
- return msm_mdss_enable(priv->mdss);
+ return msm_mdss_enable(mdss);
}
static int __maybe_unused mdss_pm_suspend(struct device *dev)
@@ -306,31 +306,12 @@ static int __maybe_unused mdss_pm_resume(struct device *dev)
static const struct dev_pm_ops mdss_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mdss_pm_suspend, mdss_pm_resume)
SET_RUNTIME_PM_OPS(mdss_runtime_suspend, mdss_runtime_resume, NULL)
- .prepare = msm_pm_prepare,
- .complete = msm_pm_complete,
};
-static int find_mdp_node(struct device *dev, void *data)
-{
-#ifdef CONFIG_DRM_MSM_DPU
- if (of_match_node(dpu_dt_match, dev->of_node))
- return true;
-#endif
-
-#ifdef CONFIG_DRM_MSM_MDP5
- if (of_match_node(mdp5_dt_match, dev->of_node))
- return true;
-#endif
-
- return false;
-}
-
static int mdss_probe(struct platform_device *pdev)
{
struct msm_mdss *mdss;
- struct msm_drm_private *priv;
bool is_mdp5 = of_device_is_compatible(pdev->dev.of_node, "qcom,mdss");
- struct device *mdp_dev;
struct device *dev = &pdev->dev;
int ret;
@@ -338,14 +319,7 @@ static int mdss_probe(struct platform_device *pdev)
if (IS_ERR(mdss))
return PTR_ERR(mdss);
- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- ret = -ENOMEM;
- goto fail;
- }
-
- priv->mdss = mdss;
- platform_set_drvdata(pdev, priv);
+ platform_set_drvdata(pdev, mdss);
/*
* MDP5/DPU based devices don't have a flat hierarchy. There is a top
@@ -356,42 +330,17 @@ static int mdss_probe(struct platform_device *pdev)
ret = of_platform_populate(dev->of_node, NULL, NULL, dev);
if (ret) {
DRM_DEV_ERROR(dev, "failed to populate children devices\n");
- goto fail;
- }
-
- mdp_dev = device_find_child(dev, NULL, find_mdp_node);
- if (!mdp_dev) {
- DRM_DEV_ERROR(dev, "failed to find MDSS MDP node\n");
- of_platform_depopulate(dev);
- ret = -ENODEV;
- goto fail;
+ msm_mdss_destroy(mdss);
+ return ret;
}
- /*
- * on MDP5 based platforms, the MDSS platform device is the component
- * that adds MDP5 and other display interface components to
- * itself.
- */
- ret = msm_drv_probe(dev, mdp_dev);
- put_device(mdp_dev);
- if (ret)
- goto fail;
-
return 0;
-
-fail:
- of_platform_depopulate(dev);
- msm_mdss_destroy(priv->mdss);
-
- return ret;
}
static int mdss_remove(struct platform_device *pdev)
{
- struct msm_drm_private *priv = platform_get_drvdata(pdev);
- struct msm_mdss *mdss = priv->mdss;
+ struct msm_mdss *mdss = platform_get_drvdata(pdev);
- component_master_del(&pdev->dev, &msm_drm_ops);
of_platform_depopulate(&pdev->dev);
msm_mdss_destroy(mdss);