#ifndef _XE_CPU_BIND_H_
#define _XE_CPU_BIND_H_
#include <linux/types.h>
struct dma_fence;
struct iosys_map;
struct xe_cpu_bind;
struct xe_cpu_bind_pt_update;
struct xe_device;
struct xe_tlb_inval_job;
struct xe_tile;
struct xe_vm;
struct xe_vm_pgtable_update;
struct xe_vm_pgtable_update_op;
struct xe_vma_ops;
struct xe_cpu_bind_pt_update_ops {
void (*populate)(struct xe_tile *tile, struct iosys_map *map,
const struct xe_vm_pgtable_update *update);
void (*clear)(struct xe_vm *vm, struct xe_tile *tile,
struct iosys_map *map,
const struct xe_vm_pgtable_update *update);
int (*pre_commit)(struct xe_cpu_bind_pt_update *pt_update);
};
struct xe_cpu_bind_pt_update {
const struct xe_cpu_bind_pt_update_ops *ops;
struct xe_vma_ops *vops;
struct xe_sched_job *job;
#define XE_CPU_BIND_INVAL_JOB_COUNT 4
struct xe_tlb_inval_job *ijobs[XE_CPU_BIND_INVAL_JOB_COUNT];
};
int xe_cpu_bind_init(struct xe_device *xe);
struct xe_exec_queue *xe_cpu_bind_queue(struct xe_cpu_bind *cpu_bind);
void
xe_cpu_bind_update_pgtables_execute(struct xe_vm *vm, struct xe_tile *tile,
const struct xe_cpu_bind_pt_update_ops *ops,
struct xe_vm_pgtable_update_op *pt_op,
u32 num_ops, bool force_clear);
struct dma_fence *
xe_cpu_bind_update_pgtables(struct xe_cpu_bind *cpu_bind,
struct xe_cpu_bind_pt_update *pt_update);
void xe_cpu_bind_job_lock(struct xe_cpu_bind *cpu_bind,
struct xe_exec_queue *q);
void xe_cpu_bind_job_unlock(struct xe_cpu_bind *cpu_bind,
struct xe_exec_queue *q);
#if IS_ENABLED(CONFIG_PROVE_LOCKING)
void xe_cpu_bind_job_lock_assert(struct xe_exec_queue *q);
#else
static inline void xe_cpu_bind_job_lock_assert(struct xe_exec_queue *q)
{
}
#endif
#endif