]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/tegra: Call drm_atomic_helper_shutdown() at shutdown time
authorDouglas Anderson <dianders@chromium.org>
Wed, 12 Jun 2024 22:23:43 +0000 (15:23 -0700)
committerDouglas Anderson <dianders@chromium.org>
Mon, 8 Jul 2024 20:55:03 +0000 (13:55 -0700)
Based on grepping through the source code this driver appears to be
missing a call to drm_atomic_helper_shutdown() at system shutdown
time. Among other things, this means that if a panel is in use that it
won't be cleanly powered off at system shutdown time.

The fact that we should call drm_atomic_helper_shutdown() in the case
of OS shutdown/restart comes straight out of the kernel doc "driver
instance overview" in drm_drv.c.

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240612152336.v2.3.Ifb4450979b62976fd5a98847dade2e5b377d47c8@changeid
drivers/gpu/drm/tegra/drm.c

index 03d1c76aec2d3f7aca6a52acbb1a42455b37faa8..d9f0728c3afdfc7b824f40a965a5e01bc1478633 100644 (file)
@@ -1330,6 +1330,11 @@ static int host1x_drm_remove(struct host1x_device *dev)
        return 0;
 }
 
+static void host1x_drm_shutdown(struct host1x_device *dev)
+{
+       drm_atomic_helper_shutdown(dev_get_drvdata(&dev->dev));
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int host1x_drm_suspend(struct device *dev)
 {
@@ -1398,6 +1403,7 @@ static struct host1x_driver host1x_drm_driver = {
        },
        .probe = host1x_drm_probe,
        .remove = host1x_drm_remove,
+       .shutdown = host1x_drm_shutdown,
        .subdevs = host1x_drm_subdevs,
 };