diff mbox

[v2,22/28] drm: omapdrm: Move shutdown() handler from core to dss

Message ID 20170508113303.27521-23-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart May 8, 2017, 11:32 a.m. UTC
In preparation for removal of the core module, move the shutdown()
handler from core to dss.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/dss/core.c | 20 --------------------
 drivers/gpu/drm/omapdrm/dss/dss.c  | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 20 deletions(-)

Comments

Tomi Valkeinen May 9, 2017, 11:38 a.m. UTC | #1
On 08/05/17 14:32, Laurent Pinchart wrote:
> In preparation for removal of the core module, move the shutdown()
> handler from core to dss.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/core.c | 20 --------------------
>  drivers/gpu/drm/omapdrm/dss/dss.c  | 16 ++++++++++++++++
>  2 files changed, 16 insertions(+), 20 deletions(-)

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Although I wonder if shutdown is even needed... I think the DRM side
should disable all the displays when being removed.

 Tomi
Laurent Pinchart May 9, 2017, 9:42 p.m. UTC | #2
Hi Tomi,

On Tuesday 09 May 2017 14:38:39 Tomi Valkeinen wrote:
> On 08/05/17 14:32, Laurent Pinchart wrote:
> > In preparation for removal of the core module, move the shutdown()
> > handler from core to dss.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> >  drivers/gpu/drm/omapdrm/dss/core.c | 20 --------------------
> >  drivers/gpu/drm/omapdrm/dss/dss.c  | 16 ++++++++++++++++
> >  2 files changed, 16 insertions(+), 20 deletions(-)
> 
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> Although I wonder if shutdown is even needed... I think the DRM side
> should disable all the displays when being removed.

The .shutdown() handler is called when the system is shut down, including 
prior to a reboot. As far as I know the DRM core doesn't get involved there.
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c
index dc2147ec78f6..839bfb5a2e48 100644
--- a/drivers/gpu/drm/omapdrm/dss/core.c
+++ b/drivers/gpu/drm/omapdrm/dss/core.c
@@ -50,19 +50,6 @@  EXPORT_SYMBOL(omapdss_get_version);
 
 /* PLATFORM DEVICE */
 
-static void dss_disable_all_devices(void)
-{
-	struct omap_dss_device *dssdev = NULL;
-
-	for_each_dss_dev(dssdev) {
-		if (!dssdev->driver)
-			continue;
-
-		if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
-			dssdev->driver->disable(dssdev);
-	}
-}
-
 static int __init omap_dss_probe(struct platform_device *pdev)
 {
 	core.pdev = pdev;
@@ -77,15 +64,8 @@  static int omap_dss_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static void omap_dss_shutdown(struct platform_device *pdev)
-{
-	DSSDBG("shutdown\n");
-	dss_disable_all_devices();
-}
-
 static struct platform_driver omap_dss_driver = {
 	.remove         = omap_dss_remove,
-	.shutdown	= omap_dss_shutdown,
 	.driver         = {
 		.name   = "omapdss",
 	},
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 618fd4dcbd5a..34d5caa7d0b5 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1421,6 +1421,21 @@  static int dss_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static void dss_shutdown(struct platform_device *pdev)
+{
+	struct omap_dss_device *dssdev = NULL;
+
+	DSSDBG("shutdown\n");
+
+	for_each_dss_dev(dssdev) {
+		if (!dssdev->driver)
+			continue;
+
+		if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
+			dssdev->driver->disable(dssdev);
+	}
+}
+
 static int dss_runtime_suspend(struct device *dev)
 {
 	dss_save_context();
@@ -1460,6 +1475,7 @@  static const struct dev_pm_ops dss_pm_ops = {
 static struct platform_driver omap_dsshw_driver = {
 	.probe		= dss_probe,
 	.remove		= dss_remove,
+	.shutdown	= dss_shutdown,
 	.driver         = {
 		.name   = "omapdss_dss",
 		.pm	= &dss_pm_ops,