| 1 |
|
| 2 | |
| 3 | * Copyright © 2021 Intel Corporation
|
| 4 |
|
| 5 |
|
| 6 | #ifndef _XE_SYNC_H_
|
| 7 | #define _XE_SYNC_H_
|
| 8 |
|
| 9 | #include "xe_sync_types.h"
|
| 10 |
|
| 11 | struct drm_syncobj;
|
| 12 | struct xe_device;
|
| 13 | struct xe_exec_queue;
|
| 14 | struct xe_file;
|
| 15 | struct xe_sched_job;
|
| 16 | struct xe_vm;
|
| 17 |
|
| 18 | #define SYNC_PARSE_FLAG_EXEC BIT(0)
|
| 19 | #define SYNC_PARSE_FLAG_LR_MODE BIT(1)
|
| 20 | #define SYNC_PARSE_FLAG_DISALLOW_USER_FENCE BIT(2)
|
| 21 |
|
| 22 | int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
|
| 23 | struct xe_sync_entry *sync,
|
| 24 | struct drm_xe_sync __user *sync_user,
|
| 25 | struct drm_syncobj *ufence_syncobj,
|
| 26 | u64 ufence_timeline_value,
|
| 27 | unsigned int flags);
|
| 28 | int xe_sync_entry_add_deps(struct xe_sync_entry *sync,
|
| 29 | struct xe_sched_job *job);
|
| 30 | void xe_sync_entry_signal(struct xe_sync_entry *sync,
|
| 31 | struct dma_fence *fence);
|
| 32 | int xe_sync_entry_wait(struct xe_sync_entry *sync);
|
| 33 | bool xe_sync_needs_wait(struct xe_sync_entry *sync);
|
| 34 | void xe_sync_entry_cleanup(struct xe_sync_entry *sync);
|
| 35 | struct dma_fence *
|
| 36 | xe_sync_in_fence_get(struct xe_sync_entry *sync, int num_sync,
|
| 37 | struct xe_exec_queue *q, struct xe_vm *vm);
|
| 38 |
|
| 39 | static inline bool xe_sync_is_ufence(struct xe_sync_entry *sync)
|
| 40 | {
|
| 41 | return !!sync->ufence;
|
| 42 | }
|
| 43 |
|
| 44 | struct xe_user_fence *__xe_sync_ufence_get(struct xe_user_fence *ufence);
|
| 45 | struct xe_user_fence *xe_sync_ufence_get(struct xe_sync_entry *sync);
|
| 46 | void xe_sync_ufence_put(struct xe_user_fence *ufence);
|
| 47 | int xe_sync_ufence_get_status(struct xe_user_fence *ufence);
|
| 48 |
|
| 49 | #endif
|