diff mbox series

[V4,2/2] drm/vc4: v3d: add PM suspend/resume support

Message ID 20241003124107.39153-3-wahrenst@gmx.net (mailing list archive)
State New
Headers show
Series drm/vc4: add PM suspend/resume support | expand

Commit Message

Stefan Wahren Oct. 3, 2024, 12:41 p.m. UTC
Add suspend/resume support for the VC4 V3D component in order
to handle suspend to idle properly.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/gpu/drm/vc4/vc4_v3d.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--
2.34.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 2423826c89eb..8057b06c1f16 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -368,7 +368,6 @@  void vc4_v3d_bin_bo_put(struct vc4_dev *vc4)
 	mutex_unlock(&vc4->bin_bo_lock);
 }

-#ifdef CONFIG_PM
 static int vc4_v3d_runtime_suspend(struct device *dev)
 {
 	struct vc4_v3d *v3d = dev_get_drvdata(dev);
@@ -397,7 +396,6 @@  static int vc4_v3d_runtime_resume(struct device *dev)

 	return 0;
 }
-#endif

 int vc4_v3d_debugfs_init(struct drm_minor *minor)
 {
@@ -507,7 +505,8 @@  static void vc4_v3d_unbind(struct device *dev, struct device *master,
 }

 static const struct dev_pm_ops vc4_v3d_pm_ops = {
-	SET_RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL)
+	RUNTIME_PM_OPS(vc4_v3d_runtime_suspend, vc4_v3d_runtime_resume, NULL)
+	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };

 static const struct component_ops vc4_v3d_ops = {
@@ -538,6 +537,6 @@  struct platform_driver vc4_v3d_driver = {
 	.driver = {
 		.name = "vc4_v3d",
 		.of_match_table = vc4_v3d_dt_match,
-		.pm = &vc4_v3d_pm_ops,
+		.pm = pm_ptr(&vc4_v3d_pm_ops),
 	},
 };