Re: [RFC 4/8] drm/i915: Insert commands for capturing timestamps in the ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 05, 2015 at 11:25:40AM +0530, sourab.gupta@xxxxxxxxx wrote:
> From: Sourab Gupta <sourab.gupta@xxxxxxxxx>
> 
> This patch adds the routines through which one can insert commands in the
> ringbuf for capturing timestamps, which are used to insert these commands
> around the batchbuffer.
> 
> While inserting the commands, we keep a reference of associated request.
> This will be released when we are forwarding the samples to userspace
> (or when the event is being destroyed).
> Also, an active reference of the destination buffer is taken here, so that
> we can be assured that the buffer is freed up only after GPU is done with
> it, even if the local reference of the buffer is released.
> 
> v2: Changes (as suggested by Chris):
>     - Passing in 'request' struct for emit report function
>     - Removed multiple calls to i915_gem_obj_to_ggtt(). Keeping hold of
>       pinned vma from start and using when required.
>     - Better nomenclature, and error handling.
> 
> @@ -919,6 +993,7 @@ static int init_gen_pmu_buffer(struct perf_event *event)
>  	dev_priv->gen_pmu.buffer.obj = bo;
>  	dev_priv->gen_pmu.buffer.gtt_offset =
>  				i915_gem_obj_ggtt_offset(bo);
> +	dev_priv->gen_pmu.buffer.vma = i915_gem_obj_to_ggtt(bo);
>  	dev_priv->gen_pmu.buffer.addr = vmap_oa_buffer(bo);
>  	INIT_LIST_HEAD(&dev_priv->gen_pmu.node_list);

Still calling i915_gem_obj_to_ggtt(bo) twice! With pmu_buffer.vma you
can drop pmu_buffer.gtt_offset and never be confused again.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux