@@ -703,6 +703,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc);
* @gpuvm: pointer to the &drm_gpuvm to initialize
* @r_obj: the root &drm_gem_object providing the GPUVM's common &dma_resv
* @name: the name of the GPU VA space
+ * @flags: the &drm_gpuvm_flags for this GPUVM
* @start_offset: the start offset of the GPU VA space
* @range: the size of the GPU VA space
* @reserve_offset: the start of the kernel reserved GPU VA area
@@ -716,7 +717,7 @@ EXPORT_SYMBOL_GPL(drm_gpuvm_root_object_alloc);
*/
void
drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj,
- const char *name,
+ const char *name, enum drm_gpuvm_flags flags,
u64 start_offset, u64 range,
u64 reserve_offset, u64 reserve_range,
const struct drm_gpuvm_ops *ops)
@@ -729,6 +730,7 @@ drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj,
gpuvm->mm_range = range;
gpuvm->name = name ? name : "unknown";
+ gpuvm->flags = flags;
gpuvm->ops = ops;
gpuvm->r_obj = r_obj;
@@ -1843,7 +1843,7 @@ nouveau_uvmm_init(struct nouveau_uvmm *uvmm, struct nouveau_cli *cli,
uvmm->kernel_managed_addr = kernel_managed_addr;
uvmm->kernel_managed_size = kernel_managed_size;
- drm_gpuvm_init(&uvmm->base, r_obj, cli->name,
+ drm_gpuvm_init(&uvmm->base, r_obj, cli->name, 0,
NOUVEAU_VA_SPACE_START,
NOUVEAU_VA_SPACE_END,
kernel_managed_addr, kernel_managed_size,
@@ -183,6 +183,16 @@ static inline bool drm_gpuva_invalidated(struct drm_gpuva *va)
return va->flags & DRM_GPUVA_INVALIDATED;
}
+/**
+ * enum drm_gpuvm_flags - flags for struct drm_gpuvm
+ */
+enum drm_gpuvm_flags {
+ /**
+ * @DRM_GPUVM_USERBITS: user defined bits
+ */
+ DRM_GPUVM_USERBITS = (1 << 0),
+};
+
/**
* struct drm_gpuvm - DRM GPU VA Manager
*
@@ -201,6 +211,11 @@ struct drm_gpuvm {
*/
const char *name;
+ /**
+ * @flags: the &drm_gpuvm_flags of this GPUVM
+ */
+ enum drm_gpuvm_flags flags;
+
/**
* @mm_start: start of the VA space
*/
@@ -246,7 +261,7 @@ struct drm_gpuvm {
};
void drm_gpuvm_init(struct drm_gpuvm *gpuvm, struct drm_gem_object *r_obj,
- const char *name,
+ const char *name, enum drm_gpuvm_flags flags,
u64 start_offset, u64 range,
u64 reserve_offset, u64 reserve_range,
const struct drm_gpuvm_ops *ops);
Introduce flags for struct drm_gpuvm, this required by subsequent commits. Signed-off-by: Danilo Krummrich <dakr@redhat.com> --- drivers/gpu/drm/drm_gpuvm.c | 4 +++- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 2 +- include/drm/drm_gpuvm.h | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-)