[Intel-gfx] [PATCH 4/5] drm/i915: Split the engine info table in two levels, using class + instance

Michal Wajdeczko michal.wajdeczko at intel.com
Fri Apr 7 16:27:34 UTC 2017


On Fri, Apr 07, 2017 at 02:15:48AM -0700, Oscar Mateo wrote:
> There are some properties that logically belong to the engine class, and some
> that belong to the engine instance. Make it explicit.
> 
> v2: Commit message (Tvrtko)
> 
> v3:
>   - Rebased
>   - Exec/uabi id should be per instance (Chris)
> 
> v4:
>   - Rebased
>   - Avoid re-ordering fields for smaller diff (Tvrtko)
>   - Bug on oob access to the class array (Michal)
> 
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
> ---

<snip>

> @@ -99,8 +112,12 @@
>  		   enum intel_engine_id id)
>  {
>  	const struct engine_info *info = &intel_engines[id];
> +	const struct engine_class_info *class_info;
>  	struct intel_engine_cs *engine;
>  
> +	GEM_BUG_ON(info->class > ARRAY_SIZE(intel_engine_classes));
> +	class_info = &intel_engine_classes[info->class];
> +

Hmm, I think we should check against info->class >= ARRAY_SIZE, as
index 4 can't be used on array[4]

-Michal



More information about the Intel-gfx mailing list