diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-24 15:11:08 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-25 19:23:28 +0000 |
commit | eb03355660b44cf6b1ed2f895085b9de8f74efbc (patch) | |
tree | 2665733d7a13db780caf16a7920b7fe871079cdd /drivers/gpu | |
parent | d121a5d2a098ba6dd033dd195f5ccbf7558c37b6 (diff) | |
download | linux-stable-eb03355660b44cf6b1ed2f895085b9de8f74efbc.tar.gz linux-stable-eb03355660b44cf6b1ed2f895085b9de8f74efbc.tar.bz2 linux-stable-eb03355660b44cf6b1ed2f895085b9de8f74efbc.zip |
drm: Add an interface to reset the device
Iterate over the attached CRTCs, encoders and connectors and call the
supplied reset vfunc in order to reset any cached state back to unknown.
Useful after an invalidation event such as a GPU reset or resuming.
Tested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 2baa6708e44c..654faa803dcb 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -2674,3 +2674,23 @@ out: mutex_unlock(&dev->mode_config.mutex); return ret; } + +void drm_mode_config_reset(struct drm_device *dev) +{ + struct drm_crtc *crtc; + struct drm_encoder *encoder; + struct drm_connector *connector; + + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) + if (crtc->funcs->reset) + crtc->funcs->reset(crtc); + + list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) + if (encoder->funcs->reset) + encoder->funcs->reset(encoder); + + list_for_each_entry(connector, &dev->mode_config.connector_list, head) + if (connector->funcs->reset) + connector->funcs->reset(connector); +} +EXPORT_SYMBOL(drm_mode_config_reset); |