drm/i915/gen8: Add dynamic allocation macros and helper functions