[Intel-gfx] [PATCH v2] drm/i915: Avoid snooping with userptr where not supported

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 2 11:30:02 UTC 2016


On Wed, Mar 02, 2016 at 10:16:34AM +0000, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
>    commit e5756c10d841ddb448293c849392f3d6b809561f
>    Author: Imre Deak <imre.deak at intel.com>
>    Date:   Fri Aug 14 18:43:30 2015 +0300
> 
>        drm/i915/bxt: don't allow cached GEM mappings on A stepping
> 
> Added an exception of disallowing snooping for Broxton A
> stepping hardware but userptr was still enabling it regardless.
> 
> Move the check to HAS_SNOOP now that it is used from multiple
> call sites and use it.
> 
> v2: Userptr cannot be supported when it cannot be coherent and
>     generalize the code better. (Chris Wilson)
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Imre Deak <imre.deak at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_dma.c         | 3 +++
>  drivers/gpu/drm/i915/i915_drv.h         | 2 ++
>  drivers/gpu/drm/i915/i915_gem.c         | 2 +-
>  drivers/gpu/drm/i915/i915_gem_userptr.c | 7 +++++++
>  4 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 36c0cf131e93..615935e6fa3f 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -853,6 +853,9 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
>  	else if (INTEL_INFO(dev)->gen >= 9)
>  		gen9_sseu_info_init(dev);
>  
> +	/* Snooping is broken on BXT A stepping. */
	info->has_snoop = !info->has_llc;
> +	info->has_snoop &= !IS_BXT_REVID(dev, 0, BXT_REVID_A1);

LLC and FSB-snooping are two very different coherency protocols and I do
believe it is important that we avoid conflating the two.

With that change,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list