Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a18089da authored by Rahul Sharma's avatar Rahul Sharma Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm: ensure msm_drm probe and eDRM Probe completion



There are issues when display driver probe() execution is scheduled
out during kernel boot because probe_type marked as
PROBE_PREFER_ASYNCHRONOUS.
Since there are few kernel modules that needs display driver to be
initialized. This change adds late_initcall() function which waits
for the completion of probes() to ensure that display is
initialized before other kernel module which can impact the system
boot behavior.

Change-Id: Idd83ac0450ed6f8e09dc98de8bbcec05942302e7
Signed-off-by: default avatarRahul Sharma <rahsha@codeaurora.org>
parent 15e17660
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
#include "msm_mmu.h"
#include "edrm_kms.h"

static struct completion wait_display_completion;

static int msm_edrm_unload(struct drm_device *dev)
{
	struct msm_drm_private *priv = dev->dev_private;
@@ -367,6 +369,7 @@ static int msm_pdev_edrm_probe(struct platform_device *pdev)
	if (ret)
		DRM_ERROR("drm_platform_init failed: %d\n", ret);

	complete(&wait_display_completion);
	return ret;
}

@@ -423,6 +426,7 @@ static struct platform_driver msm_platform_driver = {
static int __init msm_edrm_register(void)
{
	DBG("init");
	init_completion(&wait_display_completion);
	return platform_driver_register(&msm_platform_driver);
}

@@ -432,8 +436,18 @@ static void __exit msm_edrm_unregister(void)
	platform_driver_unregister(&msm_platform_driver);
}

static int __init msm_edrm_late_register(void)
{
	pr_debug("wait for eDRM display probe completion\n");
	wait_for_completion(&wait_display_completion);

	return 0;
}

module_init(msm_edrm_register);
module_exit(msm_edrm_unregister);
/* init level 7 */
late_initcall(msm_edrm_late_register);

MODULE_DESCRIPTION("MSM EARLY DRM Driver");
MODULE_LICENSE("GPL v2");
+15 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@
#include "msm_gem.h"
#include "msm_mmu.h"

static struct completion wait_display_completion;

static void msm_drm_helper_hotplug_event(struct drm_device *dev)
{
	struct drm_connector *connector;
@@ -2406,6 +2408,7 @@ static int msm_pdev_probe(struct platform_device *pdev)
		return ret;

	ret = msm_add_master_component(&pdev->dev, match);
	complete(&wait_display_completion);

	return ret;
}
@@ -2459,6 +2462,7 @@ static struct platform_driver msm_platform_driver = {
		.name   = "msm_drm",
		.of_match_table = dt_match,
		.pm     = &msm_pm_ops,
		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
	},
	.id_table   = msm_id,
};
@@ -2481,6 +2485,7 @@ static int __init msm_drm_register(void)
	msm_edp_register();
	hdmi_register();
	adreno_register();
	init_completion(&wait_display_completion);
	return platform_driver_register(&msm_platform_driver);
}

@@ -2495,8 +2500,18 @@ static void __exit msm_drm_unregister(void)
	msm_smmu_driver_cleanup();
}

static int __init msm_drm_late_register(void)
{
	pr_debug("wait for display probe completion\n");
	wait_for_completion(&wait_display_completion);

	return 0;
}

module_init(msm_drm_register);
module_exit(msm_drm_unregister);
/* init level 7 */
late_initcall(msm_drm_late_register);

MODULE_AUTHOR("Rob Clark <robdclark@gmail.com");
MODULE_DESCRIPTION("MSM DRM Driver");