Re: [PATCH 1/3] drm/i915: Do CRT HPD force trigger only when needed

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

 



Ironically I only started running into the hotplug loop issue you described once
I wrote some patches to enable hpd polling for vlv, so these came at the perfect
time. Anyway, tested these on an Intel NUC and reviewed them and they look good
to me.

For the whole series:

Reviewed-by: Lyude <cpaul@xxxxxxxxxx>

On Mon, 2016-04-18 at 19:03 +0300, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> 
> There doesn't seem to be any need to for the force trigger trick every
> single time on VLV CRT output. Let's do it the same way as on ILK+, and
> do the force trigger only on the first detect after reset.
> 
> This means we can actually just call the ILK+ code on VLV. The only
> difference between the two is the "turn DAC off" trick, but that's
> already conditional on HAS_PCH_SPLIT() so it won't be done on VLV.
> 
> Cc: Lyude <cpaul@xxxxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_crt.c | 39 +--------------------------------------
>  1 file changed, 1 insertion(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_crt.c
> b/drivers/gpu/drm/i915/intel_crt.c
> index a2a31fd01d1d..d10dea5bd08a 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -316,40 +316,6 @@ static bool intel_ironlake_crt_detect_hotplug(struct
> drm_connector *connector)
>  	return ret;
>  }
>  
> -static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
> -{
> -	struct drm_device *dev = connector->dev;
> -	struct intel_crt *crt = intel_attached_crt(connector);
> -	struct drm_i915_private *dev_priv = dev->dev_private;
> -	u32 adpa;
> -	bool ret;
> -	u32 save_adpa;
> -
> -	save_adpa = adpa = I915_READ(crt->adpa_reg);
> -	DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);
> -
> -	adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;
> -
> -	I915_WRITE(crt->adpa_reg, adpa);
> -
> -	if (wait_for((I915_READ(crt->adpa_reg) &
> ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
> -		     1000)) {
> -		DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
> -		I915_WRITE(crt->adpa_reg, save_adpa);
> -	}
> -
> -	/* Check the status to see if both blue and green are on now */
> -	adpa = I915_READ(crt->adpa_reg);
> -	if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
> -		ret = true;
> -	else
> -		ret = false;
> -
> -	DRM_DEBUG_KMS("valleyview hotplug adpa=0x%x, result %d\n", adpa,
> ret);
> -
> -	return ret;
> -}
> -
>  /**
>   * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.
>   *
> @@ -366,12 +332,9 @@ static bool intel_crt_detect_hotplug(struct drm_connector
> *connector)
>  	bool ret = false;
>  	int i, tries = 0;
>  
> -	if (HAS_PCH_SPLIT(dev))
> +	if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
>  		return intel_ironlake_crt_detect_hotplug(connector);
>  
> -	if (IS_VALLEYVIEW(dev))
> -		return valleyview_crt_detect_hotplug(connector);
> -
>  	/*
>  	 * On 4 series desktop, CRT detect sequence need to be done twice
>  	 * to get a reliable result.
_______________________________________________
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