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@xxxxxxxxx> > Cc: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx> > Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx> > Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> > Signed-off-by: Oscar Mateo <oscar.mateo@xxxxxxxxx> > --- <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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx