Commit 5669899e authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi

drm/xe: Add has_asid to device info

Rather than alias supports_usm to ASIS support, add an explicit
variable to indicate ASID support.
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
parent 9f9f09d4
......@@ -81,6 +81,8 @@ struct xe_device {
u8 media_ver;
/** @supports_usm: Supports unified shared memory */
bool supports_usm;
/** @has_asid: Has address space ID */
bool has_asid;
/** @enable_guc: GuC submission enabled */
bool enable_guc;
/** @has_flat_ccs: Whether flat CCS metadata is used */
......
......@@ -682,14 +682,14 @@ int xe_lrc_init(struct xe_lrc *lrc, struct xe_hw_engine *hwe,
xe_lrc_write_ctx_reg(lrc, CTX_RING_TAIL, lrc->ring.tail);
xe_lrc_write_ctx_reg(lrc, CTX_RING_CTL,
RING_CTL_SIZE(lrc->ring.size) | RING_VALID);
if (xe->info.supports_usm && vm) {
if (xe->info.has_asid && vm)
xe_lrc_write_ctx_reg(lrc, PVC_CTX_ASID,
(e->usm.acc_granularity <<
ACC_GRANULARITY_S) | vm->usm.asid);
if (xe->info.supports_usm && vm)
xe_lrc_write_ctx_reg(lrc, PVC_CTX_ACC_CTR_THOLD,
(e->usm.acc_notify << ACC_NOTIFY_S) |
e->usm.acc_trigger);
}
lrc->desc = GEN8_CTX_VALID;
lrc->desc |= INTEL_LEGACY_64B_CONTEXT << GEN8_CTX_ADDRESSING_MODE_SHIFT;
......
......@@ -71,6 +71,7 @@ struct xe_device_desc {
bool has_flat_ccs;
bool has_4tile;
bool has_range_tlb_invalidation;
bool has_asid;
};
#define PLATFORM(x) \
......@@ -225,6 +226,7 @@ static const __maybe_unused struct xe_device_desc pvc_desc = {
.max_tiles = 2,
.vm_max_level = 4,
.supports_usm = true,
.has_asid = true,
};
#define MTL_MEDIA_ENGINES \
......@@ -408,6 +410,7 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
xe->info.vm_max_level = desc->vm_max_level;
xe->info.media_ver = desc->media_ver;
xe->info.supports_usm = desc->supports_usm;
xe->info.has_asid = desc->has_asid;
xe->info.has_flat_ccs = desc->has_flat_ccs;
xe->info.has_4tile = desc->has_4tile;
xe->info.has_range_tlb_invalidation = desc->has_range_tlb_invalidation;
......
......@@ -1429,7 +1429,7 @@ static void vm_destroy_work_func(struct work_struct *w)
xe_device_mem_access_put(xe);
xe_pm_runtime_put(xe);
if (xe->info.supports_usm) {
if (xe->info.has_asid) {
mutex_lock(&xe->usm.lock);
lookup = xa_erase(&xe->usm.asid_to_vm, vm->usm.asid);
XE_WARN_ON(lookup != vm);
......@@ -1926,7 +1926,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
return err;
}
if (xe->info.supports_usm) {
if (xe->info.has_asid) {
mutex_lock(&xe->usm.lock);
err = xa_alloc_cyclic(&xe->usm.asid_to_vm, &asid, vm,
XA_LIMIT(0, XE_MAX_ASID - 1),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment