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

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

drm/msm: ensure display driver probe completion



This change is done so that in non display platform
indefinite wait is not introduced, however for platforms where
display driver is probed asynchronously we still
wait for completion.

Change-Id: I14932ee2c0e52330975529ca0be34b6e2521d05e
Signed-off-by: default avatarRahul Sharma <rahsha@codeaurora.org>
parent 77c04577
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include "edrm_kms.h"

static struct completion wait_display_completion;
static bool msm_edrm_probed;

static int msm_edrm_unload(struct drm_device *dev)
{
@@ -330,6 +331,8 @@ static int msm_pdev_edrm_probe(struct platform_device *pdev)
	struct msm_drm_private *master_priv;
	struct msm_kms *master_kms;

	msm_edrm_probed = true;

	/* main DRM's minor ID is zero */
	minor = drm_minor_acquire(0);
	if (IS_ERR(minor)) {
@@ -411,6 +414,20 @@ static const struct of_device_id dt_match[] = {
};
MODULE_DEVICE_TABLE(of, dt_match);

static int find_match(struct device *dev, void *data)
{
	struct device_driver *drv = data;

	return drv->bus->match(dev, drv);
}

static bool find_device(struct platform_driver *pdrv)
{
	struct device_driver *drv = &pdrv->driver;

	return bus_for_each_dev(drv->bus, NULL, drv, find_match);
}

static struct platform_driver msm_platform_driver = {
	.probe      = msm_pdev_edrm_probe,
	.remove     = msm_pdev_edrm_remove,
@@ -438,9 +455,13 @@ static void __exit msm_edrm_unregister(void)

static int __init msm_edrm_late_register(void)
{
	struct platform_driver *pdrv;

	pdrv = &msm_platform_driver;
	if (msm_edrm_probed || find_device(pdrv)) {
		pr_debug("wait for eDRM display probe completion\n");
		wait_for_completion(&wait_display_completion);

	}
	return 0;
}

+23 −2
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@
#include "msm_mmu.h"

static struct completion wait_display_completion;
static bool msm_drm_probed;

static void msm_drm_helper_hotplug_event(struct drm_device *dev)
{
@@ -2369,6 +2370,8 @@ static int msm_pdev_probe(struct platform_device *pdev)
	int ret;
	struct component_match *match = NULL;

	msm_drm_probed = true;

#ifdef CONFIG_OF
	add_components(&pdev->dev, &match, "connectors");
#ifndef CONFIG_QCOM_KGSL
@@ -2454,6 +2457,20 @@ static const struct of_device_id dt_match[] = {
};
MODULE_DEVICE_TABLE(of, dt_match);

static int find_match(struct device *dev, void *data)
{
	struct device_driver *drv = data;

	return drv->bus->match(dev, drv);
}

static bool find_device(struct platform_driver *pdrv)
{
	struct device_driver *drv = &pdrv->driver;

	return bus_for_each_dev(drv->bus, NULL, drv, find_match);
}

static struct platform_driver msm_platform_driver = {
	.probe      = msm_pdev_probe,
	.remove     = msm_pdev_remove,
@@ -2502,9 +2519,13 @@ static void __exit msm_drm_unregister(void)

static int __init msm_drm_late_register(void)
{
	struct platform_driver *pdrv;

	pdrv = &msm_platform_driver;
	if (msm_drm_probed || find_device(pdrv)) {
		pr_debug("wait for display probe completion\n");
		wait_for_completion(&wait_display_completion);

	}
	return 0;
}