[Intel-gfx] [PATCH 4/6] drm/i915: Introduce i915_has_asle()

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Mar 19 13:27:22 UTC 2019


On 18/03/2019 16:56, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> We want to allow the desktop PNV to not have .is_mobile set. To
> that end let's add a small helper to determine if the platform
> has the ASLE interrupt (or equivalent). Supposdely both PNV
> variants have it.
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_irq.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 82d487189a34..1375bba45548 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -748,13 +748,21 @@ void i915_disable_pipestat(struct drm_i915_private *dev_priv,
>   	POSTING_READ(reg);
>   }
>   
> +static bool i915_has_asle(struct drm_i915_private *dev_priv)
> +{
> +	if (!dev_priv->opregion.asle)
> +		return false;
> +
> +	return IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv);
> +}
> +
>   /**
>    * i915_enable_asle_pipestat - enable ASLE pipestat for OpRegion
>    * @dev_priv: i915 device private
>    */
>   static void i915_enable_asle_pipestat(struct drm_i915_private *dev_priv)
>   {
> -	if (!dev_priv->opregion.asle || !IS_MOBILE(dev_priv))
> +	if (!i915_has_asle(dev_priv))
>   		return;
>   
>   	spin_lock_irq(&dev_priv->irq_lock);
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list