فهرست منبع

drm/i915: Move i915_ppgtt_close() into i915_gem_gtt.c

Move it alongside its ppgtt counterparts, in order to make it available
for the ppgtt selftests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170111210937.29252-26-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Chris Wilson 8 سال پیش
والد
کامیت
0c7eeda1af
3فایلهای تغییر یافته به همراه22 افزوده شده و 21 حذف شده
  1. 0 21
      drivers/gpu/drm/i915/i915_gem_context.c
  2. 21 0
      drivers/gpu/drm/i915/i915_gem_gtt.c
  3. 1 0
      drivers/gpu/drm/i915/i915_gem_gtt.h

+ 0 - 21
drivers/gpu/drm/i915/i915_gem_context.c

@@ -205,27 +205,6 @@ alloc_context_obj(struct drm_i915_private *dev_priv, u64 size)
 	return obj;
 	return obj;
 }
 }
 
 
-static void i915_ppgtt_close(struct i915_address_space *vm)
-{
-	struct list_head *phases[] = {
-		&vm->active_list,
-		&vm->inactive_list,
-		&vm->unbound_list,
-		NULL,
-	}, **phase;
-
-	GEM_BUG_ON(vm->closed);
-	vm->closed = true;
-
-	for (phase = phases; *phase; phase++) {
-		struct i915_vma *vma, *vn;
-
-		list_for_each_entry_safe(vma, vn, *phase, vm_link)
-			if (!i915_vma_is_closed(vma))
-				i915_vma_close(vma);
-	}
-}
-
 static void context_close(struct i915_gem_context *ctx)
 static void context_close(struct i915_gem_context *ctx)
 {
 {
 	i915_gem_context_set_closed(ctx);
 	i915_gem_context_set_closed(ctx);

+ 21 - 0
drivers/gpu/drm/i915/i915_gem_gtt.c

@@ -2267,6 +2267,27 @@ i915_ppgtt_create(struct drm_i915_private *dev_priv,
 	return ppgtt;
 	return ppgtt;
 }
 }
 
 
+void i915_ppgtt_close(struct i915_address_space *vm)
+{
+	struct list_head *phases[] = {
+		&vm->active_list,
+		&vm->inactive_list,
+		&vm->unbound_list,
+		NULL,
+	}, **phase;
+
+	GEM_BUG_ON(vm->closed);
+	vm->closed = true;
+
+	for (phase = phases; *phase; phase++) {
+		struct i915_vma *vma, *vn;
+
+		list_for_each_entry_safe(vma, vn, *phase, vm_link)
+			if (!i915_vma_is_closed(vma))
+				i915_vma_close(vma);
+	}
+}
+
 void i915_ppgtt_release(struct kref *kref)
 void i915_ppgtt_release(struct kref *kref)
 {
 {
 	struct i915_hw_ppgtt *ppgtt =
 	struct i915_hw_ppgtt *ppgtt =

+ 1 - 0
drivers/gpu/drm/i915/i915_gem_gtt.h

@@ -515,6 +515,7 @@ void i915_ppgtt_release(struct kref *kref);
 struct i915_hw_ppgtt *i915_ppgtt_create(struct drm_i915_private *dev_priv,
 struct i915_hw_ppgtt *i915_ppgtt_create(struct drm_i915_private *dev_priv,
 					struct drm_i915_file_private *fpriv,
 					struct drm_i915_file_private *fpriv,
 					const char *name);
 					const char *name);
+void i915_ppgtt_close(struct i915_address_space *vm);
 static inline void i915_ppgtt_get(struct i915_hw_ppgtt *ppgtt)
 static inline void i915_ppgtt_get(struct i915_hw_ppgtt *ppgtt)
 {
 {
 	if (ppgtt)
 	if (ppgtt)