drm/msm: move helper calls to msm_kms.c

Extract two more KMS-related codepieces to msm_kms.c, removing last
pieces of KMS code from msm_drv.c.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/662574/
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
This commit is contained in:
Dmitry Baryshkov
2025-07-05 13:02:27 +03:00
committed by Rob Clark
parent a409b78fcd
commit 0c2dda82b1
3 changed files with 25 additions and 6 deletions

View File

@@ -11,7 +11,6 @@
#include <linux/of_address.h>
#include <linux/uaccess.h>
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
@@ -74,7 +73,7 @@ static int msm_drm_uninit(struct device *dev)
if (ddev->registered) {
drm_dev_unregister(ddev);
if (priv->kms)
drm_atomic_helper_shutdown(ddev);
msm_drm_kms_unregister(dev);
}
msm_gem_shrinker_cleanup(ddev);
@@ -167,10 +166,8 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
if (ret)
goto err_msm_uninit;
if (priv->kms_init) {
drm_kms_helper_poll_init(ddev);
drm_client_setup(ddev, NULL);
}
if (priv->kms_init)
msm_drm_kms_post_init(dev);
return 0;

View File

@@ -13,6 +13,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_mode_config.h>
#include <drm/drm_vblank.h>
#include <drm/clients/drm_client_setup.h>
#include "disp/msm_disp_snapshot.h"
#include "msm_drv.h"
@@ -217,6 +218,15 @@ struct drm_gpuvm *msm_kms_init_vm(struct drm_device *dev)
return vm;
}
void msm_drm_kms_unregister(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct msm_drm_private *priv = platform_get_drvdata(pdev);
struct drm_device *ddev = priv->dev;
drm_atomic_helper_shutdown(ddev);
}
void msm_drm_kms_uninit(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -366,3 +376,13 @@ void msm_kms_shutdown(struct platform_device *pdev)
if (drm && drm->registered && priv->kms)
drm_atomic_helper_shutdown(drm);
}
void msm_drm_kms_post_init(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct msm_drm_private *priv = platform_get_drvdata(pdev);
struct drm_device *ddev = priv->dev;
drm_kms_helper_poll_init(ddev);
drm_client_setup(ddev, NULL);
}

View File

@@ -200,6 +200,8 @@ static inline void msm_kms_destroy(struct msm_kms *kms)
for_each_if (drm_crtc_mask(crtc) & (crtc_mask))
int msm_drm_kms_init(struct device *dev, const struct drm_driver *drv);
void msm_drm_kms_post_init(struct device *dev);
void msm_drm_kms_unregister(struct device *dev);
void msm_drm_kms_uninit(struct device *dev);
#endif /* __MSM_KMS_H__ */