]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: rcar-du: Shutdown the display on system shutdown
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 23 Mar 2021 00:09:53 +0000 (02:09 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 28 Jul 2021 13:33:06 +0000 (16:33 +0300)
When the system shuts down or warm reboots, the display may be active,
with the hardware accessing system memory. Upon reboot, the DDR will not
be accessible, which may cause issues.

Implement the platform_driver .shutdown() operation and shut down the
display to fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_drv.c

index e289a66594a732674a310504cd8cbb1382dfbd0a..9788286813131ad2d2521ef4d67f098bc6d6dec0 100644 (file)
@@ -561,6 +561,13 @@ static int rcar_du_remove(struct platform_device *pdev)
        return 0;
 }
 
+static void rcar_du_shutdown(struct platform_device *pdev)
+{
+       struct rcar_du_device *rcdu = platform_get_drvdata(pdev);
+
+       drm_atomic_helper_shutdown(&rcdu->ddev);
+}
+
 static int rcar_du_probe(struct platform_device *pdev)
 {
        struct rcar_du_device *rcdu;
@@ -615,6 +622,7 @@ error:
 static struct platform_driver rcar_du_platform_driver = {
        .probe          = rcar_du_probe,
        .remove         = rcar_du_remove,
+       .shutdown       = rcar_du_shutdown,
        .driver         = {
                .name   = "rcar-du",
                .pm     = &rcar_du_pm_ops,