[Intel-gfx] [PATCH 3/3] drm/i915: drop code duplication in favor of asle interrupt handler

Damien Lespiau damien.lespiau at intel.com
Wed Apr 24 20:23:51 CEST 2013


On Fri, Apr 12, 2013 at 03:20:58PM +0300, Jani Nikula wrote:
> With the previous work asle and gse interrupt handlers should now be
> functionally the same. Drop the duplicated code.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h       |    1 -
>  drivers/gpu/drm/i915/i915_irq.c       |    4 ++--
>  drivers/gpu/drm/i915/intel_opregion.c |   37 ---------------------------------
>  3 files changed, 2 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b5a495a..aec9377 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1810,7 +1810,6 @@ extern int intel_opregion_setup(struct drm_device *dev);
>  extern void intel_opregion_init(struct drm_device *dev);
>  extern void intel_opregion_fini(struct drm_device *dev);
>  extern void intel_opregion_asle_intr(struct drm_device *dev);
> -extern void intel_opregion_gse_intr(struct drm_device *dev);
>  extern void intel_opregion_enable_asle(struct drm_device *dev);
>  #else
>  static inline void intel_opregion_init(struct drm_device *dev) { return; }

You also need to drop the intel_opregion_gse_intr() in the !CONFIG_ACPI
path.

> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index e97bbb2..269f1a1 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -792,7 +792,7 @@ static irqreturn_t ivybridge_irq_handler(int irq, void *arg)
>  			dp_aux_irq_handler(dev);
>  
>  		if (de_iir & DE_GSE_IVB)
> -			intel_opregion_gse_intr(dev);
> +			intel_opregion_asle_intr(dev);
>  
>  		for (i = 0; i < 3; i++) {
>  			if (de_iir & (DE_PIPEA_VBLANK_IVB << (5 * i)))
> @@ -886,7 +886,7 @@ static irqreturn_t ironlake_irq_handler(int irq, void *arg)
>  		dp_aux_irq_handler(dev);
>  
>  	if (de_iir & DE_GSE)
> -		intel_opregion_gse_intr(dev);
> +		intel_opregion_asle_intr(dev);
>  
>  	if (de_iir & DE_PIPEA_VBLANK)
>  		drm_handle_vblank(dev, 0);
> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
> index c3a288e..3e22cea 100644
> --- a/drivers/gpu/drm/i915/intel_opregion.c
> +++ b/drivers/gpu/drm/i915/intel_opregion.c
> @@ -224,43 +224,6 @@ void intel_opregion_asle_intr(struct drm_device *dev)
>  	iowrite32(asle_stat, &asle->aslc);
>  }
>  
> -void intel_opregion_gse_intr(struct drm_device *dev)
> -{
> -	struct drm_i915_private *dev_priv = dev->dev_private;
> -	struct opregion_asle __iomem *asle = dev_priv->opregion.asle;
> -	u32 asle_stat = 0;
> -	u32 asle_req;
> -
> -	if (!asle)
> -		return;
> -
> -	asle_req = ioread32(&asle->aslc) & ASLE_REQ_MSK;
> -
> -	if (!asle_req) {
> -		DRM_DEBUG_DRIVER("non asle set request??\n");
> -		return;
> -	}
> -
> -	if (asle_req & ASLE_SET_ALS_ILLUM) {
> -		DRM_DEBUG_DRIVER("Illum is not supported\n");
> -		asle_stat |= ASLE_ALS_ILLUM_FAILED;
> -	}
> -
> -	if (asle_req & ASLE_SET_BACKLIGHT)
> -		asle_stat |= asle_set_backlight(dev, ioread32(&asle->bclp));
> -
> -	if (asle_req & ASLE_SET_PFIT) {
> -		DRM_DEBUG_DRIVER("Pfit is not supported\n");
> -		asle_stat |= ASLE_PFIT_FAILED;
> -	}
> -
> -	if (asle_req & ASLE_SET_PWM_FREQ) {
> -		DRM_DEBUG_DRIVER("PWM freq is not supported\n");
> -		asle_stat |= ASLE_PWM_FREQ_FAILED;
> -	}
> -
> -	iowrite32(asle_stat, &asle->aslc);
> -}
>  #define ASLE_ALS_EN    (1<<0)
>  #define ASLE_BLC_EN    (1<<1)
>  #define ASLE_PFIT_EN   (1<<2)
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



More information about the Intel-gfx mailing list