Skip to content

Commit a2ab5d5

Browse files
lumagrobclark
authored andcommitted
drm/msm: allow passing struct msm_kms to msm_drv_probe()
In preparation of moving resource allocation to the probe time, allow MSM KMS drivers to pass struct msm_kms pointer via msm_drv_probe(). Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/561627/ Signed-off-by: Rob Clark <robdclark@chromium.org>
1 parent 1d52457 commit a2ab5d5

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ static int dpu_kms_init(struct drm_device *ddev)
12991299

13001300
static int dpu_dev_probe(struct platform_device *pdev)
13011301
{
1302-
return msm_drv_probe(&pdev->dev, dpu_kms_init);
1302+
return msm_drv_probe(&pdev->dev, dpu_kms_init, NULL);
13031303
}
13041304

13051305
static int dpu_dev_remove(struct platform_device *pdev)

drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static const struct dev_pm_ops mdp4_pm_ops = {
557557

558558
static int mdp4_probe(struct platform_device *pdev)
559559
{
560-
return msm_drv_probe(&pdev->dev, mdp4_kms_init);
560+
return msm_drv_probe(&pdev->dev, mdp4_kms_init, NULL);
561561
}
562562

563563
static int mdp4_remove(struct platform_device *pdev)

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ static int mdp5_dev_probe(struct platform_device *pdev)
939939
if (ret)
940940
return ret;
941941

942-
return msm_drv_probe(&pdev->dev, mdp5_kms_init);
942+
return msm_drv_probe(&pdev->dev, mdp5_kms_init, NULL);
943943
}
944944

945945
static int mdp5_dev_remove(struct platform_device *pdev)

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,8 @@ const struct component_master_ops msm_drm_ops = {
12301230
};
12311231

12321232
int msm_drv_probe(struct device *master_dev,
1233-
int (*kms_init)(struct drm_device *dev))
1233+
int (*kms_init)(struct drm_device *dev),
1234+
struct msm_kms *kms)
12341235
{
12351236
struct msm_drm_private *priv;
12361237
struct component_match *match = NULL;
@@ -1240,6 +1241,7 @@ int msm_drv_probe(struct device *master_dev,
12401241
if (!priv)
12411242
return -ENOMEM;
12421243

1244+
priv->kms = kms;
12431245
priv->kms_init = kms_init;
12441246
dev_set_drvdata(master_dev, priv);
12451247

@@ -1275,7 +1277,7 @@ int msm_drv_probe(struct device *master_dev,
12751277

12761278
static int msm_pdev_probe(struct platform_device *pdev)
12771279
{
1278-
return msm_drv_probe(&pdev->dev, NULL);
1280+
return msm_drv_probe(&pdev->dev, NULL, NULL);
12791281
}
12801282

12811283
static int msm_pdev_remove(struct platform_device *pdev)

drivers/gpu/drm/msm/msm_drv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ int msm_pm_prepare(struct device *dev);
570570
void msm_pm_complete(struct device *dev);
571571

572572
int msm_drv_probe(struct device *dev,
573-
int (*kms_init)(struct drm_device *dev));
573+
int (*kms_init)(struct drm_device *dev),
574+
struct msm_kms *kms);
574575
void msm_drv_shutdown(struct platform_device *pdev);
575576

576577

0 commit comments

Comments
 (0)