[PATCH 1/4] drm: Add an interface to reset the device

Takashi Iwai tiwai at suse.de
Mon Jan 24 08:18:06 PST 2011


At Mon, 24 Jan 2011 15:55:28 +0000,
Chris Wilson wrote:
> 
> 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.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/drm_crtc.c |   19 +++++++++++++++++++
>  include/drm/drm_crtc.h     |    7 +++++++
>  2 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 2baa670..6d7323d 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2674,3 +2674,22 @@ 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);
> +}

Missing EXPORT_SYMBOL()?


thanks,

Takashi


More information about the dri-devel mailing list