[PATCH 12/28] drm/i915: add more clock gating for VLV, allow force wake at init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 01, 2013 at 01:14:15PM -0800, Jesse Barnes wrote:
> From: Ben Widawsky <ben at bwidawsk.net>
> 
> Disable all Gunit clock gating and make set the "allow force wake" bit.
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

Can we make the in-code comments here a bit louder to explain that this is
pre-production w/a stuff which should be killed eventually?
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem.c |    4 ++++
>  drivers/gpu/drm/i915/i915_reg.h |    1 +
>  drivers/gpu/drm/i915/intel_pm.c |   10 +++++++++-
>  3 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 8413ffc..dd67698 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4010,7 +4010,11 @@ int i915_gem_init(struct drm_device *dev)
>  	int ret;
>  
>  	mutex_lock(&dev->struct_mutex);
> +
> +	/* VLVA0 (potential hack), BIOS isn't actually waking us */
> +	I915_WRITE(VLV_GTLC_WAKE_CTRL, 1);
>  	i915_gem_init_global_gtt(dev);
> +
>  	ret = i915_gem_init_hw(dev);
>  	mutex_unlock(&dev->struct_mutex);
>  	if (ret) {
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 4c45e91..ecf5f30 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -4276,6 +4276,7 @@
>  #define  FORCEWAKE_ACK_VLV			0x1300b4
>  #define  FORCEWAKE_ACK_HSW			0x130044
>  #define  FORCEWAKE_ACK				0x130090
> +#define  VLV_GTLC_WAKE_CTRL			0x130090
>  #define  FORCEWAKE_MT				0xa188 /* multi-threaded */
>  #define   FORCEWAKE_KERNEL			0x1
>  #define   FORCEWAKE_USER			0x2
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index d6d028a..7de8cec 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3991,7 +3991,15 @@ static void valleyview_init_clock_gating(struct drm_device *dev)
>  	 * Disable clock gating on th GCFG unit to prevent a delay
>  	 * in the reporting of vblank events.
>  	 */
> -	I915_WRITE(VLV_GUNIT_CLOCK_GATE, GCFG_DIS);
> +	/* VLVA0 HACK */
> +	I915_WRITE(VLV_GUNIT_CLOCK_GATE, 0xffffffff);
> +	I915_WRITE(0x9400, 0xffffffff);
> +	I915_WRITE(0x9404, 0xffffffff);
> +	I915_WRITE(0x9408, 0xffffffff);
> +	I915_WRITE(0x940c, 0xffffffff);
> +	I915_WRITE(0x9410, 0xffffffff);
> +	I915_WRITE(0x9414, 0xffffffff);
> +	I915_WRITE(0x9418, 0xffffffff);
>  }
>  
>  static void g4x_init_clock_gating(struct drm_device *dev)
> -- 
> 1.7.9.5
> 
> _______________________________________________
> 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


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux