[Intel-gfx] [PATCH] drm/i915: pch_irq_handler -> {ibx, cpt}_irq_handler

Daniel Vetter daniel at ffwll.ch
Wed Jun 6 22:01:50 CEST 2012


On Wed, Jun 06, 2012 at 03:45:44PM -0400, Adam Jackson wrote:
> Cougar/Panther Point redefine the bits in SDEIIR pretty completely.
> This function is just debugging, but if we're debugging we probably want
> to be told accurate things instead of lies.
> 
> I'm told Lynx Point changes this yet more, but I have no idea how...
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35103

If no one beats me to it, I'll bspec-check this tomorrow. Thanks for the
patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_irq.c |   38 +++++++++++++++++++++++++++++++++++---
>  drivers/gpu/drm/i915/i915_reg.h |   35 ++++++++++++++++++++++++++++++++---
>  2 files changed, 67 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 1417660..b1fe0ed 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -510,7 +510,7 @@ out:
>  	return ret;
>  }
>  
> -static void pch_irq_handler(struct drm_device *dev, u32 pch_iir)
> +static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir)
>  {
>  	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
>  	int pipe;
> @@ -550,6 +550,35 @@ static void pch_irq_handler(struct drm_device *dev, u32 pch_iir)
>  		DRM_DEBUG_DRIVER("PCH transcoder A underrun interrupt\n");
>  }
>  
> +static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir)
> +{
> +	drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
> +	int pipe;
> +
> +	if (pch_iir & SDE_AUDIO_POWER_MASK_CPT)
> +		DRM_DEBUG_DRIVER("PCH audio power change on port %d\n",
> +				 (pch_iir & SDE_AUDIO_POWER_MASK_CPT) >>
> +				 SDE_AUDIO_POWER_SHIFT_CPT);
> +
> +	if (pch_iir & SDE_AUX_MASK_CPT)
> +		DRM_DEBUG_DRIVER("AUX channel interrupt\n");
> +
> +	if (pch_iir & SDE_GMBUS_CPT)
> +		DRM_DEBUG_DRIVER("PCH GMBUS interrupt\n");
> +
> +	if (pch_iir & SDE_AUDIO_CP_REQ_CPT)
> +		DRM_DEBUG_DRIVER("Audio CP request interrupt\n");
> +
> +	if (pch_iir & SDE_AUDIO_CP_CHG_CPT)
> +		DRM_DEBUG_DRIVER("Audio CP change interrupt\n");
> +
> +	if (pch_iir & SDE_FDI_MASK_CPT)
> +		for_each_pipe(pipe)
> +			DRM_DEBUG_DRIVER("  pipe %c FDI IIR: 0x%08x\n",
> +					 pipe_name(pipe),
> +					 I915_READ(FDI_RX_IIR(pipe)));
> +}
> +
>  static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
>  {
>  	struct drm_device *dev = (struct drm_device *) arg;
> @@ -591,7 +620,7 @@ static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS)
>  
>  			if (pch_iir & SDE_HOTPLUG_MASK_CPT)
>  				queue_work(dev_priv->wq, &dev_priv->hotplug_work);
> -			pch_irq_handler(dev, pch_iir);
> +			cpt_irq_handler(dev, pch_iir);
>  
>  			/* clear PCH hotplug event before clear CPU irq */
>  			I915_WRITE(SDEIIR, pch_iir);
> @@ -684,7 +713,10 @@ static irqreturn_t ironlake_irq_handler(DRM_IRQ_ARGS)
>  	if (de_iir & DE_PCH_EVENT) {
>  		if (pch_iir & hotplug_mask)
>  			queue_work(dev_priv->wq, &dev_priv->hotplug_work);
> -		pch_irq_handler(dev, pch_iir);
> +		if (HAS_PCH_CPT(dev))
> +			cpt_irq_handler(dev, pch_iir);
> +		else
> +			ibx_irq_handler(dev, pch_iir);
>  	}
>  
>  	if (de_iir & DE_PCU_EVENT) {
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 2d49b95..b27bcf6 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -3313,7 +3313,7 @@
>  
>  /* PCH */
>  
> -/* south display engine interrupt */
> +/* south display engine interrupt: IBX */
>  #define SDE_AUDIO_POWER_D	(1 << 27)
>  #define SDE_AUDIO_POWER_C	(1 << 26)
>  #define SDE_AUDIO_POWER_B	(1 << 25)
> @@ -3349,15 +3349,44 @@
>  #define SDE_TRANSA_CRC_ERR	(1 << 1)
>  #define SDE_TRANSA_FIFO_UNDER	(1 << 0)
>  #define SDE_TRANS_MASK		(0x3f)
> -/* CPT */
> -#define SDE_CRT_HOTPLUG_CPT	(1 << 19)
> +
> +/* south display engine interrupt: CPT/PPT */
> +#define SDE_AUDIO_POWER_D_CPT	(1 << 31)
> +#define SDE_AUDIO_POWER_C_CPT	(1 << 30)
> +#define SDE_AUDIO_POWER_B_CPT	(1 << 29)
> +#define SDE_AUDIO_POWER_SHIFT_CPT   29
> +#define SDE_AUDIO_POWER_MASK_CPT    (7 << 29)
> +#define SDE_AUXD_CPT		(1 << 27)
> +#define SDE_AUXC_CPT		(1 << 26)
> +#define SDE_AUXB_CPT		(1 << 25)
> +#define SDE_AUX_MASK_CPT	(7 << 25)
>  #define SDE_PORTD_HOTPLUG_CPT	(1 << 23)
>  #define SDE_PORTC_HOTPLUG_CPT	(1 << 22)
>  #define SDE_PORTB_HOTPLUG_CPT	(1 << 21)
> +#define SDE_CRT_HOTPLUG_CPT	(1 << 19)
>  #define SDE_HOTPLUG_MASK_CPT	(SDE_CRT_HOTPLUG_CPT |		\
>  				 SDE_PORTD_HOTPLUG_CPT |	\
>  				 SDE_PORTC_HOTPLUG_CPT |	\
>  				 SDE_PORTB_HOTPLUG_CPT)
> +#define SDE_GMBUS_CPT		(1 << 17)
> +#define SDE_AUDIO_CP_REQ_C_CPT	(1 << 10)
> +#define SDE_AUDIO_CP_CHG_C_CPT	(1 << 9)
> +#define SDE_FDI_RXC_CPT		(1 << 8)
> +#define SDE_AUDIO_CP_REQ_B_CPT	(1 << 6)
> +#define SDE_AUDIO_CP_CHG_B_CPT	(1 << 5)
> +#define SDE_FDI_RXB_CPT		(1 << 4)
> +#define SDE_AUDIO_CP_REQ_A_CPT	(1 << 2)
> +#define SDE_AUDIO_CP_CHG_A_CPT	(1 << 1)
> +#define SDE_FDI_RXA_CPT		(1 << 0)
> +#define SDE_AUDIO_CP_REQ_CPT	(SDE_AUDIO_CP_REQ_C_CPT | \
> +				 SDE_AUDIO_CP_REQ_B_CPT | \
> +				 SDE_AUDIO_CP_REQ_A_CPT)
> +#define SDE_AUDIO_CP_CHG_CPT	(SDE_AUDIO_CP_CHG_C_CPT | \
> +				 SDE_AUDIO_CP_CHG_B_CPT | \
> +				 SDE_AUDIO_CP_CHG_A_CPT)
> +#define SDE_FDI_MASK_CPT	(SDE_FDI_RXC_CPT | \
> +				 SDE_FDI_RXB_CPT | \
> +				 SDE_FDI_RXA_CPT)
>  
>  #define SDEISR  0xc4000
>  #define SDEIMR  0xc4004
> -- 
> 1.7.7.6
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list