aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_sync.h
blob: d284afbe917c19203473b30d0abc38ca88ffbfa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2021 Intel Corporation
 */

#ifndef _XE_SYNC_H_
#define _XE_SYNC_H_

#include "xe_sync_types.h"

struct xe_device;
struct xe_exec_queue;
struct xe_file;
struct xe_sched_job;
struct xe_vm;

#define SYNC_PARSE_FLAG_EXEC			BIT(0)
#define SYNC_PARSE_FLAG_LR_MODE			BIT(1)
#define SYNC_PARSE_FLAG_DISALLOW_USER_FENCE	BIT(2)

int xe_sync_entry_parse(struct xe_device *xe, struct xe_file *xef,
			struct xe_sync_entry *sync,
			struct drm_xe_sync __user *sync_user,
			unsigned int flags);
int xe_sync_entry_wait(struct xe_sync_entry *sync);
int xe_sync_entry_add_deps(struct xe_sync_entry *sync,
			   struct xe_sched_job *job);
void xe_sync_entry_signal(struct xe_sync_entry *sync,
			  struct xe_sched_job *job,
			  struct dma_fence *fence);
void xe_sync_entry_cleanup(struct xe_sync_entry *sync);
struct dma_fence *
xe_sync_in_fence_get(struct xe_sync_entry *sync, int num_sync,
		     struct xe_exec_queue *q, struct xe_vm *vm);

#endif