[Intel-gfx] [PATCH 12/13] drm/i915: Sort the shadow register table
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Fri Sep 30 09:06:06 UTC 2016
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
More information about the Intel-gfx
mailing list