Currently both msm_drm_init() and msm_drm_uninit() functions are trying to handle both normal and headless Adreno cases. This results in a suboptimal code, since headless case still gets modesetting and atomic interfaces enabled. Two mentioned functions are a spaghetti of `if (priv->kms)' conditional code. Move all KMS-related code (not limiting the init / teardown path) from msm_drv.c to msm_kms.c, making it more self-contained. This also disables ATOMIC and MODESET features for the headless case. Dependencies: [1] [1] https://patchwork.freedesktop.org/series/105392/ Changes since v1: - Rebased on top of linux-next / updated version of [1] Dmitry Baryshkov (13): drm/msm/dsi: switch to devm_drm_bridge_add() drm/msm/hdmi: switch to devm_drm_bridge_add() drm/msm/dp: move pdev from struct dp_display_private to struct msm_dp drm/msm/dp: switch to devm_drm_bridge_add() drm/msm: remove msm_drm_private::bridges field drm/msm: drop pm ops from the headless msm driver drm/msm: rename msm_pm_prepare/complete to note the KMS nature drm/msm: remove shutdown callback from msm_platform_driver drm/msm: rename msm_drv_shutdown() to msm_kms_shutdown() drm/msm: switch to drmm_mode_config_init() drm/msm: only register 'kms' debug file if KMS is used drm/msm: make fb debugfs file available only in KMS case drm/msm: carve out KMS code from msm_drv.c drivers/gpu/drm/msm/Makefile | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 6 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 6 +- drivers/gpu/drm/msm/dp/dp_display.c | 34 +-- drivers/gpu/drm/msm/dp/dp_display.h | 1 + drivers/gpu/drm/msm/dp/dp_drm.c | 21 +- drivers/gpu/drm/msm/dp/dp_drm.h | 2 +- drivers/gpu/drm/msm/dsi/dsi.c | 28 +- drivers/gpu/drm/msm/dsi/dsi.h | 3 +- drivers/gpu/drm/msm/dsi/dsi_manager.c | 30 +- drivers/gpu/drm/msm/hdmi/hdmi.c | 22 +- drivers/gpu/drm/msm/hdmi/hdmi.h | 5 +- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 30 +- drivers/gpu/drm/msm/hdmi/hdmi_hpd.c | 3 +- drivers/gpu/drm/msm/msm_debugfs.c | 12 +- drivers/gpu/drm/msm/msm_drv.c | 362 ++--------------------- drivers/gpu/drm/msm/msm_drv.h | 9 +- drivers/gpu/drm/msm/msm_kms.c | 345 +++++++++++++++++++++ drivers/gpu/drm/msm/msm_kms.h | 3 + 20 files changed, 451 insertions(+), 478 deletions(-) create mode 100644 drivers/gpu/drm/msm/msm_kms.c -- 2.39.2