[Intel-gfx] [PATCH 44/53] drm/i915: Update ring->sync_to() to take a request structure

Tomas Elf tomas.elf at intel.com
Mon Mar 9 14:49:49 PDT 2015


On 19/02/2015 17:17, John.C.Harrison at Intel.com wrote:
> From: John Harrison <John.C.Harrison at Intel.com>
>
> Updated the ring->sync_to() implementations to take a request instead of a ring.
>
> For: VIZ-5115
> Signed-off-by: John Harrison <John.C.Harrison at Intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem.c         |    2 +-
>   drivers/gpu/drm/i915/intel_ringbuffer.c |    6 ++++--
>   drivers/gpu/drm/i915/intel_ringbuffer.h |    4 ++--
>   3 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 4f6e9ad..b5613ff 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2985,7 +2985,7 @@ i915_gem_object_sync(struct drm_i915_gem_object *obj,
>   		return ret;
>
>   	trace_i915_gem_ring_sync_to(from, to, obj->last_read_req);

trace_i915_gem_ring_sync_to() still takes a ring as argument instead of 
a request. Do you want to change the trace function to reflect your changes?

Thanks,
Tomas

> -	ret = to->semaphore.sync_to(to, from, seqno);
> +	ret = to->semaphore.sync_to(to_req, from, seqno);
>   	if (!ret)
>   		/* We use last_read_req because sync_to()
>   		 * might have just caused seqno wrap under
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 87612f1..767bab1 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1267,10 +1267,11 @@ static inline bool i915_gem_has_seqno_wrapped(struct drm_device *dev,
>    */
>
>   static int
> -gen8_ring_sync(struct intel_engine_cs *waiter,
> +gen8_ring_sync(struct drm_i915_gem_request *waiter_req,
>   	       struct intel_engine_cs *signaller,
>   	       u32 seqno)
>   {
> +	struct intel_engine_cs *waiter = waiter_req->ring;
>   	struct drm_i915_private *dev_priv = waiter->dev->dev_private;
>   	int ret;
>
> @@ -1292,10 +1293,11 @@ gen8_ring_sync(struct intel_engine_cs *waiter,
>   }
>
>   static int
> -gen6_ring_sync(struct intel_engine_cs *waiter,
> +gen6_ring_sync(struct drm_i915_gem_request *waiter_req,
>   	       struct intel_engine_cs *signaller,
>   	       u32 seqno)
>   {
> +	struct intel_engine_cs *waiter = waiter_req->ring;
>   	u32 dw1 = MI_SEMAPHORE_MBOX |
>   		  MI_SEMAPHORE_COMPARE |
>   		  MI_SEMAPHORE_REGISTER;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 1ff0ad1..65fe151 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -219,8 +219,8 @@ struct  intel_engine_cs {
>   		};
>
>   		/* AKA wait() */
> -		int	(*sync_to)(struct intel_engine_cs *ring,
> -				   struct intel_engine_cs *to,
> +		int	(*sync_to)(struct drm_i915_gem_request *to_req,
> +				   struct intel_engine_cs *from,
>   				   u32 seqno);
>   		int	(*signal)(struct intel_engine_cs *signaller,
>   				  /* num_dwords needed by caller */
>



More information about the Intel-gfx mailing list