[Intel-gfx] [PATCH] Implement batch and ring buffer dumping

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 13 10:31:09 CET 2009


On Tue, 2009-02-03 at 17:06 -0500, Ben Gamari wrote:
> ---
>  drivers/gpu/drm/i915/i915_drv.h         |   14 ++++
>  drivers/gpu/drm/i915/i915_gem.c         |   17 +++---
>  drivers/gpu/drm/i915/i915_gem_debugfs.c |  102 +++++++++++++++++++++++++++++++
>  3 files changed, 125 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index f8abc79..53e169c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -374,6 +374,15 @@ typedef struct drm_i915_private {
>  
>  		/* storage for physical objects */
>  		struct drm_i915_gem_phys_object *phys_objs[I915_MAX_PHYS_OBJECT];
> +
> +		/**
> +		 * Ring buffer for recently submitted batch buffer objects
> +		 * This is for keeping track of batch buffers referenced while
> +		 * dumping the ring buffer
> +		 */
> +#define I915_GEM_RECENT_BATCH_LEN 10
> +		struct drm_gem_object *recent_batch_list[I915_GEM_RECENT_BATCH_LEN];
> +		int recent_batch_head;
>  	} mm;
>  } drm_i915_private_t;

When I used this in anger, the problem I encountered was that storing
the last 10 *submitted* batches was not enough to cache the currently
executing batch buffer. Can I suggest that instead of maintaining a ring
of recently submitted batches, we just dump the contents of any buffer
in the active list that has COMMAND_DOMAIN in its read_domains? Just a
single file under /dri and include a single line header to mark the
boundaries of each buffer.
-ickle




More information about the Intel-gfx mailing list