On 30/09/2016 09:09, Joonas Lahtinen wrote:
On to, 2016-09-29 at 16:35 +0100, Tvrtko Ursulin wrote:
+static void intel_shadow_table_check(void)
+{
+ i915_reg_t *reg = (i915_reg_t *)gen8_shadowed_regs;
+ s32 prev = -1;
+ u32 offset;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(gen8_shadowed_regs); i++, reg++) {
+ offset = i915_mmio_reg_offset(*reg);
+ WARN_ON_ONCE(prev >= (s32)offset);
+ prev = offset;
+ }
+}
+
BUILD_BUG_ON would gain extra points, but this is fine too :)
It is possible to do that, how?
Opinions of whether these checks should always be there or maybe under
#ifdef CONFIG_DRM_I915_DEBUG perhaps?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx