[Intel-gfx] [PATCH] drm/i915: Remove two sloppy inline functions from .h

Chris Wilson chris at chris-wilson.co.uk
Mon Nov 7 16:27:01 UTC 2016


On Mon, Nov 07, 2016 at 06:13:20PM +0200, Joonas Lahtinen wrote:
> Get rid of sloppy inline functions now that we don't have more users:
> 
> i915_gem_request_get_seqno
> i915_gem_request_get_engine
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c     |  4 ++--
>  drivers/gpu/drm/i915/i915_gem_request.h | 12 ------------
>  drivers/gpu/drm/i915/i915_gpu_error.c   | 11 +++++++----
>  3 files changed, 9 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index bc9c0cd..960ccea 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -547,11 +547,11 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
>  					   pipe, plane);
>  			}
>  			if (work->flip_queued_req) {
> -				struct intel_engine_cs *engine = i915_gem_request_get_engine(work->flip_queued_req);
> +				struct intel_engine_cs *engine = work->flip_queued_req->engine;
>  
>  				seq_printf(m, "Flip queued on %s at seqno %x, next seqno %x [current breadcrumb %x], completed? %d\n",
>  					   engine->name,
> -					   i915_gem_request_get_seqno(work->flip_queued_req),
> +					   work->flip_queued_req->global_seqno,
>  					   atomic_read(&dev_priv->gt.global_timeline.next_seqno),
>  					   intel_engine_get_seqno(engine),
>  					   i915_gem_request_completed(work->flip_queued_req));
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
> index 75f8360..0f69fad 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.h
> +++ b/drivers/gpu/drm/i915/i915_gem_request.h
> @@ -162,18 +162,6 @@ int i915_gem_request_add_to_client(struct drm_i915_gem_request *req,
>  				   struct drm_file *file);
>  void i915_gem_request_retire_upto(struct drm_i915_gem_request *req);
>  
> -static inline u32
> -i915_gem_request_get_seqno(struct drm_i915_gem_request *req)
> -{
> -	return req ? req->global_seqno : 0;
> -}
> -
> -static inline struct intel_engine_cs *
> -i915_gem_request_get_engine(struct drm_i915_gem_request *req)
> -{
> -	return req ? req->engine : NULL;
> -}
> -
>  static inline struct drm_i915_gem_request *
>  to_request(struct dma_fence *fence)
>  {
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index 204093f..ec05c8e 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -861,16 +861,19 @@ i915_error_object_create(struct drm_i915_private *i915,
>  static inline uint32_t
>  __active_get_seqno(struct i915_gem_active *active)
>  {
> -	return i915_gem_request_get_seqno(__i915_gem_active_peek(active));
> +	struct drm_i915_gem_request *request;
> +
> +	request = __i915_gem_active_peek(active);
> +	return request ? request->global_seqno : 0;
>  }
>  
>  static inline int
>  __active_get_engine_id(struct i915_gem_active *active)
>  {
> -	struct intel_engine_cs *engine;
> +	struct drm_i915_gem_request *request;
>  
> -	engine = i915_gem_request_get_engine(__i915_gem_active_peek(active));
> -	return engine ? engine->id : -1;
> +	request = __i915_gem_active_peek(active);
> +	return request && request->engine ? request->engine->id : -1;

return request ? request->engine->id : -1;

Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

Happy to see them go. Note how global_seqno may be meaningless... And
how unhelpful get_seqno really was. For gpu error we need to start
tracking the context:seqno of the submitter. When I see a bug with
seqno = 0, I guess I will be tempted to write the patch.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list