summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRahul Sharma <rahsha@codeaurora.org>2019-04-13 13:19:46 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-04-15 21:10:25 -0700
commita18089dad122452aeeca5c91da8a97512da29ca6 (patch)
tree08abc2d217c11ded410ca4fbe0cc3a3996b70473 /drivers/gpu
parent15e17660ba556c19a2d35770a2cd472872e1b450 (diff)
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: Rahul Sharma <rahsha@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/ekms/edrm_drv.c14
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c15
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/ekms/edrm_drv.c b/drivers/gpu/drm/msm/ekms/edrm_drv.c
index 69b8c01e59d4..3711b4680d0a 100644
--- a/drivers/gpu/drm/msm/ekms/edrm_drv.c
+++ b/drivers/gpu/drm/msm/ekms/edrm_drv.c
@@ -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");
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index f3df176ce094..f36b992690c4 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -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");