Skip to content

Commit

Permalink
drm/i915/gt: Add selftests for TLB invalidation
Browse files Browse the repository at this point in the history
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 <[email protected]>
[ahajda: adjust to upstream driver, v2+]
Signed-off-by: Andrzej Hajda <[email protected]>
Reviewed-by: Tvrtko Ursulin <[email protected]>
[tursulin: Small indentation fix.]
Signed-off-by: Tvrtko Ursulin <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ickle authored and tursulin committed Feb 1, 2023
1 parent 003e11e commit 73a6c67
Show file tree
Hide file tree
Showing 4 changed files with 394 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/gt/intel_gpu_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
#define MI_LOAD_URB_MEM MI_INSTR(0x2C, 0)
#define MI_STORE_URB_MEM MI_INSTR(0x2D, 0)
#define MI_CONDITIONAL_BATCH_BUFFER_END MI_INSTR(0x36, 0)
#define MI_DO_COMPARE REG_BIT(21)

#define STATE_BASE_ADDRESS \
((0x3 << 29) | (0x0 << 27) | (0x1 << 24) | (0x1 << 16))
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,3 +1205,7 @@ void intel_gt_invalidate_tlb(struct intel_gt *gt, u32 seqno)
mutex_unlock(&gt->tlb.invalidate_lock);
}
}

#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "selftest_tlb.c"
#endif
Loading

0 comments on commit 73a6c67

Please sign in to comment.