Re: [PATCH 3/4] drm/i915: Introduce gpu_reset_clobbers_display()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 05, 2016 at 11:28:29PM +0300, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> Factor out the "does the GPU reset clobber the display?" check into a
> small helper.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 6bd60a9ece06..632739f9cc44 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -3135,6 +3135,11 @@ __intel_display_resume(struct drm_device *dev,
>  	return ret;
>  }
>  
> +static bool gpu_reset_clobbers_display(struct drm_i915_private *dev_priv)
> +{
> +	return INTEL_GEN(dev_priv) < 5 && !IS_G4X(dev_priv);
> +}
> +
>  void intel_prepare_reset(struct drm_i915_private *dev_priv)
>  {
>  	struct drm_device *dev = &dev_priv->drm;
> @@ -3162,7 +3167,7 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
>  
>  	/* reset doesn't touch the display, but flips might get nuked anyway, */
>  	if (!i915.force_reset_modeset_test &&
> -	    (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)))
> +	    !gpu_reset_clobbers_display(dev_priv))
>  		return;
>  
>  	/*
> @@ -3212,7 +3217,7 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
>  	dev_priv->modeset_restore_state = NULL;
>  
>  	/* reset doesn't touch the display */
> -	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv)) {
> +	if (!gpu_reset_clobbers_display(dev_priv)) {
>  		if (!state) {
>  			/*
>  			 * Flips in the rings have been nuked by the reset,
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux