diff options
author | Thierry Reding <treding@nvidia.com> | 2015-08-11 13:11:49 +0200 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2015-12-14 10:50:39 +0100 |
commit | 986c58d1625df222c6148c1dc72e59fbf96ef75e (patch) | |
tree | 28de546e7a1aee38e62c2ddfc8b7b827c23358bb /drivers/gpu/drm/tegra/drm.c | |
parent | 01b9bea0c2616e92334cfa3e052862527bf25d36 (diff) | |
download | linux-986c58d1625df222c6148c1dc72e59fbf96ef75e.tar.bz2 |
drm/tegra: Implement subsystem-level suspend/resume
Use the drm_atomic_helper_suspend() and drm_atomic_helper_resume()
helpers to implement subsystem-level suspend/resume.
v2: suspend framebuffer device to avoid concurrency issues
v3: resume fbdev on failure to suspend (Emil Velikov)
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/drm.c')
-rw-r--r-- | drivers/gpu/drm/tegra/drm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index c4910d528411..ced5a095d2ad 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1021,8 +1021,17 @@ static int host1x_drm_remove(struct host1x_device *dev) static int host1x_drm_suspend(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); + struct tegra_drm *tegra = drm->dev_private; drm_kms_helper_poll_disable(drm); + tegra_drm_fb_suspend(drm); + + tegra->state = drm_atomic_helper_suspend(drm); + if (IS_ERR(tegra->state)) { + tegra_drm_fb_resume(drm); + drm_kms_helper_poll_enable(drm); + return PTR_ERR(tegra->state); + } return 0; } @@ -1030,7 +1039,10 @@ static int host1x_drm_suspend(struct device *dev) static int host1x_drm_resume(struct device *dev) { struct drm_device *drm = dev_get_drvdata(dev); + struct tegra_drm *tegra = drm->dev_private; + drm_atomic_helper_resume(drm, tegra->state); + tegra_drm_fb_resume(drm); drm_kms_helper_poll_enable(drm); return 0; |