diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-11-06 20:18:08 +0100 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:35:05 +0800 |
commit | 3f40d3515ce8901f7a928cf0a5d220845e213004 (patch) | |
tree | ad7742492fb85e70ee6f853265147417aab45d44 /include/drm | |
parent | c800bf64b657ba8991837ed3c876225845434e85 (diff) |
MLK-20181-5: drm/modeset-helper: Add simple modeset suspend/resume helpers
Add drm_mode_config_helper_suspend/resume() which takes care of
atomic modeset suspend/resume for simple use cases.
The suspend state is stored in struct drm_mode_config.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171106191812.38927-3-noralf@tronnes.org
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_mode_config.h | 9 | ||||
-rw-r--r-- | include/drm/drm_modeset_helper.h | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 67040a61b867..b71aa2ceb14a 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -780,6 +780,15 @@ struct drm_mode_config { /* cursor size */ uint32_t cursor_width, cursor_height; + /** + * @suspend_state: + * + * Atomic state when suspended. + * Set by drm_mode_config_helper_suspend() and cleared by + * drm_mode_config_helper_resume(). + */ + struct drm_atomic_state *suspend_state; + const struct drm_mode_config_helper_funcs *helper_private; }; diff --git a/include/drm/drm_modeset_helper.h b/include/drm/drm_modeset_helper.h index cb0ec92e11e6..efa337f03129 100644 --- a/include/drm/drm_modeset_helper.h +++ b/include/drm/drm_modeset_helper.h @@ -34,4 +34,7 @@ void drm_helper_mode_fill_fb_struct(struct drm_device *dev, int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, const struct drm_crtc_funcs *funcs); +int drm_mode_config_helper_suspend(struct drm_device *dev); +int drm_mode_config_helper_resume(struct drm_device *dev); + #endif |