[Intel-gfx] [PATCH 12/22] drm/i915: Start passing around i915_vma from execbuffer

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri Jul 29 08:23:43 UTC 2016


On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote:

> +	if (i915_vma_misplaced(vma, size, alignment, flags)) {
> +		if (flags & PIN_NONBLOCK &&
> +		    (i915_vma_is_pinned(vma) || i915_vma_is_active(vma)))
> +			return -ENOSPC;

Why ENOSPC when active? Would not EAGAIN be more appropriate?
 
>  void
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 9ea99e181997..a0759fe613f8 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -45,11 +45,10 @@
>  struct i915_execbuffer_params {
>  	struct drm_device               *dev;
>  	struct drm_file                 *file;
> -	u32				 dispatch_flags;
> -	u32				 args_batch_start_offset;
> -	u32				 batch_obj_vm_offset;
> +	struct i915_vma			*batch;
> +	u32				dispatch_flags;
> +	u32				args_batch_start_offset;

Remove the superfluous indent altogether.

>  	struct intel_engine_cs          *engine;
> -	struct drm_i915_gem_object      *batch_obj;
>  	struct i915_gem_context         *ctx;
>  	struct drm_i915_gem_request     *request;
>  };
> @@ -102,6 +101,26 @@ eb_reset(struct eb_vmas *eb)
>  		memset(eb->buckets, 0, (eb->and+1)*sizeof(struct hlist_head));
>  }
>  
> +static struct i915_vma *
> +eb_get_batch(struct eb_vmas *eb)
> +{

Could have migrated the comment here;

/* The batch is always the LAST item in the VMA list */ 

Other than that,

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list