[Intel-gfx] [PATCH 5/5] drm/i915: Always flush tiling changes before accessing through the GTT

Daniel Vetter daniel at ffwll.ch
Sun Apr 15 00:00:35 CEST 2012


On Sat, Apr 14, 2012 at 09:55:51AM +0100, Chris Wilson wrote:
> As we defer updating the fence register from set-tiling to the point of
> use, we need to declare every access through the GTT as either fenced or
> unfenced.
> 
> This patches fixes an old bug in the execbuffer relocation processing
> which could conceivably be hit by a pathological userspace.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Indeed, my git history digging got lost and given how we upload buffers I
don't think there's any chance we can hit this, so no i-g-t test
necessary.
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 2a24d0c..1a0d54f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -381,7 +381,11 @@ i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
>  		uint32_t __iomem *reloc_entry;
>  		void __iomem *reloc_page;
>  
> -		ret = i915_gem_object_set_to_gtt_domain(obj, 1);
> +		ret = i915_gem_object_set_to_gtt_domain(obj, true);
> +		if (ret)
> +			return ret;
> +
> +		ret = i915_gem_object_put_fence(obj);
>  		if (ret)
>  			return ret;
>  
> -- 
> 1.7.10
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list