unsigned long *engine;
/** @wa_active.lrc: bitmap with active LRC workarounds */
unsigned long *lrc;
- /** @wa_active.oob: bitmap with active OOB workaroudns */
+ /** @wa_active.oob: bitmap with active OOB workarounds */
unsigned long *oob;
+ /**
+ * @wa_active.oob_initialized: mark oob as initialized to help
+ * detecting misuse of XE_WA() - it can only be called on
+ * initialization after OOB WAs have being processed
+ */
+ bool oob_initialized;
} wa_active;
/** @user_engines: engines present in GT and available to userspace */
xe_rtp_process_ctx_enable_active_tracking(&ctx, gt->wa_active.oob,
ARRAY_SIZE(oob_was));
+ gt->wa_active.oob_initialized = true;
xe_rtp_process(&ctx, oob_was);
}
#ifndef _XE_WA_
#define _XE_WA_
+#include "xe_assert.h"
+
struct drm_printer;
struct xe_gt;
struct xe_hw_engine;
* @gt__: gt instance
* @id__: XE_OOB_<id__>, as generated by build system in generated/xe_wa_oob.h
*/
-#define XE_WA(gt__, id__) test_bit(XE_WA_OOB_ ## id__, (gt__)->wa_active.oob)
+#define XE_WA(gt__, id__) ({ \
+ xe_gt_assert(gt__, (gt__)->wa_active.oob_initialized); \
+ test_bit(XE_WA_OOB_ ## id__, (gt__)->wa_active.oob); \
+})
#endif