Skip to content

Commit 73a6c67

Browse files
ickletursulin
authored andcommitted
drm/i915/gt: Add selftests for TLB invalidation
Check that we invalidate the TLB cache, the updated physical addresses are immediately visible to the HW, and there is no retention of the old physical address for concurrent HW access. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> [ahajda: adjust to upstream driver, v2+] Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> [tursulin: Small indentation fix.] Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230130165058.1647414-1-andrzej.hajda@intel.com
1 parent 003e11e commit 73a6c67

File tree

4 files changed

+394
-0
lines changed

4 files changed

+394
-0
lines changed

drivers/gpu/drm/i915/gt/intel_gpu_commands.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@
394394
#define MI_LOAD_URB_MEM MI_INSTR(0x2C, 0)
395395
#define MI_STORE_URB_MEM MI_INSTR(0x2D, 0)
396396
#define MI_CONDITIONAL_BATCH_BUFFER_END MI_INSTR(0x36, 0)
397+
#define MI_DO_COMPARE REG_BIT(21)
397398

398399
#define STATE_BASE_ADDRESS \
399400
((0x3 << 29) | (0x0 << 27) | (0x1 << 24) | (0x1 << 16))

drivers/gpu/drm/i915/gt/intel_gt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,3 +1205,7 @@ void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno)
12051205
mutex_unlock(&gt->tlb.invalidate_lock);
12061206
}
12071207
}
1208+
1209+
#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
1210+
#include "selftest_tlb.c"
1211+
#endif

0 commit comments

Comments
 (0)