[Intel-gfx] [PATCH] drm/i915: Move the common engine cleanup to intel_engine_cs.c

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Aug 3 12:52:31 UTC 2016


On ke, 2016-08-03 at 13:19 +0100, Chris Wilson wrote:
> Now that we initialize the state to both legacy and execlists inside
> intel_engine_cs, we should also clean up that state from the common
> functions.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c  | 14 ++++++++++++++
>  drivers/gpu/drm/i915/intel_lrc.c        |  5 +----
>  drivers/gpu/drm/i915/intel_ringbuffer.c |  4 +---
>  drivers/gpu/drm/i915/intel_ringbuffer.h |  1 +
>  4 files changed, 17 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index b18f8c9a600c..3e37a122ad73 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -213,3 +213,17 @@ int intel_engine_init_common(struct intel_engine_cs *engine)
>  
>  	return intel_engine_init_cmd_parser(engine);
>  }
> +
> +/**
> + * intel_engines_cleanup_common - cleans up the engine state created by
> + *                                the common initiailizers.
> + * @engine: Engine to cleanup.
> + *
> + * This cleans up everything created by the common helpers.
> + */
> +void intel_engine_cleanup_common(struct intel_engine_cs *engine)
> +{
> +	intel_engine_cleanup_cmd_parser(engine);
> +	intel_engine_fini_breadcrumbs(engine);
> +	i915_gem_batch_pool_fini(&engine->batch_pool);

The order of calls is changed, this being the more correct, but having
faith on CI and;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list