blob: 849bf3c1061ece36446d8a3d65c90b59cac678f7 (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2022 Intel Corporation
*/
#ifndef __I915_GEM_VM_BIND_H
#define __I915_GEM_VM_BIND_H
#include "i915_drv.h"
#define assert_vm_bind_held(vm) lockdep_assert_held(&(vm)->vm_bind_lock)
static inline void i915_gem_vm_bind_lock(struct i915_address_space *vm)
{
mutex_lock(&vm->vm_bind_lock);
}
static inline int
i915_gem_vm_bind_lock_interruptible(struct i915_address_space *vm)
{
return mutex_lock_interruptible(&vm->vm_bind_lock);
}
static inline void i915_gem_vm_bind_unlock(struct i915_address_space *vm)
{
mutex_unlock(&vm->vm_bind_lock);
}
static inline int i915_gem_vm_priv_lock(struct i915_address_space *vm,
struct i915_gem_ww_ctx *ww)
{
return i915_gem_object_lock(vm->root_obj, ww);
}
static inline void i915_gem_vm_priv_unlock(struct i915_address_space *vm)
{
i915_gem_object_unlock(vm->root_obj);
}
struct i915_vma *
i915_gem_vm_bind_lookup_vma(struct i915_address_space *vm, u64 va);
void i915_gem_vm_bind_remove(struct i915_vma *vma, bool release_obj);
int i915_gem_vm_bind_obj(struct i915_address_space *vm,
struct drm_i915_gem_vm_bind *va,
struct drm_file *file);
int i915_gem_vm_unbind_obj(struct i915_address_space *vm,
struct drm_i915_gem_vm_unbind *va);
void i915_vm_bind_signal_fence(struct i915_vma *vma,
struct dma_fence * const fence);
#endif /* __I915_GEM_VM_BIND_H */
|