[Intel-gfx] [RFC 05/39] drm/i915: Split i915_dem_do_execbuffer() in half

Daniel Vetter daniel at ffwll.ch
Tue Jul 21 01:00:33 PDT 2015


On Fri, Jul 17, 2015 at 03:33:14PM +0100, John.C.Harrison at Intel.com wrote:
> From: John Harrison <John.C.Harrison at Intel.com>
> 
> Split the execbuffer() function in half. The first half collects and validates
> all the information requried to process the batch buffer. It also does all the
> object pinning, relocations, active list management, etc - basically anything
> that must be done upfront before the IOCTL returns and allows the user land side
> to start changing/freeing things. The second half does the actual ring
> submission.
> 
> This change implements the split but leaves the back half being called directly
> from the end of the front half.
> 
> Change-Id: I5e1c77639ce526ab2401b0323186c518bf13da0a
> For: VIZ-1587
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h            |  11 +++
>  drivers/gpu/drm/i915/i915_gem.c            |   2 +
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 130 ++++++++++++++++++++---------
>  drivers/gpu/drm/i915/intel_lrc.c           |  58 +++++++++----
>  drivers/gpu/drm/i915/intel_lrc.h           |   1 +
>  5 files changed, 147 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 289ddd6..28d51ac 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1684,10 +1684,18 @@ struct i915_execbuffer_params {
>  	struct drm_device               *dev;
>  	struct drm_file                 *file;
>  	uint32_t                        dispatch_flags;
> +	uint32_t                        args_flags;
>  	uint32_t                        args_batch_start_offset;
> +	uint32_t                        args_batch_len;
> +	uint32_t                        args_num_cliprects;
> +	uint32_t                        args_DR1;
> +	uint32_t                        args_DR4;
>  	uint32_t                        batch_obj_vm_offset;
>  	struct intel_engine_cs          *ring;
>  	struct drm_i915_gem_object      *batch_obj;
> +	struct drm_clip_rect            *cliprects;
> +	uint32_t                        instp_mask;
> +	int                             instp_mode;
>  	struct intel_context            *ctx;
>  	struct drm_i915_gem_request     *request;
>  };
> @@ -1929,6 +1937,7 @@ struct drm_i915_private {
>  		int (*execbuf_submit)(struct i915_execbuffer_params *params,
>  				      struct drm_i915_gem_execbuffer2 *args,
>  				      struct list_head *vmas);
> +		int (*execbuf_final)(struct i915_execbuffer_params *params);

No need for this vfunc since you only call this from specialized and not
generic code.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list