[Intel-gfx] [PATCH 8/9] drm/i915: Do not enable package C8 on unsupported hardware

Daniel Vetter daniel at ffwll.ch
Tue Nov 19 13:02:15 CET 2013


On Mon, Nov 18, 2013 at 06:32:37PM -0800, Rodrigo Vivi wrote:
> From: Chris Wilson <chris at chris-wilson.co.uk>
> 
> If the hardware does not support package C8, then do not even schedule
> work to enable it. Thereby we can eliminate a bunch of dangerous work.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Reviewed-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at gmail.com>

Ok, I've merged this and the previous patch. Paulo, care to follow up with
an is_ult or something like that in the intel_info struct? We don't really
care about is_mobile on recent platforms any more, but having an is_ult
sounds useful ...
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.h      |  1 +
>  drivers/gpu/drm/i915/intel_display.c | 15 +++++++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b12d942..bb6a302 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1791,6 +1791,7 @@ struct drm_i915_file_private {
>  #define HAS_POWER_WELL(dev)	(IS_HASWELL(dev))
>  #define HAS_FPGA_DBG_UNCLAIMED(dev)	(INTEL_INFO(dev)->has_fpga_dbg)
>  #define HAS_PSR(dev)		(IS_HASWELL(dev))
> +#define HAS_PC8(dev)		(IS_HASWELL(dev)) /* XXX HSW:ULX */
>  
>  #define INTEL_PCH_DEVICE_ID_MASK		0xff00
>  #define INTEL_PCH_IBX_DEVICE_ID_TYPE		0x3b00
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index cfcad82..b39d0df 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -6473,6 +6473,9 @@ static void __hsw_disable_package_c8(struct drm_i915_private *dev_priv)
>  
>  void hsw_enable_package_c8(struct drm_i915_private *dev_priv)
>  {
> +	if (!HAS_PC8(dev_priv->dev))
> +		return;
> +
>  	mutex_lock(&dev_priv->pc8.lock);
>  	__hsw_enable_package_c8(dev_priv);
>  	mutex_unlock(&dev_priv->pc8.lock);
> @@ -6480,6 +6483,9 @@ void hsw_enable_package_c8(struct drm_i915_private *dev_priv)
>  
>  void hsw_disable_package_c8(struct drm_i915_private *dev_priv)
>  {
> +	if (!HAS_PC8(dev_priv->dev))
> +		return;
> +
>  	mutex_lock(&dev_priv->pc8.lock);
>  	__hsw_disable_package_c8(dev_priv);
>  	mutex_unlock(&dev_priv->pc8.lock);
> @@ -6517,6 +6523,9 @@ static void hsw_update_package_c8(struct drm_device *dev)
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	bool allow;
>  
> +	if (!HAS_PC8(dev_priv->dev))
> +		return;
> +
>  	if (!i915_enable_pc8)
>  		return;
>  
> @@ -6540,6 +6549,9 @@ done:
>  
>  static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv)
>  {
> +	if (!HAS_PC8(dev_priv->dev))
> +		return;
> +
>  	mutex_lock(&dev_priv->pc8.lock);
>  	if (!dev_priv->pc8.gpu_idle) {
>  		dev_priv->pc8.gpu_idle = true;
> @@ -6550,6 +6562,9 @@ static void hsw_package_c8_gpu_idle(struct drm_i915_private *dev_priv)
>  
>  static void hsw_package_c8_gpu_busy(struct drm_i915_private *dev_priv)
>  {
> +	if (!HAS_PC8(dev_priv->dev))
> +		return;
> +
>  	mutex_lock(&dev_priv->pc8.lock);
>  	if (dev_priv->pc8.gpu_idle) {
>  		dev_priv->pc8.gpu_idle = false;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list