[Intel-gfx] [PATCH 4/7] drm/i915: Allow i915_gem_setup_global_gtt to fail

Chris Wilson chris at chris-wilson.co.uk
Thu Jul 31 08:49:50 CEST 2014


On Wed, Jul 30, 2014 at 09:42:01PM +0200, Daniel Vetter wrote:
> We already needs this just as a safety check in case the preallocation
> reservation dance fails. But we definitely need this to be able to
> move tha aliasing ppgtt setup back out of the context code to this
> place, where it belongs.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_gem.c     |  7 ++++++-
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 16 ++++++++++------
>  drivers/gpu/drm/i915/i915_gem_gtt.h |  4 ++--
>  3 files changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index f4e57fe05c6a..d8399ee622b9 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4762,7 +4762,12 @@ int i915_gem_init(struct drm_device *dev)
>  			DRM_DEBUG_DRIVER("allow wake ack timed out\n");
>  	}
>  
> -	i915_gem_init_userptr(dev);
> +	ret = i915_gem_init_userptr(dev);
> +	if (ret) {

Just throw an error and keep on initialising. Optional features like
this and stolen, we can keep going - so we should drop the error code
return entirely for a better error message when we disable the feature.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list