[Intel-gfx] [PATCH] drm/i915: Record the tail at each request and use it to estimate the head

Eugeni Dodonov eugeni at dodonov.net
Wed Feb 8 19:56:30 CET 2012


On Wed, Feb 8, 2012 at 16:06, Chris Wilson <chris at chris-wilson.co.uk> wrote:

> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1784,12 +1784,20 @@ i915_add_request(struct intel_ring_buffer *ring,
>  {
>        drm_i915_private_t *dev_priv = ring->dev->dev_private;
>        uint32_t seqno;
> +       u32 request_ring_position;
>        int was_empty;
>        int ret;
>
>        BUG_ON(request == NULL);
>        seqno = i915_gem_next_request_seqno(ring);
>
> +       /* Record the position of the start of the request so that
> +        * should we detect the updated seqno part-way through the
> +        * GPU processing the request, we never over-estimate the
> +        * position of the head.
> +        */
> +       request_ring_position = intel_ring_get_tail(ring);
>


Perhaps a stupid question within the bikeshedding spirit, but why do we
need intel_ring_get_tail()? Wouldn't just:

request_ring_position = ring->tail;

be self-explainable? Or some additional logic could be involved there at
some point?

But in overall, I like this, so:
Reviewed-by: Eugeni Dodonov <eugeni.dodonov at intel.com>

-- 
Eugeni Dodonov
<http://eugeni.dodonov.net/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120208/4db9df07/attachment.html>


More information about the Intel-gfx mailing list