[Intel-gfx] [PATCH] drm/i915: De-inline intel_context_init()

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Thu Jan 24 09:12:34 UTC 2019


On 24/01/2019 08:37, Chris Wilson wrote:
> Nip some inline spaghetti in the bud before the problem gets too bad.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/i915_gem_context.c | 8 ++++++++
>   drivers/gpu/drm/i915/i915_gem_context.h | 7 ++-----
>   2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index fae68c4c4683..93e84751370f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -321,6 +321,14 @@ static u32 default_desc_template(const struct drm_i915_private *i915,
>   	return desc;
>   }
>   
> +void
> +intel_context_init(struct intel_context *ce,
> +		   struct i915_gem_context *ctx,
> +		   struct intel_engine_cs *engine)
> +{
> +	ce->gem_context = ctx;
> +}
> +
>   static struct i915_gem_context *
>   __create_hw_context(struct drm_i915_private *dev_priv,
>   		    struct drm_i915_file_private *file_priv)
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.h b/drivers/gpu/drm/i915/i915_gem_context.h
> index 47d82ce7ba6a..096d57958247 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.h
> +++ b/drivers/gpu/drm/i915/i915_gem_context.h
> @@ -364,12 +364,9 @@ static inline void i915_gem_context_put(struct i915_gem_context *ctx)
>   	kref_put(&ctx->ref, i915_gem_context_release);
>   }
>   
> -static inline void
> +void
>   intel_context_init(struct intel_context *ce,
>   		   struct i915_gem_context *ctx,
> -		   struct intel_engine_cs *engine)
> -{
> -	ce->gem_context = ctx;
> -}
> +		   struct intel_engine_cs *engine);
>   
>   #endif /* !__I915_GEM_CONTEXT_H__ */
> 

I guess that will be more robust.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Finger crossed for a quick CI pass since I'll delay the SSEU rebase 
until this gets in.

Regards,

Tvrtko


More information about the Intel-gfx mailing list