drm/msm/kms: Update msm_kms_init/destroy
Add msm_kms_destroy() and add err return from msm_kms_init(). Prep work for next patch. Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
@ -718,6 +718,8 @@ static void dpu_kms_destroy(struct msm_kms *kms)
|
|||||||
dpu_kms = to_dpu_kms(kms);
|
dpu_kms = to_dpu_kms(kms);
|
||||||
|
|
||||||
_dpu_kms_hw_destroy(dpu_kms);
|
_dpu_kms_hw_destroy(dpu_kms);
|
||||||
|
|
||||||
|
msm_kms_destroy(&dpu_kms->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
|
static void _dpu_kms_set_encoder_mode(struct msm_kms *kms,
|
||||||
@ -1108,7 +1110,11 @@ static int dpu_bind(struct device *dev, struct device *master, void *data)
|
|||||||
|
|
||||||
platform_set_drvdata(pdev, dpu_kms);
|
platform_set_drvdata(pdev, dpu_kms);
|
||||||
|
|
||||||
msm_kms_init(&dpu_kms->base, &kms_funcs);
|
ret = msm_kms_init(&dpu_kms->base, &kms_funcs);
|
||||||
|
if (ret) {
|
||||||
|
DPU_ERROR("failed to init kms, ret=%d\n", ret);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
dpu_kms->dev = ddev;
|
dpu_kms->dev = ddev;
|
||||||
dpu_kms->pdev = pdev;
|
dpu_kms->pdev = pdev;
|
||||||
|
|
||||||
|
@ -175,6 +175,8 @@ static void mdp4_destroy(struct msm_kms *kms)
|
|||||||
if (mdp4_kms->rpm_enabled)
|
if (mdp4_kms->rpm_enabled)
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
|
|
||||||
|
mdp_kms_destroy(&mdp4_kms->base);
|
||||||
|
|
||||||
kfree(mdp4_kms);
|
kfree(mdp4_kms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +429,11 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
mdp_kms_init(&mdp4_kms->base, &kms_funcs);
|
ret = mdp_kms_init(&mdp4_kms->base, &kms_funcs);
|
||||||
|
if (ret) {
|
||||||
|
DRM_DEV_ERROR(dev->dev, "failed to init kms\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
kms = &mdp4_kms->base.base;
|
kms = &mdp4_kms->base.base;
|
||||||
|
|
||||||
|
@ -232,6 +232,8 @@ static void mdp5_kms_destroy(struct msm_kms *kms)
|
|||||||
aspace->mmu->funcs->detach(aspace->mmu);
|
aspace->mmu->funcs->detach(aspace->mmu);
|
||||||
msm_gem_address_space_put(aspace);
|
msm_gem_address_space_put(aspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mdp_kms_destroy(&mdp5_kms->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_FS
|
#ifdef CONFIG_DEBUG_FS
|
||||||
@ -592,11 +594,14 @@ struct msm_kms *mdp5_kms_init(struct drm_device *dev)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
|
mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
|
||||||
|
|
||||||
mdp_kms_init(&mdp5_kms->base, &kms_funcs);
|
|
||||||
|
|
||||||
pdev = mdp5_kms->pdev;
|
pdev = mdp5_kms->pdev;
|
||||||
|
|
||||||
|
ret = mdp_kms_init(&mdp5_kms->base, &kms_funcs);
|
||||||
|
if (ret) {
|
||||||
|
DRM_DEV_ERROR(&pdev->dev, "failed to init kms\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
|
irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
|
||||||
if (irq < 0) {
|
if (irq < 0) {
|
||||||
ret = irq;
|
ret = irq;
|
||||||
|
@ -36,12 +36,17 @@ struct mdp_kms {
|
|||||||
};
|
};
|
||||||
#define to_mdp_kms(x) container_of(x, struct mdp_kms, base)
|
#define to_mdp_kms(x) container_of(x, struct mdp_kms, base)
|
||||||
|
|
||||||
static inline void mdp_kms_init(struct mdp_kms *mdp_kms,
|
static inline int mdp_kms_init(struct mdp_kms *mdp_kms,
|
||||||
const struct mdp_kms_funcs *funcs)
|
const struct mdp_kms_funcs *funcs)
|
||||||
{
|
{
|
||||||
mdp_kms->funcs = funcs;
|
mdp_kms->funcs = funcs;
|
||||||
INIT_LIST_HEAD(&mdp_kms->irq_list);
|
INIT_LIST_HEAD(&mdp_kms->irq_list);
|
||||||
msm_kms_init(&mdp_kms->base, &funcs->base);
|
return msm_kms_init(&mdp_kms->base, &funcs->base);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void mdp_kms_destroy(struct mdp_kms *mdp_kms)
|
||||||
|
{
|
||||||
|
msm_kms_destroy(&mdp_kms->base);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -160,7 +160,7 @@ struct msm_kms {
|
|||||||
struct msm_pending_timer pending_timers[MAX_CRTCS];
|
struct msm_pending_timer pending_timers[MAX_CRTCS];
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline void msm_kms_init(struct msm_kms *kms,
|
static inline int msm_kms_init(struct msm_kms *kms,
|
||||||
const struct msm_kms_funcs *funcs)
|
const struct msm_kms_funcs *funcs)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -172,6 +172,12 @@ static inline void msm_kms_init(struct msm_kms *kms,
|
|||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(kms->pending_timers); i++)
|
for (i = 0; i < ARRAY_SIZE(kms->pending_timers); i++)
|
||||||
msm_atomic_init_pending_timer(&kms->pending_timers[i], kms, i);
|
msm_atomic_init_pending_timer(&kms->pending_timers[i], kms, i);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void msm_kms_destroy(struct msm_kms *kms)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
struct msm_kms *mdp4_kms_init(struct drm_device *dev);
|
struct msm_kms *mdp4_kms_init(struct drm_device *dev);
|
||||||
|
Reference in New Issue
Block a user