On Thu, Jun 23, 2016 at 12:12:29PM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> > > Effectively removes one layer of indirection between the mask of > possible engines and the engine constructors. Instead of spelling > out in code the mapping of HAS_<engine> to constructors, makes > more use of the recently added data driven approach by putting > engine constructor vfuncs into the table as well. > > Effect is fewer lines of source and smaller binary. > > At the same time simplify the error handling since engine > destructors can run on unitialized engines anyway. > > Similar approach could be done for legacy submission is wanted. > > v2: Removed ugly BUILD_BUG_ONs in favour of newly introduced > ENGINE_MASK and HAS_ENGINE macros. > Also removed the forward declarations by shuffling functions > around. > > v3: Warn when logical_rings table does not contain enough data > and disable the engines which could not be initialized. > (Chris Wilson) I was happy with the BUILD_BUG suggestion :) > + for (i = 0; > + i < I915_NUM_ENGINES && i < ARRAY_SIZE(logical_rings); i++) { HAS_ENGINE() == false if i >= I915_NUM_ENGINES -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx