[Intel-gfx] [PATCH 1/7] drm/i915: Refactor gmch hpd irq handling

Chris Wilson chris at chris-wilson.co.uk
Mon Mar 31 17:49:28 CEST 2014


On Mon, Mar 31, 2014 at 06:21:24PM +0300, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Pull all the gmch platform hotplug interrupt handling into one
> function.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 71 +++++++++++++++++++----------------------
>  1 file changed, 32 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 0858189..6d26719 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1647,6 +1647,34 @@ static void valleyview_pipestat_irq_handler(struct drm_device *dev, u32 iir)
>  		gmbus_irq_handler(dev);
>  }
>  
> +static void i9xx_hpd_irq_handler(struct drm_device *dev, u32 iir)
> +{
> +	drm_i915_private_t *dev_priv = dev->dev_private;
> +	u32 hotplug_status;
> +
> +	if ((iir & I915_DISPLAY_PORT_INTERRUPT) == 0)
> +		return;
> +
> +	hotplug_status = I915_READ(PORT_HOTPLUG_STAT);
> +
> +	if (IS_G4X(dev)) {
> +		u32 hotplug_trigger = hotplug_status & HOTPLUG_INT_STATUS_G4X;
> +
> +		intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_g4x);
> +	} else {
> +		u32 hotplug_trigger = hotplug_status & HOTPLUG_INT_STATUS_I915;
> +
> +		intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915);
> +	}
> +
> +	if ((IS_G4X(dev) || IS_VALLEYVIEW(dev)) &&
> +	    hotplug_status & DP_AUX_CHANNEL_MASK_INT_STATUS_G4X)
> +		dp_aux_irq_handler(dev);
> +
> +	I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status);
> +	POSTING_READ(PORT_HOTPLUG_STAT);
> +}

Hmm, after some thought I am in favour of the function as a readibility
improvement. However, I would prefer to have the iir check inlined
into the caller.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list